@cyanheads/calculator-mcp-server 0.4.1 → 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 +26 -25
- package/CLAUDE.md +26 -25
- package/README.md +62 -49
- package/changelog/0.4.x/0.4.2.md +26 -0
- package/changelog/0.4.x/0.4.3.md +28 -0
- package/changelog/template.md +7 -24
- package/dist/config/server-config.d.ts +3 -3
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +6 -8
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/calculate.tool.d.ts +10 -0
- package/dist/mcp-server/tools/definitions/calculate.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/calculate.tool.js +10 -0
- package/dist/mcp-server/tools/definitions/calculate.tool.js.map +1 -1
- package/package.json +11 -10
- package/server.json +5 -5
package/AGENTS.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** calculator-mcp-server
|
|
4
|
-
**Version:** 0.4.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
6
|
-
**Engines:** Bun ≥1.
|
|
4
|
+
**Version:** 0.4.3
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
|
|
6
|
+
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` 2.0.0
|
|
8
|
-
**Zod:** 4.
|
|
8
|
+
**Zod:** 4.6.1
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
11
11
|
|
|
@@ -173,7 +173,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
173
173
|
|
|
174
174
|
Handlers throw — the framework catches, classifies, and formats.
|
|
175
175
|
|
|
176
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. `recovery` is required (≥ 5 words) and is the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire; override with an explicit recovery hint only when dynamic context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
176
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. `recovery` is required (≥ 5 words) and is the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire; override with an explicit recovery hint only when dynamic context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
|
|
177
177
|
|
|
178
178
|
On the wire, tool errors mirror the success-path `format-parity` invariant — both `content[]` (markdown, read by clients like Claude Desktop) and `structuredContent.error` (JSON `{ code, message, data? }`, read by clients like Claude Code) carry the same payload, with `data.recovery.hint` mirrored into the markdown text when present.
|
|
179
179
|
|
|
@@ -252,9 +252,9 @@ src/
|
|
|
252
252
|
|
|
253
253
|
## Skills
|
|
254
254
|
|
|
255
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
255
|
+
Skills are modular instructions in `framework-skills/` at the project root. Read them directly when a task matches — e.g., `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the registry. Keep development skills out of the plugin-host auto-loaded root `skills/` directory.
|
|
256
256
|
|
|
257
|
-
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
257
|
+
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `framework-skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
258
258
|
|
|
259
259
|
Available skills:
|
|
260
260
|
|
|
@@ -270,12 +270,13 @@ Available skills:
|
|
|
270
270
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
271
271
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
272
272
|
| `code-simplifier` | Post-session code review and cleanup against `git diff` — modernize syntax, consolidate duplication, align with codebase |
|
|
273
|
-
| `git-wrapup` | Land working-tree changes as a
|
|
273
|
+
| `git-wrapup` | Land working-tree changes as a commit stack — version bump, changelog, verify, commit by concern. No tag or push to main. |
|
|
274
274
|
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
275
275
|
| `techniques` | Reusable response/data-shaping patterns (outline-on-overflow, capped-list disclosure) |
|
|
276
276
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
277
277
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
278
|
-
| `release-
|
|
278
|
+
| `release-pr-review` | Review an open release PR; applies only to projects declaring release PR mode. |
|
|
279
|
+
| `release-and-publish` | Tag + push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
279
280
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
280
281
|
| `orchestrations` | Chain task skills into a gated multi-phase pipeline — build-out, QA-fix, update-ship — when you can spawn sub-agents |
|
|
281
282
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
@@ -293,7 +294,7 @@ Available skills:
|
|
|
293
294
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
|
294
295
|
| `api-workers` | Cloudflare Workers runtime |
|
|
295
296
|
|
|
296
|
-
**Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
|
|
297
|
+
**Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `framework-skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
|
|
297
298
|
|
|
298
299
|
When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
|
|
299
300
|
|
|
@@ -307,9 +308,10 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
307
308
|
| `bun run rebuild` | Clean + build |
|
|
308
309
|
| `bun run clean` | Remove build artifacts |
|
|
309
310
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
310
|
-
| `bun run audit:
|
|
311
|
+
| `bun run audit:fix` | Upgrade vulnerable packages within existing ranges via `bun audit fix`; first response to a transitive advisory. |
|
|
312
|
+
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and audit. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe`; re-resolves every ranged dependency. |
|
|
311
313
|
| `bun run tree` | Generate directory structure doc |
|
|
312
|
-
| `bun run list-skills` | Print skill index from `skills/` frontmatter |
|
|
314
|
+
| `bun run list-skills` | Print skill index from `framework-skills/` frontmatter |
|
|
313
315
|
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
314
316
|
| `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
315
317
|
| `bun run lint:mcp` | Validate MCP definitions |
|
|
@@ -326,11 +328,13 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
326
328
|
|
|
327
329
|
## Bundling
|
|
328
330
|
|
|
331
|
+
The MCPB `manifest.json` keeps `author.name: "cyanheads"` as its established display identity. `package.json` uses the full Casey Hand author string; this is an intentional exception to generic author-name synchronization.
|
|
332
|
+
|
|
329
333
|
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. MCPB is stdio-only — HTTP deployments are unaffected. Delete `manifest.json` and `.mcpbignore` to skip; `lint:packaging` skips cleanly when `manifest.json` is absent.
|
|
330
334
|
|
|
331
335
|
**Adding an env var requires both files:** `server.json` (`environmentVariables[]`) and `manifest.json` (`mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies env var names match.
|
|
332
336
|
|
|
333
|
-
**README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `skills/polish-docs-meta/references/readme.md`.
|
|
337
|
+
**README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `framework-skills/polish-docs-meta/references/readme.md`.
|
|
334
338
|
|
|
335
339
|
---
|
|
336
340
|
|
|
@@ -355,27 +359,24 @@ security: false # optional — true flags security fi
|
|
|
355
359
|
|
|
356
360
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections. Omit entirely when there's nothing to say.
|
|
357
361
|
|
|
358
|
-
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
|
|
362
|
+
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security, Dependencies. Include only sections with entries — don't ship empty headers.
|
|
359
363
|
|
|
360
|
-
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `
|
|
364
|
+
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `framework-skills/release-and-publish/SKILL.md` for the tag format.
|
|
361
365
|
|
|
362
366
|
---
|
|
363
367
|
|
|
364
368
|
## Publishing
|
|
365
369
|
|
|
366
|
-
|
|
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.
|
|
367
373
|
|
|
368
374
|
### Wrapup flow
|
|
369
375
|
|
|
370
376
|
When running the git wrapup checklist (`polish-docs-meta` or equivalent):
|
|
371
377
|
|
|
372
378
|
- **Minimum version bump is `0.0.1` (patch)** unless the user specifies a larger bump.
|
|
373
|
-
-
|
|
374
|
-
|
|
375
|
-
```bash
|
|
376
|
-
git tag -a v<version> -m "v<version>"
|
|
377
|
-
git push && git push --tags
|
|
378
|
-
```
|
|
379
|
+
- `git-wrapup` owns the commit stack; `release-and-publish` owns the tag and push. Follow those skills rather than duplicating their commands here.
|
|
379
380
|
|
|
380
381
|
### Targets
|
|
381
382
|
|
|
@@ -420,7 +421,7 @@ import { getServerConfig } from '@/config/server-config.js';
|
|
|
420
421
|
- [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
|
|
421
422
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
422
423
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
423
|
-
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` =
|
|
424
|
-
- [ ] `.codex-plugin/mcp.json` updated — server name key
|
|
425
|
-
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry
|
|
424
|
+
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name; `interface.shortDescription` from `package.json` description
|
|
425
|
+
- [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; user-supplied variables are forwarded with `env_vars`, never empty `env` values
|
|
426
|
+
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name; user-supplied variables use declared `userConfig` options and `${user_config.<option>}` references, never empty `env` values
|
|
426
427
|
- [ ] `bun run devcheck` passes
|
package/CLAUDE.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** calculator-mcp-server
|
|
4
|
-
**Version:** 0.4.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
6
|
-
**Engines:** Bun ≥1.
|
|
4
|
+
**Version:** 0.4.3
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
|
|
6
|
+
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` 2.0.0
|
|
8
|
-
**Zod:** 4.
|
|
8
|
+
**Zod:** 4.6.1
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
11
11
|
|
|
@@ -173,7 +173,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
173
173
|
|
|
174
174
|
Handlers throw — the framework catches, classifies, and formats.
|
|
175
175
|
|
|
176
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. `recovery` is required (≥ 5 words) and is the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire; override with an explicit recovery hint only when dynamic context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
176
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. `recovery` is required (≥ 5 words) and is the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire; override with an explicit recovery hint only when dynamic context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
|
|
177
177
|
|
|
178
178
|
On the wire, tool errors mirror the success-path `format-parity` invariant — both `content[]` (markdown, read by clients like Claude Desktop) and `structuredContent.error` (JSON `{ code, message, data? }`, read by clients like Claude Code) carry the same payload, with `data.recovery.hint` mirrored into the markdown text when present.
|
|
179
179
|
|
|
@@ -252,9 +252,9 @@ src/
|
|
|
252
252
|
|
|
253
253
|
## Skills
|
|
254
254
|
|
|
255
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
255
|
+
Skills are modular instructions in `framework-skills/` at the project root. Read them directly when a task matches — e.g., `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the registry. Keep development skills out of the plugin-host auto-loaded root `skills/` directory.
|
|
256
256
|
|
|
257
|
-
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
257
|
+
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `framework-skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
258
258
|
|
|
259
259
|
Available skills:
|
|
260
260
|
|
|
@@ -270,12 +270,13 @@ Available skills:
|
|
|
270
270
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
271
271
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
272
272
|
| `code-simplifier` | Post-session code review and cleanup against `git diff` — modernize syntax, consolidate duplication, align with codebase |
|
|
273
|
-
| `git-wrapup` | Land working-tree changes as a
|
|
273
|
+
| `git-wrapup` | Land working-tree changes as a commit stack — version bump, changelog, verify, commit by concern. No tag or push to main. |
|
|
274
274
|
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
275
275
|
| `techniques` | Reusable response/data-shaping patterns (outline-on-overflow, capped-list disclosure) |
|
|
276
276
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
277
277
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
278
|
-
| `release-
|
|
278
|
+
| `release-pr-review` | Review an open release PR; applies only to projects declaring release PR mode. |
|
|
279
|
+
| `release-and-publish` | Tag + push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
279
280
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
280
281
|
| `orchestrations` | Chain task skills into a gated multi-phase pipeline — build-out, QA-fix, update-ship — when you can spawn sub-agents |
|
|
281
282
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
@@ -293,7 +294,7 @@ Available skills:
|
|
|
293
294
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
|
294
295
|
| `api-workers` | Cloudflare Workers runtime |
|
|
295
296
|
|
|
296
|
-
**Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
|
|
297
|
+
**Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `framework-skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
|
|
297
298
|
|
|
298
299
|
When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
|
|
299
300
|
|
|
@@ -307,9 +308,10 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
307
308
|
| `bun run rebuild` | Clean + build |
|
|
308
309
|
| `bun run clean` | Remove build artifacts |
|
|
309
310
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
310
|
-
| `bun run audit:
|
|
311
|
+
| `bun run audit:fix` | Upgrade vulnerable packages within existing ranges via `bun audit fix`; first response to a transitive advisory. |
|
|
312
|
+
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and audit. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe`; re-resolves every ranged dependency. |
|
|
311
313
|
| `bun run tree` | Generate directory structure doc |
|
|
312
|
-
| `bun run list-skills` | Print skill index from `skills/` frontmatter |
|
|
314
|
+
| `bun run list-skills` | Print skill index from `framework-skills/` frontmatter |
|
|
313
315
|
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
314
316
|
| `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
315
317
|
| `bun run lint:mcp` | Validate MCP definitions |
|
|
@@ -326,11 +328,13 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
326
328
|
|
|
327
329
|
## Bundling
|
|
328
330
|
|
|
331
|
+
The MCPB `manifest.json` keeps `author.name: "cyanheads"` as its established display identity. `package.json` uses the full Casey Hand author string; this is an intentional exception to generic author-name synchronization.
|
|
332
|
+
|
|
329
333
|
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. MCPB is stdio-only — HTTP deployments are unaffected. Delete `manifest.json` and `.mcpbignore` to skip; `lint:packaging` skips cleanly when `manifest.json` is absent.
|
|
330
334
|
|
|
331
335
|
**Adding an env var requires both files:** `server.json` (`environmentVariables[]`) and `manifest.json` (`mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies env var names match.
|
|
332
336
|
|
|
333
|
-
**README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `skills/polish-docs-meta/references/readme.md`.
|
|
337
|
+
**README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `framework-skills/polish-docs-meta/references/readme.md`.
|
|
334
338
|
|
|
335
339
|
---
|
|
336
340
|
|
|
@@ -355,27 +359,24 @@ security: false # optional — true flags security fi
|
|
|
355
359
|
|
|
356
360
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections. Omit entirely when there's nothing to say.
|
|
357
361
|
|
|
358
|
-
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
|
|
362
|
+
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security, Dependencies. Include only sections with entries — don't ship empty headers.
|
|
359
363
|
|
|
360
|
-
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `
|
|
364
|
+
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `framework-skills/release-and-publish/SKILL.md` for the tag format.
|
|
361
365
|
|
|
362
366
|
---
|
|
363
367
|
|
|
364
368
|
## Publishing
|
|
365
369
|
|
|
366
|
-
|
|
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.
|
|
367
373
|
|
|
368
374
|
### Wrapup flow
|
|
369
375
|
|
|
370
376
|
When running the git wrapup checklist (`polish-docs-meta` or equivalent):
|
|
371
377
|
|
|
372
378
|
- **Minimum version bump is `0.0.1` (patch)** unless the user specifies a larger bump.
|
|
373
|
-
-
|
|
374
|
-
|
|
375
|
-
```bash
|
|
376
|
-
git tag -a v<version> -m "v<version>"
|
|
377
|
-
git push && git push --tags
|
|
378
|
-
```
|
|
379
|
+
- `git-wrapup` owns the commit stack; `release-and-publish` owns the tag and push. Follow those skills rather than duplicating their commands here.
|
|
379
380
|
|
|
380
381
|
### Targets
|
|
381
382
|
|
|
@@ -420,7 +421,7 @@ import { getServerConfig } from '@/config/server-config.js';
|
|
|
420
421
|
- [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
|
|
421
422
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
422
423
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
423
|
-
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` =
|
|
424
|
-
- [ ] `.codex-plugin/mcp.json` updated — server name key
|
|
425
|
-
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry
|
|
424
|
+
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name; `interface.shortDescription` from `package.json` description
|
|
425
|
+
- [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; user-supplied variables are forwarded with `env_vars`, never empty `env` values
|
|
426
|
+
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name; user-supplied variables use declared `userConfig` options and `${user_config.<option>}` references, never empty `env` values
|
|
426
427
|
- [ ] `bun run devcheck` passes
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/calculator-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/calculator-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -27,55 +27,60 @@
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Overview
|
|
31
31
|
|
|
32
|
-
|
|
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
|
+
|
|
36
|
+
| Tool | Description |
|
|
35
37
|
|:----------|:------------|
|
|
36
38
|
| `calculate` | Evaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives. |
|
|
37
39
|
|
|
38
|
-
###
|
|
39
|
-
|
|
40
|
-
A single tool covering 100% of the server's purpose. The `operation` parameter defaults to `evaluate`, so the common case is just `{ expression: "..." }`.
|
|
40
|
+
### Resources
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- Variable scope via `scope` parameter: `{ "x": 5, "y": 3 }`
|
|
46
|
-
- Configurable precision for numeric results
|
|
47
|
-
- Blank optional `variable` and `precision` values from form-based MCP clients are treated as omitted
|
|
42
|
+
| Resource | Description |
|
|
43
|
+
|:------------|:------------|
|
|
44
|
+
| `calculator://help` | Available functions, operators, constants, and syntax reference. |
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
## Capability reference
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
### `calculate` <sub>tool</sub>
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
- One `expression` per call. `operation` selects `evaluate` (default), `simplify`, or `derivative`; derivatives require `variable` (e.g. `"x"`).
|
|
51
|
+
- Evaluate arithmetic, trigonometry, logarithms, statistics, matrices, complex numbers, units, and combinatorics; assign numeric variables through `scope`, e.g. `{ "x": 5 }`.
|
|
52
|
+
- `numericType` selects `number`, `BigNumber`, or `Fraction`. Fractions require exact rational results; irrational or transcendental results return `fraction_unsupported` with guidance to change numeric type.
|
|
53
|
+
- `precision` sets 1–16 significant digits for numeric results. Blank optional `variable` and `precision` values are treated as omitted; scope and precision do not affect symbolic operations.
|
|
54
|
+
- Simplification includes algebraic and trigonometric identities (`2x + 3x` → `5 * x`); `unchanged: true` identifies expressions the simplifier cannot reduce, including polynomial factoring and rational cancellation cases.
|
|
55
|
+
- Returns the result string, result type, original expression, and operation. Validation failures include typed reasons and recovery hints.
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
### `calculator://help` <sub>resource</sub>
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
- Markdown reference for functions, operators, constants, units, and expression syntax; no parameters.
|
|
62
|
+
- Examples cover scope, matrices, complex numbers, precision, and all three operations.
|
|
63
|
+
- Cacheable for 24 hours with public scope (`cacheHint`) — static content that never changes at runtime.
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
- Runs locally (stdio/HTTP) or in Docker
|
|
65
|
+
## Features
|
|
66
|
+
|
|
67
|
+
Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): stdio and Streamable HTTP transports, pluggable auth (`none` / `jwt` / `oauth`), swappable storage (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`), structured logging with optional OpenTelemetry tracing.
|
|
67
68
|
|
|
68
69
|
Calculator-specific:
|
|
69
70
|
|
|
70
71
|
- Hardened math.js v15 instance — dangerous functions disabled, evaluation sandboxed via `vm.runInNewContext()` with timeout
|
|
71
72
|
- No auth required — all operations are read-only and stateless
|
|
72
|
-
- Input validation: expression length limits
|
|
73
|
+
- Input validation: expression length limits and rejection of multiple statements; matrix row separators and string contents remain valid
|
|
73
74
|
- Result validation: blocked result types (functions, parsers, result sets), configurable max result size
|
|
74
75
|
- Scope sanitization: numeric-only values, prototype pollution prevention (blocked `__proto__`, `constructor`, etc.)
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
Agent-friendly output:
|
|
78
|
+
|
|
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
|
|
77
82
|
|
|
78
|
-
## Getting
|
|
83
|
+
## Getting started
|
|
79
84
|
|
|
80
85
|
### Public Hosted Instance
|
|
81
86
|
|
|
@@ -102,7 +107,11 @@ Add one of the following to your MCP client configuration file:
|
|
|
102
107
|
"calculator-mcp-server": {
|
|
103
108
|
"type": "stdio",
|
|
104
109
|
"command": "bunx",
|
|
105
|
-
"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
|
+
}
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
117
|
}
|
|
@@ -116,7 +125,11 @@ Or with npx (no Bun required):
|
|
|
116
125
|
"calculator-mcp-server": {
|
|
117
126
|
"type": "stdio",
|
|
118
127
|
"command": "npx",
|
|
119
|
-
"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
|
+
}
|
|
120
133
|
}
|
|
121
134
|
}
|
|
122
135
|
}
|
|
@@ -140,29 +153,37 @@ Or with Docker:
|
|
|
140
153
|
}
|
|
141
154
|
```
|
|
142
155
|
|
|
156
|
+
For Streamable HTTP, set the transport and start the built server:
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
MCP_HTTP_PORT=3010 bun run start:http
|
|
160
|
+
# Server listens at http://localhost:3010/mcp
|
|
161
|
+
```
|
|
162
|
+
|
|
143
163
|
### Prerequisites
|
|
144
164
|
|
|
145
|
-
- [Bun v1.
|
|
165
|
+
- [Bun v1.4.0](https://bun.sh/) or higher
|
|
146
166
|
|
|
147
167
|
### Installation
|
|
148
168
|
|
|
149
169
|
1. **Clone the repository:**
|
|
170
|
+
|
|
150
171
|
```sh
|
|
151
172
|
git clone https://github.com/cyanheads/calculator-mcp-server.git
|
|
152
173
|
```
|
|
153
174
|
|
|
154
175
|
2. **Navigate into the directory:**
|
|
176
|
+
|
|
155
177
|
```sh
|
|
156
178
|
cd calculator-mcp-server
|
|
157
179
|
```
|
|
158
180
|
|
|
159
181
|
3. **Install dependencies:**
|
|
182
|
+
|
|
160
183
|
```sh
|
|
161
184
|
bun install
|
|
162
185
|
```
|
|
163
186
|
|
|
164
|
-
---
|
|
165
|
-
|
|
166
187
|
## Configuration
|
|
167
188
|
|
|
168
189
|
| Variable | Description | Default |
|
|
@@ -171,20 +192,19 @@ bun install
|
|
|
171
192
|
| `CALC_EVALUATION_TIMEOUT_MS` | Maximum evaluation time in milliseconds (100–30,000). | `5000` |
|
|
172
193
|
| `CALC_MAX_RESULT_LENGTH` | Maximum result string length in characters (1,000–1,000,000). | `100000` |
|
|
173
194
|
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
|
|
174
|
-
| `MCP_HTTP_HOST` | Hostname for the HTTP server. | `
|
|
195
|
+
| `MCP_HTTP_HOST` | Hostname for the HTTP server. | `127.0.0.1` |
|
|
175
196
|
| `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |
|
|
176
197
|
| `MCP_HTTP_ENDPOINT_PATH` | Path for the HTTP MCP endpoint. | `/mcp` |
|
|
177
198
|
| `MCP_HTTP_MAX_BODY_BYTES` | Maximum inbound HTTP request size; `0` disables the limit. | `1048576` |
|
|
178
199
|
| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
|
|
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` |
|
|
179
201
|
| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
|
|
180
202
|
|
|
181
203
|
See [`.env.example`](./.env.example) for optional session, resumability, logging, and telemetry settings.
|
|
182
204
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
## Running the Server
|
|
205
|
+
## Running the server
|
|
186
206
|
|
|
187
|
-
### Local
|
|
207
|
+
### Local development
|
|
188
208
|
|
|
189
209
|
- **Build and run the production version:**
|
|
190
210
|
```sh
|
|
@@ -205,11 +225,9 @@ docker build -t calculator-mcp-server .
|
|
|
205
225
|
docker run -p 3010:3010 calculator-mcp-server
|
|
206
226
|
```
|
|
207
227
|
|
|
208
|
-
The image defaults to Streamable HTTP on port `3010`, stateless sessions, and logs at `/var/log/calculator-mcp-server`.
|
|
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.
|
|
209
229
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
## Project Structure
|
|
230
|
+
## Project structure
|
|
213
231
|
|
|
214
232
|
| Directory | Purpose |
|
|
215
233
|
|:----------|:--------|
|
|
@@ -218,10 +236,9 @@ The image defaults to Streamable HTTP on port `3010`, stateless sessions, and lo
|
|
|
218
236
|
| `src/services/` | Domain service integrations (MathService). |
|
|
219
237
|
| `src/config/` | Environment variable parsing and validation with Zod. |
|
|
220
238
|
| `docs/` | Generated directory tree. |
|
|
239
|
+
| `tests/` | Calculation, configuration, and response-contract tests. |
|
|
221
240
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
## Development Guide
|
|
241
|
+
## Development guide
|
|
225
242
|
|
|
226
243
|
See [`AGENTS.md`](./AGENTS.md) or [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
|
|
227
244
|
|
|
@@ -229,19 +246,15 @@ See [`AGENTS.md`](./AGENTS.md) or [`CLAUDE.md`](./CLAUDE.md) for development gui
|
|
|
229
246
|
- Use `ctx.log` for logging
|
|
230
247
|
- Register new tools and resources in `src/index.ts`
|
|
231
248
|
|
|
232
|
-
---
|
|
233
|
-
|
|
234
249
|
## Contributing
|
|
235
250
|
|
|
236
|
-
Issues
|
|
251
|
+
Issues are welcome. Run checks before submitting:
|
|
237
252
|
|
|
238
253
|
```sh
|
|
239
254
|
bun run devcheck
|
|
240
255
|
bun run test
|
|
241
256
|
```
|
|
242
257
|
|
|
243
|
-
---
|
|
244
|
-
|
|
245
258
|
## License
|
|
246
259
|
|
|
247
260
|
Apache-2.0 — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Framework adoption and calculator configuration"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.4.2 — 2026-09-13
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **Calculator limits** — Claude Code and Codex plugins now expose the optional expression, timeout, and result limits; blank MCPB settings resolve to the documented defaults.
|
|
12
|
+
- **Configuration validation** — blank and whole-value `${…}` placeholders fall back to the documented defaults (`@cyanheads/mcp-ts-core` 0.13.0), while a malformed partial placeholder now fails startup instead of silently defaulting.
|
|
13
|
+
- **HTTP sessions** — the example configuration selects stateless serving to match the shipped container, while an unset session mode retains the framework's stateful `auto` resolution.
|
|
14
|
+
- **Framework behavior** — `@cyanheads/mcp-ts-core` 0.12.7 returns a structured `InvalidParams` (-32602) envelope for argument rejections; 0.12.8 stops a trailing slash on `MCP_PUBLIC_URL` doubling in advertised links; 0.12.9 closes a cancelled request's SSE stream immediately.
|
|
15
|
+
- **Runtime requirement** — Bun 1.4.0 is now the minimum supported Bun release.
|
|
16
|
+
- **Project tooling** — framework skills moved to `framework-skills/`; `audit:fix` runs `bun audit fix` (0.13.0); devcheck, packaging validation, issue forms, and release guidance were synced to the current framework assets.
|
|
17
|
+
|
|
18
|
+
## Dependencies
|
|
19
|
+
|
|
20
|
+
- `@cyanheads/mcp-ts-core` `^0.12.3` → `^0.13.0`
|
|
21
|
+
- `zod` `^4.4.3` → `^4.6.1`
|
|
22
|
+
- `@biomejs/biome` `^2.5.9` → `^2.5.13`
|
|
23
|
+
- `@types/node` `^26.2.0` → `^26.5.1`
|
|
24
|
+
- `ignore` `^7.0.6` → `^7.0.9`
|
|
25
|
+
- `tsc-alias` `^1.9.2` → `^1.9.4`
|
|
26
|
+
- `vitest` `^4.1.11` → `^5.0.0`
|
|
@@ -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/changelog/template.md
CHANGED
|
@@ -117,30 +117,13 @@ security: false
|
|
|
117
117
|
in that unrelated item's metadata.
|
|
118
118
|
|
|
119
119
|
TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
|
|
120
|
-
via `gh release create --notes-from-tag`.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Dependency bumps: ← section header
|
|
128
|
-
← blank line
|
|
129
|
-
- `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
|
|
130
|
-
← blank line
|
|
131
|
-
Changed: ← only sections with entries
|
|
132
|
-
← blank line
|
|
133
|
-
- `format()` output includes `query` in text mode
|
|
134
|
-
← blank line
|
|
135
|
-
Added:
|
|
136
|
-
← blank line
|
|
137
|
-
- `manifest.json` scaffolded for MCPB bundle support
|
|
138
|
-
- Install badges (Claude Desktop, Cursor, VS Code)
|
|
139
|
-
← blank line
|
|
140
|
-
<N> tests pass; `bun run devcheck` clean. ← footer
|
|
141
|
-
|
|
142
|
-
Never a flat comma-separated string. Always structured markdown with
|
|
143
|
-
sections. The tag must scan well as a rendered GitHub Release page.
|
|
120
|
+
via `gh release create --notes-from-tag`. It is a condensed digest of this
|
|
121
|
+
entry, never a copy, and its format is owned by the `release-and-publish`
|
|
122
|
+
skill (step 4, "Create the annotated tag"): the entry's `summary:` as the
|
|
123
|
+
theme line without the version, flat headline bullets — no Keep-a-Changelog
|
|
124
|
+
section headers, no gates line — at most one deps line, issue backlinks,
|
|
125
|
+
and the changelog link last. In release-PR mode the `git-wrapup` skill
|
|
126
|
+
authors that digest as the PR body's `## Changes` and the tag copies it.
|
|
144
127
|
-->
|
|
145
128
|
|
|
146
129
|
## Added
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
declare const ServerConfigSchema: z.ZodObject<{
|
|
7
|
-
maxExpressionLength: z.
|
|
8
|
-
evaluationTimeoutMs: z.
|
|
9
|
-
maxResultLength: z.
|
|
7
|
+
maxExpressionLength: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
8
|
+
evaluationTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
9
|
+
maxResultLength: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
12
12
|
/** Lazy-parsed server config from env vars. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;iBAsBtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,+CAA+C;AAC/C,wBAAgB,eAAe,IAAI,YAAY,CAO9C"}
|
|
@@ -4,30 +4,28 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
7
|
-
/** Strip MCPB placeholder strings (e.g. `${user_config.X}`) to undefined so .default() applies. */
|
|
8
|
-
const stripPlaceholder = (v) => typeof v === 'string' && v.startsWith('${') ? undefined : v;
|
|
9
7
|
const ServerConfigSchema = z.object({
|
|
10
|
-
maxExpressionLength: z.
|
|
8
|
+
maxExpressionLength: z.coerce
|
|
11
9
|
.number()
|
|
12
10
|
.int()
|
|
13
11
|
.min(10)
|
|
14
12
|
.max(10_000)
|
|
15
13
|
.default(1000)
|
|
16
|
-
.describe('Maximum allowed expression string length (10–10,000)')
|
|
17
|
-
evaluationTimeoutMs: z.
|
|
14
|
+
.describe('Maximum allowed expression string length (10–10,000)'),
|
|
15
|
+
evaluationTimeoutMs: z.coerce
|
|
18
16
|
.number()
|
|
19
17
|
.int()
|
|
20
18
|
.min(100)
|
|
21
19
|
.max(30_000)
|
|
22
20
|
.default(5000)
|
|
23
|
-
.describe('Maximum evaluation time in milliseconds (100–30,000)')
|
|
24
|
-
maxResultLength: z.
|
|
21
|
+
.describe('Maximum evaluation time in milliseconds (100–30,000)'),
|
|
22
|
+
maxResultLength: z.coerce
|
|
25
23
|
.number()
|
|
26
24
|
.int()
|
|
27
25
|
.min(1_000)
|
|
28
26
|
.max(1_000_000)
|
|
29
27
|
.default(100_000)
|
|
30
|
-
.describe('Maximum result string length in characters (1,000–1,000,000)')
|
|
28
|
+
.describe('Maximum result string length in characters (1,000–1,000,000)'),
|
|
31
29
|
});
|
|
32
30
|
let _config;
|
|
33
31
|
/** Lazy-parsed server config from env vars. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,mBAAmB,EAAE,CAAC,CAAC,MAAM;SAC1B,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,EAAE,CAAC;SACP,GAAG,CAAC,MAAM,CAAC;SACX,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,sDAAsD,CAAC;IACnE,mBAAmB,EAAE,CAAC,CAAC,MAAM;SAC1B,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,GAAG,CAAC;SACR,GAAG,CAAC,MAAM,CAAC;SACX,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,sDAAsD,CAAC;IACnE,eAAe,EAAE,CAAC,CAAC,MAAM;SACtB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,KAAK,CAAC;SACV,GAAG,CAAC,SAAS,CAAC;SACd,OAAO,CAAC,OAAO,CAAC;SAChB,QAAQ,CAAC,8DAA8D,CAAC;CAC5E,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,+CAA+C;AAC/C,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,mBAAmB,EAAE,4BAA4B;QACjD,mBAAmB,EAAE,4BAA4B;QACjD,eAAe,EAAE,wBAAwB;KAC1C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
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
|
|
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,CA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BACd,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"}
|
|
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,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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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/calculator-mcp-server",
|
|
3
|
-
"version": "0.4.
|
|
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",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"rebuild": "bun scripts/clean.ts && bun scripts/build.ts",
|
|
25
25
|
"clean": "bun scripts/clean.ts",
|
|
26
26
|
"devcheck": "bun scripts/devcheck.ts",
|
|
27
|
+
"audit:fix": "bun audit fix",
|
|
27
28
|
"audit:refresh": "rm -f bun.lock && bun install && bun audit",
|
|
28
29
|
"tree": "bun scripts/tree.ts",
|
|
29
30
|
"list-skills": "bun scripts/list-skills.ts",
|
|
@@ -77,29 +78,29 @@
|
|
|
77
78
|
],
|
|
78
79
|
"engines": {
|
|
79
80
|
"node": ">=24.0.0",
|
|
80
|
-
"bun": ">=1.
|
|
81
|
+
"bun": ">=1.4.0"
|
|
81
82
|
},
|
|
82
83
|
"packageManager": "bun@1.4.0",
|
|
83
84
|
"publishConfig": {
|
|
84
85
|
"access": "public"
|
|
85
86
|
},
|
|
86
87
|
"overrides": {
|
|
87
|
-
"zod": "^4.
|
|
88
|
+
"zod": "^4.6.1"
|
|
88
89
|
},
|
|
89
90
|
"dependencies": {
|
|
90
|
-
"@cyanheads/mcp-ts-core": "^0.
|
|
91
|
+
"@cyanheads/mcp-ts-core": "^0.13.6",
|
|
91
92
|
"mathjs": "^15.2.0",
|
|
92
93
|
"pino-pretty": "^13.1.3",
|
|
93
|
-
"zod": "^4.
|
|
94
|
+
"zod": "^4.6.5"
|
|
94
95
|
},
|
|
95
96
|
"devDependencies": {
|
|
96
|
-
"@biomejs/biome": "^2.5.
|
|
97
|
+
"@biomejs/biome": "^2.5.14",
|
|
97
98
|
"@socketsecurity/bun-security-scanner": "^1.1.2",
|
|
98
|
-
"@types/node": "^26.
|
|
99
|
+
"@types/node": "^26.6.1",
|
|
99
100
|
"depcheck": "^1.4.7",
|
|
100
|
-
"ignore": "^7.0.
|
|
101
|
-
"tsc-alias": "^1.9.
|
|
101
|
+
"ignore": "^7.0.9",
|
|
102
|
+
"tsc-alias": "^1.9.5",
|
|
102
103
|
"typescript": "^7.0.2",
|
|
103
|
-
"vitest": "^
|
|
104
|
+
"vitest": "^5.0.1"
|
|
104
105
|
}
|
|
105
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.
|
|
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.
|
|
22
|
+
"version": "0.4.3",
|
|
23
23
|
"packageArguments": [
|
|
24
24
|
{
|
|
25
25
|
"type": "positional",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"name": "MCP_LOG_LEVEL",
|
|
57
|
-
"description": "Sets the minimum log level for output (e.g., 'debug', 'info', '
|
|
57
|
+
"description": "Sets the minimum log level for output (e.g., 'debug', 'info', 'warning').",
|
|
58
58
|
"format": "string",
|
|
59
59
|
"isRequired": false,
|
|
60
60
|
"default": "info"
|
|
@@ -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.
|
|
72
|
+
"version": "0.4.3",
|
|
73
73
|
"packageArguments": [
|
|
74
74
|
{
|
|
75
75
|
"type": "positional",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
"name": "MCP_LOG_LEVEL",
|
|
135
|
-
"description": "Sets the minimum log level for output (e.g., 'debug', 'info', '
|
|
135
|
+
"description": "Sets the minimum log level for output (e.g., 'debug', 'info', 'warning').",
|
|
136
136
|
"format": "string",
|
|
137
137
|
"isRequired": false,
|
|
138
138
|
"default": "info"
|