calculator-mcp-server — Claude Code MCP server: setup and tools
calculator-mcp-server evaluates expressions, simplifies algebra and takes symbolic derivatives through one calculate tool built on math.js. Useful when an agent has to verify a number rather than guess it.
Apache-2.0 4,412 installs ★ 3 updated 2026-10-08
claude mcp add --transport http calculator-mcp-server https://calculator-mcp-server--cyanheads.run.toolsWhat calculator-mcp-server does
One tool, calculate, sits on top of math.js. It handles arithmetic, trigonometry, logarithms, matrices, complex numbers, units and combinatorics. The operation field picks between evaluate (the default), simplify and derivative; a derivative call needs variable filled in or the request fails.
Results arrive in one of three numeric types: plain number, BigNumber with 64 significant digits, or Fraction for exact rationals. precision covers 1 to 16 significant digits. Operations are read-only and stateless, so no auth is involved. The server speaks stdio or Streamable HTTP.
Know the defaults before wiring it in. Expressions cap at 1000 characters, and CALC_MAX_EXPRESSION_LENGTH raises the ceiling to 10,000. Fraction mode answers fraction_unsupported when no exact rational exists, as with sqrt(2) or pi. A simplify call that gets nowhere returns unchanged: true, so the agent can tell the expression stayed as it was.
What it helps with
- verify a numeric result instead of trusting the model's arithmetic
- simplify
2x + 3xdown to5 * x - get a symbolic derivative with respect to
x - switch to exact fractions when floats drift
- evaluate a matrix or complex number inside an agent step
Example prompts for the agent
- Evaluate
sqrt(2) * 10^6to 12 significant digits. - Simplify
2x + 3xand tell me whether it stayed unchanged. - Take the derivative of
x^3 + 2xwith respect tox.
How to install calculator-mcp-server
Platform CLI: remote server
claude mcp add --transport http calculator-mcp-server https://calculator-mcp-server--cyanheads.run.toolsPlatform CLI: remote server
codex mcp add calculator-mcp-server --url https://calculator-mcp-server--cyanheads.run.toolsConfig file
{
"mcpServers": {
"calculator-mcp-server": {
"url": "https://calculator-mcp-server--cyanheads.run.tools"
}
}
}Config file
{
"servers": {
"calculator-mcp-server": {
"type": "http",
"url": "https://calculator-mcp-server--cyanheads.run.tools"
}
}
}Platform CLI: remote server
gemini mcp add -t http calculator-mcp-server https://calculator-mcp-server--cyanheads.run.toolsStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about calculator-mcp-server
How do I install calculator-mcp-server in Claude Code?
Run claude mcp add --transport http calculator-mcp-server https://calculator-mcp-server--cyanheads.run.tools. Nothing is installed locally; the client talks to that remote endpoint over HTTP.
What does calculator-mcp-server do?
It exposes a single calculate tool that evaluates an expression, simplifies it, or differentiates it symbolically through math.js. The calculator://help resource documents functions, operators and syntax.
What is the difference between BigNumber and Fraction modes?
BigNumber keeps 64 significant digits and suits values that overflow a 64-bit float. Fraction works with exact rationals and reports fraction_unsupported when a result has none.