@cyanheads/calculator-mcp-server 0.1.9 → 0.1.11
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 +23 -15
- package/CLAUDE.md +22 -14
- package/README.md +2 -2
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +5 -4
- package/dist/config/server-config.js.map +1 -1
- package/dist/mcp-server/tools/definitions/calculate.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/calculate.tool.js +18 -22
- package/dist/mcp-server/tools/definitions/calculate.tool.js.map +1 -1
- package/package.json +5 -5
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** calculator-mcp-server
|
|
4
|
-
**Version:** 0.1.
|
|
4
|
+
**Version:** 0.1.11
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
6
6
|
|
|
7
7
|
> **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.
|
|
@@ -26,15 +26,17 @@ MathService wraps a **hardened math.js instance** — dangerous functions (`impo
|
|
|
26
26
|
|
|
27
27
|
When the user asks what to do next, what's left, or needs direction, suggest relevant options based on the current project state:
|
|
28
28
|
|
|
29
|
-
1. **Re-run the `setup` skill** — ensures
|
|
29
|
+
1. **Re-run the `setup` skill** — ensures CLAUDE.md, skills, structure, and metadata are populated and up to date with the current codebase
|
|
30
30
|
2. **Run the `design-mcp-server` skill** — if the tool/resource surface hasn't been mapped yet, work through domain design
|
|
31
31
|
3. **Add tools/resources/prompts** — scaffold new definitions using the `add-tool`, `add-resource`, `add-prompt` skills
|
|
32
32
|
4. **Add services** — scaffold domain service integrations using the `add-service` skill
|
|
33
33
|
5. **Add tests** — scaffold tests for existing definitions using the `add-test` skill
|
|
34
34
|
6. **Field-test definitions** — exercise tools/resources/prompts with real inputs using the `field-test` skill, get a report of issues and pain points
|
|
35
35
|
7. **Run `devcheck`** — lint, format, typecheck, and security audit
|
|
36
|
-
8. **Run the `
|
|
37
|
-
9. **Run the `
|
|
36
|
+
8. **Run the `security-pass` skill** — audit handlers for MCP-specific security gaps (injection, blast radius, input sinks, tenant isolation)
|
|
37
|
+
9. **Run the `polish-docs-meta` skill** — finalize README, CHANGELOG, metadata, and agent protocol for shipping
|
|
38
|
+
10. **Run the `release-and-publish` skill** — publish to npm + MCP Registry + GHCR after wrapup
|
|
39
|
+
11. **Run the `maintenance` skill** — sync skills and dependencies after framework updates
|
|
38
40
|
|
|
39
41
|
Tailor suggestions to what's actually missing or stale — don't recite the full list every time.
|
|
40
42
|
|
|
@@ -214,7 +216,7 @@ src/
|
|
|
214
216
|
|
|
215
217
|
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.
|
|
216
218
|
|
|
217
|
-
**Agent skill directory:** Copy skills into the directory your agent discovers (
|
|
219
|
+
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). This makes skills available as context without needing to reference `skills/` paths manually. After framework updates, run the `maintenance` skill — it re-syncs the agent directory automatically (Phase B).
|
|
218
220
|
|
|
219
221
|
Available skills:
|
|
220
222
|
|
|
@@ -229,7 +231,9 @@ Available skills:
|
|
|
229
231
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
230
232
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
231
233
|
| `devcheck` | Lint, format, typecheck, audit |
|
|
234
|
+
| `security-pass` | Audit handlers for MCP-specific security gaps before shipping |
|
|
232
235
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
236
|
+
| `release-and-publish` | Publish to npm, MCP Registry, and GHCR after git wrapup |
|
|
233
237
|
| `maintenance` | Sync skills and dependencies after updates |
|
|
234
238
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
235
239
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
@@ -237,6 +241,7 @@ Available skills:
|
|
|
237
241
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
238
242
|
| `api-context` | Context interface, logger, state, progress |
|
|
239
243
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
244
|
+
| `api-linter` | MCP definition linter rules reference (every rule ID + fix) |
|
|
240
245
|
| `api-services` | LLM, Speech, Graph services |
|
|
241
246
|
| `api-testing` | createMockContext, test patterns |
|
|
242
247
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling |
|
|
@@ -268,6 +273,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
268
273
|
|
|
269
274
|
## Publishing
|
|
270
275
|
|
|
276
|
+
After git wrapup (version bumps, changelog, commit, annotated tag) is complete, run the **`release-and-publish`** skill — it handles the full publish flow with retry-on-transient-failure across every registry.
|
|
277
|
+
|
|
271
278
|
### Wrapup flow
|
|
272
279
|
|
|
273
280
|
When running the git wrapup checklist (`polish-docs-meta` or equivalent):
|
|
@@ -280,20 +287,21 @@ git tag -a v<version> -m "v<version>"
|
|
|
280
287
|
git push && git push --tags
|
|
281
288
|
```
|
|
282
289
|
|
|
283
|
-
###
|
|
290
|
+
### Targets
|
|
284
291
|
|
|
285
|
-
|
|
292
|
+
This server publishes to:
|
|
286
293
|
|
|
287
|
-
|
|
288
|
-
|
|
294
|
+
1. **npm** — `bun publish --access public`
|
|
295
|
+
2. **GHCR** — multi-arch Docker image:
|
|
289
296
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
```bash
|
|
298
|
+
docker buildx build --platform linux/amd64,linux/arm64 \
|
|
299
|
+
-t ghcr.io/cyanheads/calculator-mcp-server:<version> \
|
|
300
|
+
-t ghcr.io/cyanheads/calculator-mcp-server:latest \
|
|
301
|
+
--push .
|
|
302
|
+
```
|
|
295
303
|
|
|
296
|
-
|
|
304
|
+
The `release-and-publish` skill drives both — don't run the commands manually unless the skill halts.
|
|
297
305
|
|
|
298
306
|
---
|
|
299
307
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** calculator-mcp-server
|
|
4
|
-
**Version:** 0.1.
|
|
4
|
+
**Version:** 0.1.11
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
6
6
|
|
|
7
7
|
> **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.
|
|
@@ -33,8 +33,10 @@ When the user asks what to do next, what's left, or needs direction, suggest rel
|
|
|
33
33
|
5. **Add tests** — scaffold tests for existing definitions using the `add-test` skill
|
|
34
34
|
6. **Field-test definitions** — exercise tools/resources/prompts with real inputs using the `field-test` skill, get a report of issues and pain points
|
|
35
35
|
7. **Run `devcheck`** — lint, format, typecheck, and security audit
|
|
36
|
-
8. **Run the `
|
|
37
|
-
9. **Run the `
|
|
36
|
+
8. **Run the `security-pass` skill** — audit handlers for MCP-specific security gaps (injection, blast radius, input sinks, tenant isolation)
|
|
37
|
+
9. **Run the `polish-docs-meta` skill** — finalize README, CHANGELOG, metadata, and agent protocol for shipping
|
|
38
|
+
10. **Run the `release-and-publish` skill** — publish to npm + MCP Registry + GHCR after wrapup
|
|
39
|
+
11. **Run the `maintenance` skill** — sync skills and dependencies after framework updates
|
|
38
40
|
|
|
39
41
|
Tailor suggestions to what's actually missing or stale — don't recite the full list every time.
|
|
40
42
|
|
|
@@ -214,7 +216,7 @@ src/
|
|
|
214
216
|
|
|
215
217
|
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.
|
|
216
218
|
|
|
217
|
-
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). This makes skills available as context without needing to reference `skills/` paths manually. After framework updates, re-
|
|
219
|
+
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). This makes skills available as context without needing to reference `skills/` paths manually. After framework updates, run the `maintenance` skill — it re-syncs the agent directory automatically (Phase B).
|
|
218
220
|
|
|
219
221
|
Available skills:
|
|
220
222
|
|
|
@@ -229,7 +231,9 @@ Available skills:
|
|
|
229
231
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
230
232
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
231
233
|
| `devcheck` | Lint, format, typecheck, audit |
|
|
234
|
+
| `security-pass` | Audit handlers for MCP-specific security gaps before shipping |
|
|
232
235
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
236
|
+
| `release-and-publish` | Publish to npm, MCP Registry, and GHCR after git wrapup |
|
|
233
237
|
| `maintenance` | Sync skills and dependencies after updates |
|
|
234
238
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
235
239
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
@@ -237,6 +241,7 @@ Available skills:
|
|
|
237
241
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
238
242
|
| `api-context` | Context interface, logger, state, progress |
|
|
239
243
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
244
|
+
| `api-linter` | MCP definition linter rules reference (every rule ID + fix) |
|
|
240
245
|
| `api-services` | LLM, Speech, Graph services |
|
|
241
246
|
| `api-testing` | createMockContext, test patterns |
|
|
242
247
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling |
|
|
@@ -268,6 +273,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
268
273
|
|
|
269
274
|
## Publishing
|
|
270
275
|
|
|
276
|
+
After git wrapup (version bumps, changelog, commit, annotated tag) is complete, run the **`release-and-publish`** skill — it handles the full publish flow with retry-on-transient-failure across every registry.
|
|
277
|
+
|
|
271
278
|
### Wrapup flow
|
|
272
279
|
|
|
273
280
|
When running the git wrapup checklist (`polish-docs-meta` or equivalent):
|
|
@@ -280,20 +287,21 @@ git tag -a v<version> -m "v<version>"
|
|
|
280
287
|
git push && git push --tags
|
|
281
288
|
```
|
|
282
289
|
|
|
283
|
-
###
|
|
290
|
+
### Targets
|
|
284
291
|
|
|
285
|
-
|
|
292
|
+
This server publishes to:
|
|
286
293
|
|
|
287
|
-
|
|
288
|
-
|
|
294
|
+
1. **npm** — `bun publish --access public`
|
|
295
|
+
2. **GHCR** — multi-arch Docker image:
|
|
289
296
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
```bash
|
|
298
|
+
docker buildx build --platform linux/amd64,linux/arm64 \
|
|
299
|
+
-t ghcr.io/cyanheads/calculator-mcp-server:<version> \
|
|
300
|
+
-t ghcr.io/cyanheads/calculator-mcp-server:latest \
|
|
301
|
+
--push .
|
|
302
|
+
```
|
|
295
303
|
|
|
296
|
-
|
|
304
|
+
The `release-and-publish` skill drives both — don't run the commands manually unless the skill halts.
|
|
297
305
|
|
|
298
306
|
---
|
|
299
307
|
|
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@cyanheads/calculator-mcp-server)
|
|
10
10
|
[](https://github.com/users/cyanheads/packages/container/package/calculator-mcp-server)
|
|
11
|
-
[](./CHANGELOG.md) [](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
12
12
|
|
|
13
|
-
[](https://modelcontextprotocol.io/) [](./LICENSE) [](https://www.typescriptlang.org/)
|
|
14
14
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
@@ -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"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module config/server-config
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
6
7
|
const ServerConfigSchema = z.object({
|
|
7
8
|
maxExpressionLength: z.coerce
|
|
8
9
|
.number()
|
|
@@ -29,10 +30,10 @@ const ServerConfigSchema = z.object({
|
|
|
29
30
|
let _config;
|
|
30
31
|
/** Lazy-parsed server config from env vars. */
|
|
31
32
|
export function getServerConfig() {
|
|
32
|
-
_config ??= ServerConfigSchema
|
|
33
|
-
maxExpressionLength:
|
|
34
|
-
evaluationTimeoutMs:
|
|
35
|
-
maxResultLength:
|
|
33
|
+
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
34
|
+
maxExpressionLength: 'CALC_MAX_EXPRESSION_LENGTH',
|
|
35
|
+
evaluationTimeoutMs: 'CALC_EVALUATION_TIMEOUT_MS',
|
|
36
|
+
maxResultLength: 'CALC_MAX_RESULT_LENGTH',
|
|
36
37
|
});
|
|
37
38
|
return _config;
|
|
38
39
|
}
|
|
@@ -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;
|
|
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"}
|
|
@@ -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;AAIjD,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;AAIjD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;kBA6FxB,CAAC"}
|
|
@@ -24,11 +24,12 @@ export const calculateTool = tool('calculate', {
|
|
|
24
24
|
.describe('Operation to perform. "evaluate" computes a numeric result (default). "simplify" reduces an algebraic expression symbolically (e.g., "2x + 3x" -> "5 * x"). Supports algebraic and trigonometric identities. "derivative" computes the symbolic derivative (requires the variable parameter).'),
|
|
25
25
|
variable: z
|
|
26
26
|
.union([
|
|
27
|
-
z.literal(''),
|
|
27
|
+
z.literal('').describe('Empty string — treated as omitted (for form-based clients).'),
|
|
28
28
|
z
|
|
29
29
|
.string()
|
|
30
30
|
.max(50)
|
|
31
|
-
.regex(/^[a-zA-Z_][a-zA-Z0-9_]*$/, 'Variable name must be alphanumeric (a-z, A-Z, 0-9, _).')
|
|
31
|
+
.regex(/^[a-zA-Z_][a-zA-Z0-9_]*$/, 'Variable name must be alphanumeric (a-z, A-Z, 0-9, _).')
|
|
32
|
+
.describe('Variable identifier (alphanumeric and underscores, max 50 chars).'),
|
|
32
33
|
])
|
|
33
34
|
.optional()
|
|
34
35
|
.describe('Variable to differentiate with respect to. Required when operation is "derivative". Blank values from form-based clients are treated as omitted. Example: "x".'),
|
|
@@ -37,7 +38,10 @@ export const calculateTool = tool('calculate', {
|
|
|
37
38
|
.optional()
|
|
38
39
|
.describe('Variable assignments for the expression. Example: { "x": 5, "y": 3 } makes "x + y" evaluate to 8.'),
|
|
39
40
|
precision: z
|
|
40
|
-
.union([
|
|
41
|
+
.union([
|
|
42
|
+
z.literal('').describe('Empty string — treated as omitted (for form-based clients).'),
|
|
43
|
+
z.number().int().min(1).max(16).describe('Significant digits (integer, 1–16).'),
|
|
44
|
+
])
|
|
41
45
|
.optional()
|
|
42
46
|
.describe('Significant digits (1–16) for numeric results. Omit for full precision. Blank values from form-based clients are treated as omitted. Ignored for symbolic operations (simplify, derivative).'),
|
|
43
47
|
}),
|
|
@@ -50,30 +54,22 @@ export const calculateTool = tool('calculate', {
|
|
|
50
54
|
}),
|
|
51
55
|
handler(input, ctx) {
|
|
52
56
|
const math = getMathService();
|
|
57
|
+
const { expression, operation, scope } = input;
|
|
53
58
|
const variable = input.variable || undefined;
|
|
54
59
|
const precision = typeof input.precision === 'number' ? input.precision : undefined;
|
|
55
|
-
switch (
|
|
56
|
-
case 'evaluate':
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ctx.log.info('Simplified expression', { expression: input.expression });
|
|
64
|
-
return { result, resultType, expression: input.expression };
|
|
65
|
-
}
|
|
66
|
-
case 'derivative': {
|
|
60
|
+
switch (operation) {
|
|
61
|
+
case 'evaluate':
|
|
62
|
+
ctx.log.info('Evaluated expression', { expression });
|
|
63
|
+
return { ...math.evaluateExpression(expression, scope, precision), expression };
|
|
64
|
+
case 'simplify':
|
|
65
|
+
ctx.log.info('Simplified expression', { expression });
|
|
66
|
+
return { ...math.simplifyExpression(expression), expression };
|
|
67
|
+
case 'derivative':
|
|
67
68
|
if (!variable) {
|
|
68
69
|
throw invalidParams("The 'variable' parameter is required when operation is 'derivative'.");
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
expression: input.expression,
|
|
73
|
-
variable,
|
|
74
|
-
});
|
|
75
|
-
return { result, resultType, expression: input.expression };
|
|
76
|
-
}
|
|
71
|
+
ctx.log.info('Differentiated expression', { expression, variable });
|
|
72
|
+
return { ...math.differentiateExpression(expression, variable), expression };
|
|
77
73
|
}
|
|
78
74
|
},
|
|
79
75
|
format: (output) => [
|
|
@@ -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,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE;IAC7C,WAAW,EACT,iMAAiM;IACnM,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,qQAAqQ,CACtQ;QACH,SAAS,EAAE,CAAC;aACT,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;aAC5C,OAAO,CAAC,UAAU,CAAC;aACnB,QAAQ,CACP,+RAA+R,CAChS;QACH,QAAQ,EAAE,CAAC;aACR,KAAK,CAAC;YACL,CAAC,CAAC,OAAO,CAAC,EAAE,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,aAAa,EAAE,MAAM,+BAA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MAAM,aAAa,CACjB,sEAAsE,CACvE,CAAC;gBACJ,CAAC;gBACD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACpE,OAAO,EAAE,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;QACjF,CAAC;IACH,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB,MAAM,CAAC,UAAU,mBAAmB,MAAM,CAAC,MAAM,eAAe,MAAM,CAAC,UAAU,EAAE;SAC/G;KACF;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/calculator-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Calculator MCP server — evaluate, simplify, and differentiate math expressions.",
|
|
5
5
|
"mcpName": "io.github.cyanheads/calculator-mcp-server",
|
|
6
6
|
"type": "module",
|
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@cyanheads/mcp-ts-core": "^0.
|
|
66
|
+
"@cyanheads/mcp-ts-core": "^0.7.0",
|
|
67
67
|
"mathjs": "^15.2.0",
|
|
68
68
|
"pino-pretty": "^13.1.3"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@biomejs/biome": "^2.4.
|
|
71
|
+
"@biomejs/biome": "^2.4.13",
|
|
72
72
|
"@types/node": "^25.6.0",
|
|
73
73
|
"depcheck": "^1.4.7",
|
|
74
74
|
"ignore": "^7.0.5",
|
|
75
75
|
"tsc-alias": "^1.8.16",
|
|
76
76
|
"tsx": "^4.21.0",
|
|
77
|
-
"typescript": "^6.0.
|
|
78
|
-
"vitest": "^4.1.
|
|
77
|
+
"typescript": "^6.0.3",
|
|
78
|
+
"vitest": "^4.1.5"
|
|
79
79
|
}
|
|
80
80
|
}
|
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.1.
|
|
9
|
+
"version": "0.1.11",
|
|
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.1.
|
|
22
|
+
"version": "0.1.11",
|
|
23
23
|
"packageArguments": [
|
|
24
24
|
{
|
|
25
25
|
"type": "positional",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
70
70
|
"identifier": "@cyanheads/calculator-mcp-server",
|
|
71
71
|
"runtimeHint": "bun",
|
|
72
|
-
"version": "0.1.
|
|
72
|
+
"version": "0.1.11",
|
|
73
73
|
"packageArguments": [
|
|
74
74
|
{
|
|
75
75
|
"type": "positional",
|