@cyanheads/calculator-mcp-server 0.3.1 → 0.3.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 +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +1 -1
- package/dist/mcp-server/tools/definitions/calculate.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/calculate.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/calculate.tool.js +36 -11
- package/dist/mcp-server/tools/definitions/calculate.tool.js.map +1 -1
- package/dist/services/math/math-service.d.ts +11 -6
- package/dist/services/math/math-service.d.ts.map +1 -1
- package/dist/services/math/math-service.js +121 -34
- package/dist/services/math/math-service.js.map +1 -1
- package/dist/services/math/types.d.ts +9 -1
- package/dist/services/math/types.d.ts.map +1 -1
- package/package.json +1 -1
- 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.3.
|
|
4
|
+
**Version:** 0.3.2
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.21`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` 1.29.0
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** calculator-mcp-server
|
|
4
|
-
**Version:** 0.3.
|
|
4
|
+
**Version:** 0.3.2
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.9.21`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` 1.29.0
|
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
|
|
|
@@ -15,6 +15,11 @@ export declare const calculateTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
15
15
|
variable: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
|
|
16
16
|
scope: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
17
17
|
precision: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodNumber]>>;
|
|
18
|
+
numericType: z.ZodDefault<z.ZodEnum<{
|
|
19
|
+
number: "number";
|
|
20
|
+
BigNumber: "BigNumber";
|
|
21
|
+
Fraction: "Fraction";
|
|
22
|
+
}>>;
|
|
18
23
|
}, z.core.$strip>, z.ZodObject<{
|
|
19
24
|
result: z.ZodString;
|
|
20
25
|
resultType: z.ZodString;
|
|
@@ -26,6 +31,7 @@ export declare const calculateTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
26
31
|
}>;
|
|
27
32
|
scopeVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
33
|
precisionUsed: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
unchanged: z.ZodOptional<z.ZodBoolean>;
|
|
29
35
|
}, z.core.$strip>, readonly [{
|
|
30
36
|
readonly reason: "empty_expression";
|
|
31
37
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0OxB,CAAC"}
|
|
@@ -21,7 +21,7 @@ export const calculateTool = tool('calculate', {
|
|
|
21
21
|
operation: z
|
|
22
22
|
.enum(['evaluate', 'simplify', 'derivative'])
|
|
23
23
|
.default('evaluate')
|
|
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).'),
|
|
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. When the simplifier cannot reduce the expression further (e.g. rational expressions requiring polynomial factoring), the result is returned unchanged and unchanged: true is set in the output. "derivative" computes the symbolic derivative (requires the variable parameter).'),
|
|
25
25
|
variable: z
|
|
26
26
|
.union([
|
|
27
27
|
z.literal('').describe('Empty string — treated as omitted.'),
|
|
@@ -44,6 +44,10 @@ export const calculateTool = tool('calculate', {
|
|
|
44
44
|
])
|
|
45
45
|
.optional()
|
|
46
46
|
.describe('Significant digits (1–16) for numeric results. Omit for full precision. Empty string is treated as omitted. Ignored for symbolic operations (simplify, derivative).'),
|
|
47
|
+
numericType: z
|
|
48
|
+
.enum(['number', 'BigNumber', 'Fraction'])
|
|
49
|
+
.default('number')
|
|
50
|
+
.describe('Numeric type for evaluate. "number" (default): 64-bit IEEE 754 float — fastest, standard precision. "BigNumber": arbitrary-precision decimal — use when intermediate values overflow 64-bit float (e.g. large factorial ratios like 10000!/9999!); slower than "number". "Fraction": exact rational arithmetic — eliminates floating-point rounding (e.g. 0.1 + 0.2 = 0.3 exactly); limited to expressions without transcendental functions. Ignored for symbolic operations (simplify, derivative). When "number" evaluation produces a non-finite result (undefined_result error), retry with "BigNumber".'),
|
|
47
51
|
}),
|
|
48
52
|
output: z.object({
|
|
49
53
|
result: z.string().describe('The computed result as a string.'),
|
|
@@ -62,6 +66,10 @@ export const calculateTool = tool('calculate', {
|
|
|
62
66
|
.number()
|
|
63
67
|
.optional()
|
|
64
68
|
.describe('Significant-digit precision applied to the result. Omitted when full precision was used or the operation is symbolic.'),
|
|
69
|
+
unchanged: z
|
|
70
|
+
.boolean()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Present only for simplify operations. true means the simplifier returned the expression unchanged — it could not reduce it further (e.g. rational expressions requiring polynomial factoring are beyond math.js's built-in simplifier). false means simplification made progress. Omitted for evaluate and derivative."),
|
|
65
73
|
}),
|
|
66
74
|
errors: [
|
|
67
75
|
{
|
|
@@ -131,11 +139,12 @@ export const calculateTool = tool('calculate', {
|
|
|
131
139
|
const { expression, operation, scope } = input;
|
|
132
140
|
const variable = input.variable || undefined;
|
|
133
141
|
const precision = typeof input.precision === 'number' ? input.precision : undefined;
|
|
142
|
+
const numericType = input.numericType;
|
|
134
143
|
switch (operation) {
|
|
135
144
|
case 'evaluate':
|
|
136
|
-
ctx.log.info('Evaluated expression', { expression });
|
|
145
|
+
ctx.log.info('Evaluated expression', { expression, numericType });
|
|
137
146
|
return {
|
|
138
|
-
...math.evaluateExpression(expression, ctx, scope, precision),
|
|
147
|
+
...math.evaluateExpression(expression, ctx, scope, precision, numericType),
|
|
139
148
|
expression,
|
|
140
149
|
operation,
|
|
141
150
|
// Omit context fields that carry no signal: scopeVars only when a scope
|
|
@@ -143,14 +152,19 @@ export const calculateTool = tool('calculate', {
|
|
|
143
152
|
...(scope ? { scopeVars: Object.keys(scope) } : {}),
|
|
144
153
|
...(precision !== undefined ? { precisionUsed: precision } : {}),
|
|
145
154
|
};
|
|
146
|
-
case 'simplify':
|
|
147
|
-
|
|
155
|
+
case 'simplify': {
|
|
156
|
+
const simplifyResult = math.simplifyExpression(expression, ctx);
|
|
157
|
+
ctx.log.info('Simplified expression', { expression, unchanged: simplifyResult.unchanged });
|
|
148
158
|
// Symbolic operations never carry scope/precision context — omit both.
|
|
159
|
+
// Always include unchanged so callers can detect no-op simplifications (#1).
|
|
149
160
|
return {
|
|
150
|
-
|
|
161
|
+
result: simplifyResult.result,
|
|
162
|
+
resultType: simplifyResult.resultType,
|
|
151
163
|
expression,
|
|
152
164
|
operation,
|
|
165
|
+
unchanged: simplifyResult.unchanged,
|
|
153
166
|
};
|
|
167
|
+
}
|
|
154
168
|
case 'derivative':
|
|
155
169
|
if (!variable) {
|
|
156
170
|
throw ctx.fail('derivative_missing_variable', "The 'variable' parameter is required when operation is 'derivative'.", { ...ctx.recoveryFor('derivative_missing_variable') });
|
|
@@ -169,12 +183,23 @@ export const calculateTool = tool('calculate', {
|
|
|
169
183
|
format: (output) => {
|
|
170
184
|
const scopeVars = output.scopeVars && output.scopeVars.length > 0 ? output.scopeVars.join(', ') : 'none';
|
|
171
185
|
const precision = output.precisionUsed ?? 'full';
|
|
172
|
-
|
|
173
|
-
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
186
|
+
const lines = [
|
|
187
|
+
`**Expression:** \`${output.expression}\``,
|
|
188
|
+
`**Operation:** ${output.operation}`,
|
|
189
|
+
`**Result:** ${output.result}`,
|
|
190
|
+
`**Type:** ${output.resultType}`,
|
|
177
191
|
];
|
|
192
|
+
if (output.unchanged !== undefined) {
|
|
193
|
+
// Present only for simplify — unchanged: true means the simplifier made no progress.
|
|
194
|
+
lines.push(output.unchanged
|
|
195
|
+
? '**Simplified:** unchanged — expression could not be reduced further'
|
|
196
|
+
: '**Simplified:** reduced (unchanged: false)');
|
|
197
|
+
}
|
|
198
|
+
if (output.operation !== 'simplify') {
|
|
199
|
+
lines.push(`**Scope variables:** ${scopeVars}`);
|
|
200
|
+
lines.push(`**Precision:** ${precision}`);
|
|
201
|
+
}
|
|
202
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
178
203
|
},
|
|
179
204
|
});
|
|
180
205
|
//# sourceMappingURL=calculate.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculate.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/calculate.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE;IAC7C,WAAW,EACT,0NAA0N;IAC5N,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,+dAA+d,CAChe;QACH,SAAS,EAAE,CAAC;aACT,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;aAC5C,OAAO,CAAC,UAAU,CAAC;aACnB,QAAQ,CACP,+
|
|
1
|
+
{"version":3,"file":"calculate.tool.js","sourceRoot":"","sources":["../../../../src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AC,SAAS,KAAK,SAAS,EAAE,CAAC;YACnC,qFAAqF;YACrF,KAAK,CAAC,IAAI,CACR,MAAM,CAAC,SAAS;gBACd,CAAC,CAAC,qEAAqE;gBACvE,CAAC,CAAC,4CAA4C,CACjD,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;YAChD,KAAK,CAAC,IAAI,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -6,19 +6,24 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
8
8
|
import type { ServerConfig } from '../../config/server-config.js';
|
|
9
|
-
import type { MathResult } from './types.js';
|
|
9
|
+
import type { MathResult, NumericType } from './types.js';
|
|
10
10
|
export declare class MathService {
|
|
11
|
-
|
|
11
|
+
/** Default IEEE 754 instance — used for the vast majority of evaluations. */
|
|
12
|
+
private readonly defaultInstance;
|
|
13
|
+
/** BigNumber instance — arbitrary precision; selected via numericType: "BigNumber". */
|
|
14
|
+
private readonly bigNumberInstance;
|
|
15
|
+
/** Fraction instance — exact rational arithmetic; selected via numericType: "Fraction". */
|
|
16
|
+
private readonly fractionInstance;
|
|
12
17
|
private readonly parse;
|
|
13
18
|
private readonly simplify;
|
|
14
19
|
private readonly derivative;
|
|
15
20
|
private readonly simplifyRules;
|
|
16
|
-
private readonly format;
|
|
17
|
-
private readonly typeOf;
|
|
18
21
|
private readonly config;
|
|
19
22
|
constructor(config: ServerConfig);
|
|
20
|
-
/**
|
|
21
|
-
|
|
23
|
+
/** Select the pre-initialized evaluate/format/typeOf bundle for a given numeric type. */
|
|
24
|
+
private instanceFor;
|
|
25
|
+
/** Evaluate a math expression with optional variable scope, precision, and numeric type. */
|
|
26
|
+
evaluateExpression(expression: string, ctx: Context, scope?: Record<string, number>, precision?: number, numericType?: NumericType): MathResult;
|
|
22
27
|
/** Simplify an algebraic expression symbolically. */
|
|
23
28
|
simplifyExpression(expression: string, ctx: Context): MathResult;
|
|
24
29
|
/** Compute the symbolic derivative of an expression with respect to a variable. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-service.d.ts","sourceRoot":"","sources":["../../../src/services/math/math-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"math-service.d.ts","sourceRoot":"","sources":["../../../src/services/math/math-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AA0Q1D,qBAAa,WAAW;IACtB,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAe;IAC/C,uFAAuF;IACvF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAe;IACjD,2FAA2F;IAC3F,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAe;IAEhD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;IAC5F,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6D;IACxF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAE1B,MAAM,EAAE,YAAY;IAoBhC,yFAAyF;IACzF,OAAO,CAAC,WAAW;IAWnB,4FAA4F;IAC5F,kBAAkB,CAChB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,OAAO,EACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,GAAE,WAAsB,GAClC,UAAU;IAwBb,qDAAqD;IACrD,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,UAAU;IA2BhE,mFAAmF;IACnF,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,UAAU;IASvF,qFAAqF;IACrF,cAAc,IAAI,MAAM;IAIxB,OAAO,CAAC,aAAa;IAqBrB,uEAAuE;IACvE,OAAO,CAAC,aAAa;IAWrB,iGAAiG;IACjG,OAAO,CAAC,kBAAkB;IAS1B,2HAA2H;IAC3H,OAAO,CAAC,cAAc;IAStB,8DAA8D;IAC9D,OAAO,CAAC,kBAAkB;IAS1B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,iCAAiC;IAyBzC,+EAA+E;IAC/E,OAAO,CAAC,cAAc;CAoBvB;AAMD,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE1D;AAED,iDAAiD;AACjD,wBAAgB,cAAc,IAAI,WAAW,CAG5C"}
|
|
@@ -187,58 +187,119 @@ const NOTATION_ALIAS_PATTERN = /\b(ln|arc(?:sin|cos|tan|sec|csc|cot)h?)(?=\s*\()
|
|
|
187
187
|
function normalizeNotation(expression) {
|
|
188
188
|
return expression.replace(NOTATION_ALIAS_PATTERN, (name) => name === 'ln' ? 'log' : `a${name.slice(3)}`);
|
|
189
189
|
}
|
|
190
|
+
/** Create and harden a math.js instance with the given numeric type. */
|
|
191
|
+
function createMathInstance(number) {
|
|
192
|
+
// biome-ignore lint/style/noNonNullAssertion: math.js types declare `all` as potentially undefined, but it's always defined at runtime
|
|
193
|
+
const math = create(all, { number });
|
|
194
|
+
// Capture references BEFORE the override step — the import shim replaces these
|
|
195
|
+
// on the instance, so binding after would capture the disabled stubs.
|
|
196
|
+
const evaluate = math.evaluate.bind(math);
|
|
197
|
+
const format = math.format.bind(math);
|
|
198
|
+
const typeOf = math.typeOf.bind(math);
|
|
199
|
+
// Capture math.import before it's disabled — needed to install the config guard below.
|
|
200
|
+
const mathImport = math.import.bind(math);
|
|
201
|
+
// For BigNumber/Fraction instances, also capture config before the override.
|
|
202
|
+
// math.js BigNumber arithmetic reads config() internally to get the Decimal.js precision.
|
|
203
|
+
// Replacing config with a throwing stub breaks that and causes:
|
|
204
|
+
// [DecimalError] Invalid argument: precision: NaN
|
|
205
|
+
// Instead, we install a read-only guard after the disable step: reads pass through,
|
|
206
|
+
// writes throw — blocking expression-scope config mutations while preserving internal access.
|
|
207
|
+
const realConfig = number !== 'number' ? math.config.bind(math) : null;
|
|
208
|
+
// Register custom units and natural-language function aliases.
|
|
209
|
+
// Must run before createUnit/import are disabled below.
|
|
210
|
+
math.createUnit(CUSTOM_UNITS);
|
|
211
|
+
mathImport({ average: math.mean, avg: math.mean });
|
|
212
|
+
// Disable dangerous functions in expression scope.
|
|
213
|
+
// `config` is excluded here for BigNumber/Fraction instances — installed as a
|
|
214
|
+
// read-only guard via mathImport after this block (import is also disabled here).
|
|
215
|
+
const disabled = {};
|
|
216
|
+
for (const fn of DISABLED_FUNCTIONS) {
|
|
217
|
+
if (fn === 'config' && number !== 'number')
|
|
218
|
+
continue; // read-only guard installed below
|
|
219
|
+
disabled[fn] = () => {
|
|
220
|
+
throw new Error(`Function "${fn}" is disabled for security.`);
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
// Redact constants that leak implementation details
|
|
224
|
+
for (const [key, value] of Object.entries(REDACTED_CONSTANTS)) {
|
|
225
|
+
disabled[key] = value;
|
|
226
|
+
}
|
|
227
|
+
mathImport(disabled, { override: true });
|
|
228
|
+
// For BigNumber/Fraction: install a read-only config guard using the pre-captured
|
|
229
|
+
// mathImport reference (math.import is now disabled in the expression scope).
|
|
230
|
+
//
|
|
231
|
+
// Two access patterns must be preserved for math.js internals:
|
|
232
|
+
// 1. config() — gamma/factorial call this to read the full config object
|
|
233
|
+
// 2. config.precision — gamma accesses precision directly as a property on the function
|
|
234
|
+
//
|
|
235
|
+
// Replacing config with a plain stub breaks both; the guard function below satisfies
|
|
236
|
+
// both patterns while blocking write access (calls with a non-empty options object).
|
|
237
|
+
if (realConfig !== null) {
|
|
238
|
+
const currentConfig = realConfig({});
|
|
239
|
+
const configGuard = Object.assign((options) => {
|
|
240
|
+
if (options !== undefined && Object.keys(options).length > 0) {
|
|
241
|
+
throw new Error('"config" is disabled for security.');
|
|
242
|
+
}
|
|
243
|
+
return currentConfig;
|
|
244
|
+
}, currentConfig);
|
|
245
|
+
mathImport({ config: configGuard }, { override: true });
|
|
246
|
+
}
|
|
247
|
+
return { evaluate, format, typeOf };
|
|
248
|
+
}
|
|
190
249
|
export class MathService {
|
|
191
|
-
|
|
250
|
+
/** Default IEEE 754 instance — used for the vast majority of evaluations. */
|
|
251
|
+
defaultInstance;
|
|
252
|
+
/** BigNumber instance — arbitrary precision; selected via numericType: "BigNumber". */
|
|
253
|
+
bigNumberInstance;
|
|
254
|
+
/** Fraction instance — exact rational arithmetic; selected via numericType: "Fraction". */
|
|
255
|
+
fractionInstance;
|
|
192
256
|
parse;
|
|
193
257
|
simplify;
|
|
194
258
|
derivative;
|
|
195
259
|
simplifyRules;
|
|
196
|
-
format;
|
|
197
|
-
typeOf;
|
|
198
260
|
config;
|
|
199
261
|
constructor(config) {
|
|
200
262
|
this.config = config;
|
|
201
263
|
// biome-ignore lint/style/noNonNullAssertion: math.js types declare `all` as potentially undefined, but it's always defined at runtime
|
|
202
|
-
const
|
|
203
|
-
// Save references
|
|
204
|
-
|
|
205
|
-
this.parse =
|
|
206
|
-
this.simplify =
|
|
207
|
-
this.derivative =
|
|
208
|
-
this.simplifyRules = [...
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
disabled[key] = value;
|
|
264
|
+
const baseMath = create(all);
|
|
265
|
+
// Save references for symbolic operations — these don't need numeric-type variants.
|
|
266
|
+
// parse / simplify / derivative operate on the AST, not numeric values.
|
|
267
|
+
this.parse = baseMath.parse.bind(baseMath);
|
|
268
|
+
this.simplify = baseMath.simplify.bind(baseMath);
|
|
269
|
+
this.derivative = baseMath.derivative.bind(baseMath);
|
|
270
|
+
this.simplifyRules = [...baseMath.simplify.rules, ...TRIG_SIMPLIFY_RULES];
|
|
271
|
+
// Pre-initialize one hardened instance per numeric type so numeric-type selection
|
|
272
|
+
// at evaluation time is a simple Map lookup, not a per-request reconfiguration.
|
|
273
|
+
this.defaultInstance = createMathInstance('number');
|
|
274
|
+
this.bigNumberInstance = createMathInstance('BigNumber');
|
|
275
|
+
this.fractionInstance = createMathInstance('Fraction');
|
|
276
|
+
}
|
|
277
|
+
/** Select the pre-initialized evaluate/format/typeOf bundle for a given numeric type. */
|
|
278
|
+
instanceFor(numericType) {
|
|
279
|
+
switch (numericType) {
|
|
280
|
+
case 'BigNumber':
|
|
281
|
+
return this.bigNumberInstance;
|
|
282
|
+
case 'Fraction':
|
|
283
|
+
return this.fractionInstance;
|
|
284
|
+
default:
|
|
285
|
+
return this.defaultInstance;
|
|
225
286
|
}
|
|
226
|
-
math.import(disabled, { override: true });
|
|
227
287
|
}
|
|
228
|
-
/** Evaluate a math expression with optional variable scope and
|
|
229
|
-
evaluateExpression(expression, ctx, scope, precision) {
|
|
288
|
+
/** Evaluate a math expression with optional variable scope, precision, and numeric type. */
|
|
289
|
+
evaluateExpression(expression, ctx, scope, precision, numericType = 'number') {
|
|
230
290
|
this.validateInput(expression, ctx);
|
|
231
291
|
if (scope)
|
|
232
292
|
this.validateScope(scope, ctx);
|
|
233
293
|
const normalized = normalizeNotation(expression);
|
|
234
294
|
this.validateNoFunctionStringification(normalized, ctx);
|
|
235
|
-
const
|
|
236
|
-
const
|
|
295
|
+
const inst = this.instanceFor(numericType);
|
|
296
|
+
const raw = this.runWithTimeout(() => (scope ? inst.evaluate(normalized, scope) : inst.evaluate(normalized)), ctx);
|
|
297
|
+
const resultType = inst.typeOf(raw);
|
|
237
298
|
this.validateResultType(resultType, ctx);
|
|
238
299
|
this.validateFinite(raw, ctx);
|
|
239
300
|
// Match JS Number.toString thresholds — math.js defaults to exp ≥ 5,
|
|
240
301
|
// which would render 83810205 as "8.3810205e+7".
|
|
241
|
-
const result =
|
|
302
|
+
const result = inst.format(raw, {
|
|
242
303
|
lowerExp: -6,
|
|
243
304
|
upperExp: 21,
|
|
244
305
|
...(precision != null && { precision }),
|
|
@@ -250,10 +311,26 @@ export class MathService {
|
|
|
250
311
|
simplifyExpression(expression, ctx) {
|
|
251
312
|
this.validateInput(expression, ctx);
|
|
252
313
|
const normalized = normalizeNotation(expression);
|
|
314
|
+
// Capture the AST-normalized form of the input before simplification so we
|
|
315
|
+
// can detect whether the simplifier made any progress. String comparison is
|
|
316
|
+
// not sufficient — formatting-only changes like `x+1` vs `x + 1` should not
|
|
317
|
+
// count as progress. We parse both sides and compare their `.toString()` output,
|
|
318
|
+
// which normalises whitespace and operator representation consistently.
|
|
319
|
+
let inputNormalized;
|
|
320
|
+
try {
|
|
321
|
+
inputNormalized = this.parse(normalized).toString();
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
// If the expression cannot be parsed, let the simplify step surface the error
|
|
325
|
+
// with full math.js context. Set to the raw input so the unchanged flag is
|
|
326
|
+
// false (we don't know, but a parse error is not a no-op simplification).
|
|
327
|
+
inputNormalized = '';
|
|
328
|
+
}
|
|
253
329
|
const simplified = this.runWithTimeout(() => this.simplify(normalized, this.simplifyRules), ctx);
|
|
254
330
|
const result = simplified.toString();
|
|
255
331
|
this.validateResultSize(result, ctx);
|
|
256
|
-
|
|
332
|
+
const unchanged = inputNormalized !== '' && inputNormalized === result;
|
|
333
|
+
return { result, resultType: 'string', unchanged };
|
|
257
334
|
}
|
|
258
335
|
/** Compute the symbolic derivative of an expression with respect to a variable. */
|
|
259
336
|
differentiateExpression(expression, variable, ctx) {
|
|
@@ -469,8 +546,18 @@ Expression: \`x^2 + y\` => 28
|
|
|
469
546
|
Use the precision parameter (1\u201316 significant digits) for numeric results.
|
|
470
547
|
|
|
471
548
|
### Operations
|
|
472
|
-
|
|
549
|
+
|
|
550
|
+
- **evaluate** (default): Compute a numeric result. Use the \`numericType\` parameter to control precision:
|
|
551
|
+
- \`"number"\` (default): 64-bit IEEE 754 float — fastest. Standard for most calculations.
|
|
552
|
+
- \`"BigNumber"\`: Arbitrary-precision decimal — use when intermediate values overflow (e.g. \`10000! / 9999!\` overflows as a 64-bit float but evaluates correctly as a BigNumber). Slower than \`"number"\`.
|
|
553
|
+
- \`"Fraction"\`: Exact rational arithmetic — eliminates floating-point rounding (e.g. \`0.1 + 0.2 = 0.3\` exactly). Limited to expressions without transcendental functions (sin, log, etc.).
|
|
554
|
+
|
|
555
|
+
When \`"number"\` evaluation returns an \`undefined_result\` error (division by zero, overflow), retry with \`numericType: "BigNumber"\`.
|
|
556
|
+
|
|
473
557
|
- **simplify**: Reduce algebraic expressions symbolically (e.g., "2x + 3x" => "5 * x", "sin(x)^2 + cos(x)^2" => 1). Supports algebraic rules and common trigonometric identities (Pythagorean, double-angle, tan/sec/csc/cot relationships).
|
|
558
|
+
|
|
559
|
+
**Known limits:** The built-in simplifier does not perform polynomial factoring or rational cancellation. Expressions like \`(x^2 - 1) / (x - 1)\` are returned unchanged (\`unchanged: true\` in the output). For these cases, consider rewriting by hand or using \`evaluate\` with a numeric scope.
|
|
560
|
+
|
|
474
561
|
- **derivative**: Compute symbolic derivative (requires variable parameter, e.g., variable: "x")
|
|
475
562
|
`;
|
|
476
563
|
//# sourceMappingURL=math-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-service.js","sourceRoot":"","sources":["../../../src/services/math/math-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAyD,MAAM,QAAQ,CAAC;AAI5F;;;;GAIG;AACH,MAAM,mBAAmB,GAAmB;IAC1C,yBAAyB;IACzB,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,sCAAsC;IACtC,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,mCAAmC;IACnC,mCAAmC;CACpC,CAAC;AAEF;;;;GAIG;AACH,MAAM,YAAY,GAA4C;IAC5D,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE;IACpE,SAAS,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE;CAC/E,CAAC;AAEF;;;;GAIG;AACH,MAAM,kBAAkB,GAAG;IACzB,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,OAAO;IACP,UAAU;IACV,YAAY;IACZ,SAAS;IACT,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX;;;;GAIG;AAEH;;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AAK,8BAA8B,EAAE,CAAC;gBACzF,MAAM,OAAO,CACX,yCAAyC,IAAI,CAAC,MAAM,CAAC,mBAAmB,GAAG,IAAI,gEAAgE,EAC/I,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,CAC3E,CAAC;YACJ,CAAC;YACD,4DAA4D;YAC5D,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,MAAM,eAAe,CAAC,uBAAuB,OAAO,EAAE,EAAE;gBACtD,MAAM,EAAE,cAAc;gBACtB,GAAG,GAAG,CAAC,WAAW,CAAC,cAAc,CAAC;aACnC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAED,gCAAgC;AAEhC,IAAI,QAAiC,CAAC;AAEtC,qEAAqE;AACrE,MAAM,UAAU,eAAe,CAAC,MAAoB;IAClD,QAAQ,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IAClG,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,uBAAuB;AAEvB,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4GpB,CAAC"}
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
* @fileoverview Types for the math service.
|
|
3
3
|
* @module services/math/types
|
|
4
4
|
*/
|
|
5
|
+
/** Numeric type for evaluate operations. */
|
|
6
|
+
export type NumericType = 'number' | 'BigNumber' | 'Fraction';
|
|
5
7
|
/** Result of a math operation. */
|
|
6
8
|
export interface MathResult {
|
|
7
9
|
/** Formatted string representation of the result. */
|
|
8
10
|
result: string;
|
|
9
|
-
/** math.js type name: number, BigNumber, Complex, Matrix, Unit, string, boolean. */
|
|
11
|
+
/** math.js type name: number, BigNumber, Fraction, Complex, Matrix, Unit, string, boolean. */
|
|
10
12
|
resultType: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the simplify operation returned the expression unchanged.
|
|
15
|
+
* Present only for `simplify` operations. `true` means the simplifier
|
|
16
|
+
* could not reduce the expression further; `false` means it made progress.
|
|
17
|
+
*/
|
|
18
|
+
unchanged?: boolean;
|
|
11
19
|
}
|
|
12
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/math/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kCAAkC;AAClC,MAAM,WAAW,UAAU;IACzB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/math/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAE9D,kCAAkC;AAClC,MAAM,WAAW,UAAU;IACzB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/calculator-mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.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",
|
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.3.
|
|
9
|
+
"version": "0.3.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.3.
|
|
22
|
+
"version": "0.3.2",
|
|
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.3.
|
|
72
|
+
"version": "0.3.2",
|
|
73
73
|
"packageArguments": [
|
|
74
74
|
{
|
|
75
75
|
"type": "positional",
|