@cyanheads/calculator-mcp-server 0.4.1 → 0.4.2
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 +24 -25
- package/CLAUDE.md +24 -25
- package/README.md +49 -30
- package/changelog/0.4.x/0.4.2.md +26 -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/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.2
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.0`
|
|
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,22 @@ 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
|
-
After git
|
|
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.
|
|
367
371
|
|
|
368
372
|
### Wrapup flow
|
|
369
373
|
|
|
370
374
|
When running the git wrapup checklist (`polish-docs-meta` or equivalent):
|
|
371
375
|
|
|
372
376
|
- **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
|
-
```
|
|
377
|
+
- `git-wrapup` owns the commit stack; `release-and-publish` owns the tag and push. Follow those skills rather than duplicating their commands here.
|
|
379
378
|
|
|
380
379
|
### Targets
|
|
381
380
|
|
|
@@ -420,7 +419,7 @@ import { getServerConfig } from '@/config/server-config.js';
|
|
|
420
419
|
- [ ] `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
420
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
422
421
|
- [ ] 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
|
|
422
|
+
- [ ] `.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
|
|
423
|
+
- [ ] `.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
|
|
424
|
+
- [ ] `.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
425
|
- [ ] `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.2
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.0`
|
|
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,22 @@ 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
|
-
After git
|
|
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.
|
|
367
371
|
|
|
368
372
|
### Wrapup flow
|
|
369
373
|
|
|
370
374
|
When running the git wrapup checklist (`polish-docs-meta` or equivalent):
|
|
371
375
|
|
|
372
376
|
- **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
|
-
```
|
|
377
|
+
- `git-wrapup` owns the commit stack; `release-and-publish` owns the tag and push. Follow those skills rather than duplicating their commands here.
|
|
379
378
|
|
|
380
379
|
### Targets
|
|
381
380
|
|
|
@@ -420,7 +419,7 @@ import { getServerConfig } from '@/config/server-config.js';
|
|
|
420
419
|
- [ ] `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
420
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
422
421
|
- [ ] 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
|
|
422
|
+
- [ ] `.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
|
|
423
|
+
- [ ] `.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
|
|
424
|
+
- [ ] `.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
425
|
- [ ] `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,62 @@
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Overview
|
|
31
31
|
|
|
32
|
-
|
|
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.
|
|
33
|
+
|
|
34
|
+
### Tools
|
|
33
35
|
|
|
34
36
|
| Tool Name | Description |
|
|
35
37
|
|:----------|:------------|
|
|
36
38
|
| `calculate` | Evaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives. |
|
|
37
39
|
|
|
38
|
-
###
|
|
40
|
+
### Resources
|
|
41
|
+
|
|
42
|
+
| URI Pattern | Description |
|
|
43
|
+
|:------------|:------------|
|
|
44
|
+
| `calculator://help` | Available functions, operators, constants, and syntax reference. |
|
|
45
|
+
|
|
46
|
+
## Capability reference
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
### `calculate` <sub>tool</sub>
|
|
41
49
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
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.
|
|
48
56
|
|
|
49
57
|
---
|
|
50
58
|
|
|
51
|
-
|
|
59
|
+
### `calculator://help` <sub>resource</sub>
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
| `calculator://help` | Available functions, operators, constants, and syntax reference. |
|
|
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.
|
|
56
63
|
|
|
57
64
|
---
|
|
58
65
|
|
|
59
66
|
## Features
|
|
60
67
|
|
|
61
|
-
Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
|
|
62
|
-
|
|
63
|
-
- Declarative tool definitions — single file per tool, framework handles registration and validation
|
|
64
|
-
- Unified error handling across all tools
|
|
65
|
-
- Structured logging with optional OpenTelemetry tracing
|
|
66
|
-
- Runs locally (stdio/HTTP) or in Docker
|
|
68
|
+
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
69
|
|
|
68
70
|
Calculator-specific:
|
|
69
71
|
|
|
70
72
|
- Hardened math.js v15 instance — dangerous functions disabled, evaluation sandboxed via `vm.runInNewContext()` with timeout
|
|
71
73
|
- No auth required — all operations are read-only and stateless
|
|
72
|
-
- Input validation: expression length limits,
|
|
74
|
+
- Input validation: expression length limits, numeric-only scope values, and rejection of multiple statements; matrix row separators and string contents remain valid
|
|
73
75
|
- Result validation: blocked result types (functions, parsers, result sets), configurable max result size
|
|
74
76
|
- Scope sanitization: numeric-only values, prototype pollution prevention (blocked `__proto__`, `constructor`, etc.)
|
|
75
77
|
|
|
78
|
+
Agent-friendly output:
|
|
79
|
+
|
|
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
|
+
|
|
76
83
|
---
|
|
77
84
|
|
|
78
|
-
## Getting
|
|
85
|
+
## Getting started
|
|
79
86
|
|
|
80
87
|
### Public Hosted Instance
|
|
81
88
|
|
|
@@ -140,23 +147,33 @@ Or with Docker:
|
|
|
140
147
|
}
|
|
141
148
|
```
|
|
142
149
|
|
|
150
|
+
For Streamable HTTP, set the transport and start the built server:
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
MCP_SESSION_MODE=stateless MCP_HTTP_PORT=3010 bun run start:http
|
|
154
|
+
# Server listens at http://localhost:3010/mcp
|
|
155
|
+
```
|
|
156
|
+
|
|
143
157
|
### Prerequisites
|
|
144
158
|
|
|
145
|
-
- [Bun v1.
|
|
159
|
+
- [Bun v1.4.0](https://bun.sh/) or higher
|
|
146
160
|
|
|
147
161
|
### Installation
|
|
148
162
|
|
|
149
163
|
1. **Clone the repository:**
|
|
164
|
+
|
|
150
165
|
```sh
|
|
151
166
|
git clone https://github.com/cyanheads/calculator-mcp-server.git
|
|
152
167
|
```
|
|
153
168
|
|
|
154
169
|
2. **Navigate into the directory:**
|
|
170
|
+
|
|
155
171
|
```sh
|
|
156
172
|
cd calculator-mcp-server
|
|
157
173
|
```
|
|
158
174
|
|
|
159
175
|
3. **Install dependencies:**
|
|
176
|
+
|
|
160
177
|
```sh
|
|
161
178
|
bun install
|
|
162
179
|
```
|
|
@@ -176,15 +193,16 @@ bun install
|
|
|
176
193
|
| `MCP_HTTP_ENDPOINT_PATH` | Path for the HTTP MCP endpoint. | `/mcp` |
|
|
177
194
|
| `MCP_HTTP_MAX_BODY_BYTES` | Maximum inbound HTTP request size; `0` disables the limit. | `1048576` |
|
|
178
195
|
| `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 |
|
|
179
197
|
| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
|
|
180
198
|
|
|
181
199
|
See [`.env.example`](./.env.example) for optional session, resumability, logging, and telemetry settings.
|
|
182
200
|
|
|
183
201
|
---
|
|
184
202
|
|
|
185
|
-
## Running the
|
|
203
|
+
## Running the server
|
|
186
204
|
|
|
187
|
-
### Local
|
|
205
|
+
### Local development
|
|
188
206
|
|
|
189
207
|
- **Build and run the production version:**
|
|
190
208
|
```sh
|
|
@@ -205,11 +223,11 @@ docker build -t calculator-mcp-server .
|
|
|
205
223
|
docker run -p 3010:3010 calculator-mcp-server
|
|
206
224
|
```
|
|
207
225
|
|
|
208
|
-
The image defaults to Streamable HTTP on port `3010`, stateless sessions, and logs at `/var/log/calculator-mcp-server`.
|
|
226
|
+
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
227
|
|
|
210
228
|
---
|
|
211
229
|
|
|
212
|
-
## Project
|
|
230
|
+
## Project structure
|
|
213
231
|
|
|
214
232
|
| Directory | Purpose |
|
|
215
233
|
|:----------|:--------|
|
|
@@ -218,10 +236,11 @@ 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
241
|
---
|
|
223
242
|
|
|
224
|
-
## Development
|
|
243
|
+
## Development guide
|
|
225
244
|
|
|
226
245
|
See [`AGENTS.md`](./AGENTS.md) or [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
|
|
227
246
|
|
|
@@ -233,7 +252,7 @@ See [`AGENTS.md`](./AGENTS.md) or [`CLAUDE.md`](./CLAUDE.md) for development gui
|
|
|
233
252
|
|
|
234
253
|
## Contributing
|
|
235
254
|
|
|
236
|
-
Issues
|
|
255
|
+
Issues are welcome. Run checks before submitting:
|
|
237
256
|
|
|
238
257
|
```sh
|
|
239
258
|
bun run devcheck
|
|
@@ -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`
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/calculator-mcp-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
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.0",
|
|
91
92
|
"mathjs": "^15.2.0",
|
|
92
93
|
"pino-pretty": "^13.1.3",
|
|
93
|
-
"zod": "^4.
|
|
94
|
+
"zod": "^4.6.1"
|
|
94
95
|
},
|
|
95
96
|
"devDependencies": {
|
|
96
|
-
"@biomejs/biome": "^2.5.
|
|
97
|
+
"@biomejs/biome": "^2.5.13",
|
|
97
98
|
"@socketsecurity/bun-security-scanner": "^1.1.2",
|
|
98
|
-
"@types/node": "^26.
|
|
99
|
+
"@types/node": "^26.5.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.4",
|
|
102
103
|
"typescript": "^7.0.2",
|
|
103
|
-
"vitest": "^
|
|
104
|
+
"vitest": "^5.0.0"
|
|
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.2",
|
|
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.2",
|
|
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.2",
|
|
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"
|