@cyanheads/calculator-mcp-server 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** calculator-mcp-server
4
- **Version:** 0.4.2
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.0`
4
+ **Version:** 0.4.3
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` 2.0.0
8
8
  **Zod:** 4.6.1
@@ -367,7 +367,9 @@ security: false # optional — true flags security fi
367
367
 
368
368
  ## Publishing
369
369
 
370
- This project releases directly from `main`. After `git-wrapup` finishes the versioned commit stack, run **`release-and-publish`** for the annotated tag, push, and publishing targets below.
370
+ **Every release goes through a release PR, straight-through** — `git-wrapup`'s "Release PR mode", mode `straight-through`. One run: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-and-publish` then fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. A caller's brief may run a given release as `gated` instead — a `release-pr-review` pass on the open PR before `release-and-publish`. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
371
+
372
+ After `git-wrapup` finishes the versioned commit stack, **`release-and-publish`** handles the annotated tag, push, and publishing targets below.
371
373
 
372
374
  ### Wrapup flow
373
375
 
package/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** calculator-mcp-server
4
- **Version:** 0.4.2
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.0`
4
+ **Version:** 0.4.3
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` 2.0.0
8
8
  **Zod:** 4.6.1
@@ -367,7 +367,9 @@ security: false # optional — true flags security fi
367
367
 
368
368
  ## Publishing
369
369
 
370
- This project releases directly from `main`. After `git-wrapup` finishes the versioned commit stack, run **`release-and-publish`** for the annotated tag, push, and publishing targets below.
370
+ **Every release goes through a release PR, straight-through** — `git-wrapup`'s "Release PR mode", mode `straight-through`. One run: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-and-publish` then fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. A caller's brief may run a given release as `gated` instead — a `release-pr-review` pass on the open PR before `release-and-publish`. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
371
+
372
+ After `git-wrapup` finishes the versioned commit stack, **`release-and-publish`** handles the annotated tag, push, and publishing targets below.
371
373
 
372
374
  ### Wrapup flow
373
375
 
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.4.2-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/calculator-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/calculator-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/calculator-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.4.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/calculator-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/calculator-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/calculator-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -29,17 +29,17 @@
29
29
 
30
30
  ## Overview
31
31
 
32
- An MCP calculator powered by math.js. Verify numeric results, simplify algebraic expressions, and compute symbolic derivatives through one tool. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
32
+ Calculator powered by math.js. Verify numeric results, simplify algebraic expressions, and compute symbolic derivatives through one tool. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
33
33
 
34
34
  ### Tools
35
35
 
36
- | Tool Name | Description |
36
+ | Tool | Description |
37
37
  |:----------|:------------|
38
38
  | `calculate` | Evaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives. |
39
39
 
40
40
  ### Resources
41
41
 
42
- | URI Pattern | Description |
42
+ | Resource | Description |
43
43
  |:------------|:------------|
44
44
  | `calculator://help` | Available functions, operators, constants, and syntax reference. |
45
45
 
@@ -60,8 +60,7 @@ An MCP calculator powered by math.js. Verify numeric results, simplify algebraic
60
60
 
61
61
  - Markdown reference for functions, operators, constants, units, and expression syntax; no parameters.
62
62
  - Examples cover scope, matrices, complex numbers, precision, and all three operations.
63
-
64
- ---
63
+ - Cacheable for 24 hours with public scope (`cacheHint`) — static content that never changes at runtime.
65
64
 
66
65
  ## Features
67
66
 
@@ -71,16 +70,15 @@ Calculator-specific:
71
70
 
72
71
  - Hardened math.js v15 instance — dangerous functions disabled, evaluation sandboxed via `vm.runInNewContext()` with timeout
73
72
  - No auth required — all operations are read-only and stateless
74
- - Input validation: expression length limits, numeric-only scope values, and rejection of multiple statements; matrix row separators and string contents remain valid
73
+ - Input validation: expression length limits and rejection of multiple statements; matrix row separators and string contents remain valid
75
74
  - Result validation: blocked result types (functions, parsers, result sets), configurable max result size
76
75
  - Scope sanitization: numeric-only values, prototype pollution prevention (blocked `__proto__`, `constructor`, etc.)
77
76
 
78
77
  Agent-friendly output:
79
78
 
80
- - Calculation results and recovery hints appear in both structured JSON and readable text.
81
- - Output echoes the expression and operation; numeric evaluations identify supplied scope variables and applied precision, while simplification reports whether it made progress.
82
-
83
- ---
79
+ - Effective-call echo — every response echoes the expression and operation, plus which scope variables and what precision were applied, so agents can verify what was actually computed
80
+ - Discriminated output contracts — `unchanged: true` on `simplify` flags a no-op result instead of silently returning the same expression
81
+ - Typed error reasons — validation and evaluation failures carry a typed `reason` (e.g. `fraction_unsupported`, `evaluation_timeout`, `disallowed_result_type`) plus an actionable recovery hint, rather than a raw exception
84
82
 
85
83
  ## Getting started
86
84
 
@@ -109,7 +107,11 @@ Add one of the following to your MCP client configuration file:
109
107
  "calculator-mcp-server": {
110
108
  "type": "stdio",
111
109
  "command": "bunx",
112
- "args": ["@cyanheads/calculator-mcp-server@latest"]
110
+ "args": ["@cyanheads/calculator-mcp-server@latest"],
111
+ "env": {
112
+ "MCP_TRANSPORT_TYPE": "stdio",
113
+ "MCP_LOG_LEVEL": "info"
114
+ }
113
115
  }
114
116
  }
115
117
  }
@@ -123,7 +125,11 @@ Or with npx (no Bun required):
123
125
  "calculator-mcp-server": {
124
126
  "type": "stdio",
125
127
  "command": "npx",
126
- "args": ["-y", "@cyanheads/calculator-mcp-server@latest"]
128
+ "args": ["-y", "@cyanheads/calculator-mcp-server@latest"],
129
+ "env": {
130
+ "MCP_TRANSPORT_TYPE": "stdio",
131
+ "MCP_LOG_LEVEL": "info"
132
+ }
127
133
  }
128
134
  }
129
135
  }
@@ -150,7 +156,7 @@ Or with Docker:
150
156
  For Streamable HTTP, set the transport and start the built server:
151
157
 
152
158
  ```sh
153
- MCP_SESSION_MODE=stateless MCP_HTTP_PORT=3010 bun run start:http
159
+ MCP_HTTP_PORT=3010 bun run start:http
154
160
  # Server listens at http://localhost:3010/mcp
155
161
  ```
156
162
 
@@ -178,8 +184,6 @@ cd calculator-mcp-server
178
184
  bun install
179
185
  ```
180
186
 
181
- ---
182
-
183
187
  ## Configuration
184
188
 
185
189
  | Variable | Description | Default |
@@ -188,18 +192,16 @@ bun install
188
192
  | `CALC_EVALUATION_TIMEOUT_MS` | Maximum evaluation time in milliseconds (100–30,000). | `5000` |
189
193
  | `CALC_MAX_RESULT_LENGTH` | Maximum result string length in characters (1,000–1,000,000). | `100000` |
190
194
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
191
- | `MCP_HTTP_HOST` | Hostname for the HTTP server. | `localhost` |
195
+ | `MCP_HTTP_HOST` | Hostname for the HTTP server. | `127.0.0.1` |
192
196
  | `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |
193
197
  | `MCP_HTTP_ENDPOINT_PATH` | Path for the HTTP MCP endpoint. | `/mcp` |
194
198
  | `MCP_HTTP_MAX_BODY_BYTES` | Maximum inbound HTTP request size; `0` disables the limit. | `1048576` |
195
199
  | `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
196
- | `MCP_SESSION_MODE` | `auto`, `stateful`, or `stateless`. Supplied configuration pins `stateless`; the framework default `auto` resolves to `stateful`. | `stateless` in supplied configuration |
200
+ | `MCP_SESSION_MODE` | `auto`, `stateful`, or `stateless`. The server declares `stateless` in code, so every launch path resolves the same way; setting this overrides that declaration. | `stateless` |
197
201
  | `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
198
202
 
199
203
  See [`.env.example`](./.env.example) for optional session, resumability, logging, and telemetry settings.
200
204
 
201
- ---
202
-
203
205
  ## Running the server
204
206
 
205
207
  ### Local development
@@ -225,8 +227,6 @@ docker run -p 3010:3010 calculator-mcp-server
225
227
 
226
228
  The image defaults to Streamable HTTP on port `3010`, stateless sessions, and logs at `/var/log/calculator-mcp-server`. OpenTelemetry dependencies are installed by default; build with `--build-arg OTEL_ENABLED=false` to omit them.
227
229
 
228
- ---
229
-
230
230
  ## Project structure
231
231
 
232
232
  | Directory | Purpose |
@@ -238,8 +238,6 @@ The image defaults to Streamable HTTP on port `3010`, stateless sessions, and lo
238
238
  | `docs/` | Generated directory tree. |
239
239
  | `tests/` | Calculation, configuration, and response-contract tests. |
240
240
 
241
- ---
242
-
243
241
  ## Development guide
244
242
 
245
243
  See [`AGENTS.md`](./AGENTS.md) or [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
@@ -248,8 +246,6 @@ See [`AGENTS.md`](./AGENTS.md) or [`CLAUDE.md`](./CLAUDE.md) for development gui
248
246
  - Use `ctx.log` for logging
249
247
  - Register new tools and resources in `src/index.ts`
250
248
 
251
- ---
252
-
253
249
  ## Contributing
254
250
 
255
251
  Issues are welcome. Run checks before submitting:
@@ -259,8 +255,6 @@ bun run devcheck
259
255
  bun run test
260
256
  ```
261
257
 
262
- ---
263
-
264
258
  ## License
265
259
 
266
260
  Apache-2.0 — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,28 @@
1
+ ---
2
+ summary: "MCP_SESSION_MODE is now declared stateless in code, argument rejections carry a reason and recovery hint, and calculate's own errors close with a reason suffix — all from the @cyanheads/mcp-ts-core 0.13.6 upgrade."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.4.3 — 2026-09-19
8
+
9
+ ## Added
10
+
11
+ - **CodeQL workflow** (`.github/workflows/codeql.yml`) — static analysis on push/PR to `main` and weekly, active while the repo's CodeQL default setup stays off.
12
+
13
+ ## Changed
14
+
15
+ - **`MCP_SESSION_MODE` now defaults to `stateless` in code** ([#28](https://github.com/cyanheads/calculator-mcp-server/issues/28)) — `createApp({ sessionMode: 'stateless' })` is the durable declaration; the env var only overrides it. No behavior change for the Docker image or hosted deployment, which already ran stateless.
16
+ - **A malformed `calculate` call now names the reason and a recovery step** — an argument rejection carries `data.reason: "invalid_arguments"` and its error text ends with a `Recovery: …` line (`@cyanheads/mcp-ts-core` 0.13.3).
17
+ - **`calculate`'s own error responses now close with a `(reason <reason>)` suffix** — `· not retryable` too for `evaluation_timeout`, the one entry that declares `retryable: false` (`@cyanheads/mcp-ts-core` 0.13.5); `structuredContent.error.data` is unchanged.
18
+ - **An unrecognized or near-miss argument key no longer fails the call outright** — an unexpected root key is dropped, and a key whose case-folded spelling matches exactly one of `calculate`'s declared parameters (e.g. `Expression` for `expression`) is accepted rather than rejected (`@cyanheads/mcp-ts-core` 0.13.4).
19
+ - **Project tooling** — dev scripts and skills synced to `@cyanheads/mcp-ts-core` 0.13.1–0.13.6 (dual-layout tsconfig resolution, a README version-badge parity check, `devcheck.config.json`'s lint truncation allowlist); releases now go through a `release/<version>` PR before publishing.
20
+
21
+ ## Dependencies
22
+
23
+ - `@cyanheads/mcp-ts-core` `^0.13.0` → `^0.13.6`
24
+ - `zod` `^4.6.1` → `^4.6.5`
25
+ - `@biomejs/biome` `^2.5.13` → `^2.5.14`
26
+ - `@types/node` `^26.5.1` → `^26.6.1`
27
+ - `tsc-alias` `^1.9.4` → `^1.9.5`
28
+ - `vitest` `^5.0.0` → `^5.0.1`
package/dist/index.js CHANGED
@@ -13,6 +13,11 @@ await createApp({
13
13
  title: 'calculator-mcp-server',
14
14
  tools: [calculateTool],
15
15
  resources: [helpResource],
16
+ /**
17
+ * No tool gates on `ctx.requestInput`, and nothing is held between calls, so
18
+ * the session store earns nothing here. `MCP_SESSION_MODE` still overrides.
19
+ */
20
+ sessionMode: 'stateless',
16
21
  instructions: 'Use `calculate` to verify math computations via math.js. `operation` selects `evaluate` (default, numeric), `simplify` (symbolic, with trig identities), or `derivative` (symbolic, requires `variable`). Covers arithmetic, trigonometry, logarithms, statistics, matrices, complex numbers, combinatorics, and unit conversion (e.g. `5 kg to lbs`). Pass variable values via `scope` (e.g. `{ "x": 5 }`) and bound numeric output with `precision` (1–16). One expression per call.',
17
22
  landing: {
18
23
  repoRoot: 'https://github.com/cyanheads/calculator-mcp-server',
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,uBAAuB;IAC9B,KAAK,EAAE,CAAC,aAAa,CAAC;IACtB,SAAS,EAAE,CAAC,YAAY,CAAC;IACzB,YAAY,EACV,wdAAwd;IAC1d,OAAO,EAAE;QACP,QAAQ,EAAE,oDAAoD;QAC9D,OAAO,EACL,+FAA+F;QACjG,WAAW,EAAE,KAAK;KACnB;IACD,KAAK;QACH,eAAe,CAAC,eAAe,EAAE,CAAC,CAAC;IACrC,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,uBAAuB;IAC9B,KAAK,EAAE,CAAC,aAAa,CAAC;IACtB,SAAS,EAAE,CAAC,YAAY,CAAC;IACzB;;;OAGG;IACH,WAAW,EAAE,WAAW;IACxB,YAAY,EACV,wdAAwd;IAC1d,OAAO,EAAE;QACP,QAAQ,EAAE,oDAAoD;QAC9D,OAAO,EACL,+FAA+F;QACjG,WAAW,EAAE,KAAK;KACnB;IACD,KAAK;QACH,eAAe,CAAC,eAAe,EAAE,CAAC,CAAC;IACrC,CAAC;CACF,CAAC,CAAC"}
@@ -35,46 +35,55 @@ export declare const calculateTool: import("@cyanheads/mcp-ts-core").ToolDefinit
35
35
  }, z.core.$strip>, readonly [{
36
36
  readonly reason: "empty_expression";
37
37
  readonly code: JsonRpcErrorCode.ValidationError;
38
+ readonly thrownBy: "service";
38
39
  readonly when: "Expression is empty or whitespace-only.";
39
40
  readonly recovery: "Provide a non-empty math expression in the expression parameter.";
40
41
  }, {
41
42
  readonly reason: "expression_too_long";
42
43
  readonly code: JsonRpcErrorCode.ValidationError;
44
+ readonly thrownBy: "service";
43
45
  readonly when: "Expression exceeds the configured max length (CALC_MAX_EXPRESSION_LENGTH).";
44
46
  readonly recovery: "Shorten the expression or split it into multiple separate calls.";
45
47
  }, {
46
48
  readonly reason: "multiple_expressions";
47
49
  readonly code: JsonRpcErrorCode.ValidationError;
50
+ readonly thrownBy: "service";
48
51
  readonly when: "Expression contains a separator (`;` or newline) outside matrix brackets.";
49
52
  readonly recovery: "Send one expression per call; issue separate calls for each statement.";
50
53
  }, {
51
54
  readonly reason: "reserved_scope_key";
52
55
  readonly code: JsonRpcErrorCode.ValidationError;
56
+ readonly thrownBy: "service";
53
57
  readonly when: "Scope contains a reserved JS property name (`__proto__`, `constructor`, etc.).";
54
58
  readonly recovery: "Rename the variable to avoid reserved JavaScript property names.";
55
59
  }, {
56
60
  readonly reason: "disallowed_result_type";
57
61
  readonly code: JsonRpcErrorCode.ValidationError;
62
+ readonly thrownBy: "service";
58
63
  readonly when: "Result is a function, parser, or multi-expression ResultSet, or the expression converts a function to a string (e.g. `cos.toString()`) — security guard.";
59
64
  readonly recovery: "Rewrite the expression to produce a value (number, matrix, unit) instead of a function or its source.";
60
65
  }, {
61
66
  readonly reason: "result_too_large";
62
67
  readonly code: JsonRpcErrorCode.ValidationError;
68
+ readonly thrownBy: "service";
63
69
  readonly when: "Stringified result exceeds the configured max size (CALC_MAX_RESULT_LENGTH).";
64
70
  readonly recovery: "Reduce precision, narrow the input range, or compute smaller subproblems separately.";
65
71
  }, {
66
72
  readonly reason: "undefined_result";
67
73
  readonly code: JsonRpcErrorCode.ValidationError;
74
+ readonly thrownBy: "service";
68
75
  readonly when: "Expression evaluated to Infinity, -Infinity, or NaN (e.g., division by zero).";
69
76
  readonly recovery: "Check for division by zero, log of non-positive numbers, or other undefined operations.";
70
77
  }, {
71
78
  readonly reason: "fraction_unsupported";
72
79
  readonly code: JsonRpcErrorCode.ValidationError;
80
+ readonly thrownBy: "service";
73
81
  readonly when: "numericType is \"Fraction\" but the expression has no exact rational value (irrational or transcendental result, e.g. sqrt, sin, log).";
74
82
  readonly recovery: "Retry with numericType \"number\" or \"BigNumber\" — those represent irrational and transcendental results.";
75
83
  }, {
76
84
  readonly reason: "parse_failed";
77
85
  readonly code: JsonRpcErrorCode.ValidationError;
86
+ readonly thrownBy: "service";
78
87
  readonly when: "mathjs could not parse the expression.";
79
88
  readonly recovery: "Check syntax for balanced parentheses, valid operators, and correct function names.";
80
89
  }, {
@@ -85,6 +94,7 @@ export declare const calculateTool: import("@cyanheads/mcp-ts-core").ToolDefinit
85
94
  }, {
86
95
  readonly reason: "evaluation_timeout";
87
96
  readonly code: JsonRpcErrorCode.Timeout;
97
+ readonly thrownBy: "service";
88
98
  readonly when: "Expression evaluation exceeded the configured timeout (CALC_EVALUATION_TIMEOUT_MS).";
89
99
  readonly retryable: false;
90
100
  readonly recovery: "Simplify the expression or reduce computational complexity to fit within the timeout.";
@@ -1 +1 @@
1
- {"version":3,"file":"calculate.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/calculate.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiPxB,CAAC"}
1
+ {"version":3,"file":"calculate.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/calculate.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2PxB,CAAC"}
@@ -75,54 +75,63 @@ export const calculateTool = tool('calculate', {
75
75
  {
76
76
  reason: 'empty_expression',
77
77
  code: JsonRpcErrorCode.ValidationError,
78
+ thrownBy: 'service',
78
79
  when: 'Expression is empty or whitespace-only.',
79
80
  recovery: 'Provide a non-empty math expression in the expression parameter.',
80
81
  },
81
82
  {
82
83
  reason: 'expression_too_long',
83
84
  code: JsonRpcErrorCode.ValidationError,
85
+ thrownBy: 'service',
84
86
  when: 'Expression exceeds the configured max length (CALC_MAX_EXPRESSION_LENGTH).',
85
87
  recovery: 'Shorten the expression or split it into multiple separate calls.',
86
88
  },
87
89
  {
88
90
  reason: 'multiple_expressions',
89
91
  code: JsonRpcErrorCode.ValidationError,
92
+ thrownBy: 'service',
90
93
  when: 'Expression contains a separator (`;` or newline) outside matrix brackets.',
91
94
  recovery: 'Send one expression per call; issue separate calls for each statement.',
92
95
  },
93
96
  {
94
97
  reason: 'reserved_scope_key',
95
98
  code: JsonRpcErrorCode.ValidationError,
99
+ thrownBy: 'service',
96
100
  when: 'Scope contains a reserved JS property name (`__proto__`, `constructor`, etc.).',
97
101
  recovery: 'Rename the variable to avoid reserved JavaScript property names.',
98
102
  },
99
103
  {
100
104
  reason: 'disallowed_result_type',
101
105
  code: JsonRpcErrorCode.ValidationError,
106
+ thrownBy: 'service',
102
107
  when: 'Result is a function, parser, or multi-expression ResultSet, or the expression converts a function to a string (e.g. `cos.toString()`) — security guard.',
103
108
  recovery: 'Rewrite the expression to produce a value (number, matrix, unit) instead of a function or its source.',
104
109
  },
105
110
  {
106
111
  reason: 'result_too_large',
107
112
  code: JsonRpcErrorCode.ValidationError,
113
+ thrownBy: 'service',
108
114
  when: 'Stringified result exceeds the configured max size (CALC_MAX_RESULT_LENGTH).',
109
115
  recovery: 'Reduce precision, narrow the input range, or compute smaller subproblems separately.',
110
116
  },
111
117
  {
112
118
  reason: 'undefined_result',
113
119
  code: JsonRpcErrorCode.ValidationError,
120
+ thrownBy: 'service',
114
121
  when: 'Expression evaluated to Infinity, -Infinity, or NaN (e.g., division by zero).',
115
122
  recovery: 'Check for division by zero, log of non-positive numbers, or other undefined operations.',
116
123
  },
117
124
  {
118
125
  reason: 'fraction_unsupported',
119
126
  code: JsonRpcErrorCode.ValidationError,
127
+ thrownBy: 'service',
120
128
  when: 'numericType is "Fraction" but the expression has no exact rational value (irrational or transcendental result, e.g. sqrt, sin, log).',
121
129
  recovery: 'Retry with numericType "number" or "BigNumber" — those represent irrational and transcendental results.',
122
130
  },
123
131
  {
124
132
  reason: 'parse_failed',
125
133
  code: JsonRpcErrorCode.ValidationError,
134
+ thrownBy: 'service',
126
135
  when: 'mathjs could not parse the expression.',
127
136
  recovery: 'Check syntax for balanced parentheses, valid operators, and correct function names.',
128
137
  },
@@ -135,6 +144,7 @@ export const calculateTool = tool('calculate', {
135
144
  {
136
145
  reason: 'evaluation_timeout',
137
146
  code: JsonRpcErrorCode.Timeout,
147
+ thrownBy: 'service',
138
148
  when: 'Expression evaluation exceeded the configured timeout (CALC_EVALUATION_TIMEOUT_MS).',
139
149
  retryable: false,
140
150
  recovery: 'Simplify the expression or reduce computational complexity to fit within the timeout.',
@@ -1 +1 @@
1
- {"version":3,"file":"calculate.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/calculate.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE;IAC7C,WAAW,EACT,0NAA0N;IAC5N,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAA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E,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"calculate.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/calculate.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE;IAC7C,WAAW,EACT,0NAA0N;IAC5N,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,uxBAAuxB,CACxxB;QACH,SAAS,EAAE,CAAC;aACT,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;aAC5C,OAAO,CAAC,UAAU,CAAC;aACnB,QAAQ,CACP,+dAA+d,CAChe;QACH,QAAQ,EAAE,CAAC;aACR,KAAK,CAAC;YACL,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;YAC5D,CAAC;iBACE,MAAM,EAAE;iBACR,GAAG,CAAC,EAAE,CAAC;iBACP,KAAK,CACJ,0BAA0B,EAC1B,wDAAwD,CACzD;iBACA,QAAQ,CAAC,mEAAmE,CAAC;SACjF,CAAC;aACD,QAAQ,EAAE;aACV,QAAQ,CACP,uIAAuI,CACxI;QACH,KAAK,EAAE,CAAC;aACL,MAAM,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,wBAAwB,SAAmB,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,SAAS,GACb,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACzF,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC;QACjD,MAAM,KAAK,GAAG;YACZ,qBAAqB,MAAM,CAAC,UAAU,IAAI;YAC1C,kBAAkB,MAAM,CAAC,SAAS,EAAE;YACpC,eAAe,MAAM,CAAC,MAAM,EAAE;YAC9B,aAAa,MAAM,CAAC,UAAU,EAAE;SACjC,CAAC;QACF,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACnC,qFAAqF;YACrF,KAAK,CAAC,IAAI,CACR,MAAM,CAAC,SAAS;gBACd,CAAC,CAAC,qEAAqE;gBACvE,CAAC,CAAC,4CAA4C,CACjD,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;YAChD,KAAK,CAAC,IAAI,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/calculator-mcp-server",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Evaluate, simplify, and differentiate mathematical expressions via MCP. STDIO or Streamable HTTP.",
5
5
  "mcpName": "io.github.cyanheads/calculator-mcp-server",
6
6
  "type": "module",
@@ -88,19 +88,19 @@
88
88
  "zod": "^4.6.1"
89
89
  },
90
90
  "dependencies": {
91
- "@cyanheads/mcp-ts-core": "^0.13.0",
91
+ "@cyanheads/mcp-ts-core": "^0.13.6",
92
92
  "mathjs": "^15.2.0",
93
93
  "pino-pretty": "^13.1.3",
94
- "zod": "^4.6.1"
94
+ "zod": "^4.6.5"
95
95
  },
96
96
  "devDependencies": {
97
- "@biomejs/biome": "^2.5.13",
97
+ "@biomejs/biome": "^2.5.14",
98
98
  "@socketsecurity/bun-security-scanner": "^1.1.2",
99
- "@types/node": "^26.5.1",
99
+ "@types/node": "^26.6.1",
100
100
  "depcheck": "^1.4.7",
101
101
  "ignore": "^7.0.9",
102
- "tsc-alias": "^1.9.4",
102
+ "tsc-alias": "^1.9.5",
103
103
  "typescript": "^7.0.2",
104
- "vitest": "^5.0.0"
104
+ "vitest": "^5.0.1"
105
105
  }
106
106
  }
package/server.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/cyanheads/calculator-mcp-server",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.4.2",
9
+ "version": "0.4.3",
10
10
  "remotes": [
11
11
  {
12
12
  "type": "streamable-http",
@@ -19,7 +19,7 @@
19
19
  "registryBaseUrl": "https://registry.npmjs.org",
20
20
  "identifier": "@cyanheads/calculator-mcp-server",
21
21
  "runtimeHint": "bun",
22
- "version": "0.4.2",
22
+ "version": "0.4.3",
23
23
  "packageArguments": [
24
24
  {
25
25
  "type": "positional",
@@ -69,7 +69,7 @@
69
69
  "registryBaseUrl": "https://registry.npmjs.org",
70
70
  "identifier": "@cyanheads/calculator-mcp-server",
71
71
  "runtimeHint": "bun",
72
- "version": "0.4.2",
72
+ "version": "0.4.3",
73
73
  "packageArguments": [
74
74
  {
75
75
  "type": "positional",