calculate
Evaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives. One expression per call. Supports arithmetic, trigonometry, statistics, matrices, complex numbers, units, and combinatorics.
One tool: evaluate an expression, simplify it symbolically, or take its derivative.
LABSCO SUMMARY
Handing a model a general expression evaluator is the sort of thing that goes wrong quietly, so this one strips the dangerous functions out of math.js, runs what is left inside vm.runInNewContext() with a timeout, and bounds both directions: expression length, separators, numeric-only scope values with prototype-pollution keys blocked, result type and result size. That containment is why it needs no credentials — nothing is stateful and nothing can write. The practical reason to add it is narrower than "a calculator": symbolic simplification and derivatives are exactly the arithmetic a language model gets subtly wrong on its own.
A single-tool math server. calculate evaluates arithmetic, trigonometry, logarithms, statistics, matrices, complex numbers, unit conversions and combinatorics, simplifies algebraic and trigonometric expressions, and computes symbolic derivatives. It runs over stdio or Streamable HTTP, and a public instance at https://calculator.caseyjhand.com/mcp means you need not run anything at all.
No authentication and no state — every operation reads. Run it as bunx @cyanheads/calculator-mcp-server@latest, as npx -y @cyanheads/calculator-mcp-server@latest if you would rather not install Bun, from the Docker image, or point a client at https://calculator.caseyjhand.com/mcp over Streamable HTTP. Building from source wants Bun v1.3.0 or newer. The limits are tunable: CALC_MAX_EXPRESSION_LENGTH defaults to 1000 within a 10 to 10,000 range, CALC_EVALUATION_TIMEOUT_MS to 5000 within 100 to 30,000, and CALC_MAX_RESULT_LENGTH to 100000. In HTTP mode MCP_HTTP_PORT defaults to 3010, MCP_HTTP_ENDPOINT_PATH to /mcp, and MCP_AUTH_MODE to none with jwt and oauth available. Apache-2.0.
One command — npx -y @cyanheads/calculator-mcp-server@latest
USE CASES
Send the expression and take the computed answer, with the precision you asked for, instead of a number the model produced from pattern rather than calculation.
Simplify collects terms and applies trigonometric identities, returning the reduced form rather than a restatement of the input.
Symbolic derivatives come back as expressions you can carry on working with, and a scope of variable values evaluates them at a point.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
calculateEvaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives. One expression per call. Supports arithmetic, trigonometry, statistics, matrices, complex numbers, units, and combinatorics.
BEFORE YOU INSTALL
1 tool when we connected. Evaluate, simplify and derivative are values of calculate's operation parameter, not separate tools.
npx on PATH
CONTEXT COST
Rated by the size of the one tool definition that rides along on every turn
INSTALLATION
npx -y @cyanheads/calculator-mcp-server@latesthttps://calculator.caseyjhand.com/mcpAdd this hosted endpoint to your MCP client.
{
"mcpServers": {
"calculator-mcp-server": {
"type": "streamable-http",
"url": "https://calculator.caseyjhand.com/mcp"
}
}
}Clients spell the "type" value differently: Claude Code and VS Code use "http", Cline uses "streamableHttp", and Roo Code uses "streamable-http". Claude Desktop does not accept a URL entry in its config file; remote servers go under Settings → Connectors.
Download calculator-mcp-server.mcpb from https://github.com/cyanheads/calculator-mcp-server/releases/latest/download/calculator-mcp-server.mcpb
Open the downloaded file to install it in Claude Desktop.
{
"mcpServers": {
"calculator-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/calculator-mcp-server"
]
}
}
}{
"servers": {
"calculator-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/calculator-mcp-server"
]
}
}
}{
"mcpServers": {
"calculator-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": [
"@cyanheads/calculator-mcp-server@latest"
]
}
}
}{
"mcpServers": {
"calculator-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@cyanheads/calculator-mcp-server@latest"
]
}
}
}{
"mcpServers": {
"calculator-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/calculator-mcp-server:latest"
]
}
}
}