Calculator MCP server
Exact arithmetic: one calculator tool over an AST allowlist, with integers exact at any size.
0 stars40 downloads/wk
Reviews
Write oneNobody has reviewed Calculator yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Calculator tools (1)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
calculateEvaluate an arithmetic expression and return the result.
Public scan report
scanner v0.1.10 · 2026-10-02 · same rubric, same numbers if you re-run it
- Code scan7 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 1 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Calculator compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 92/100
- higher than 95% of 48,255 servers
- Tools
- 1
- the typical server has 7
- Tools that change things
- 0%
- typical: 0%. Fewer write tools means less an agent can break
- Downloads a week
- 40
- more than 31% of 12,191 servers with a package
What its tools let an agent do: 1 read
Release history: 2 versions in the registry since 2026-09-09, latest 2026-09-17, typically one every 8 days.
Install Calculator in Claude Code, Cursor or VS Code
claude mcp add calc-mcp-server -- uvx calc-mcp-server
What the publisher says
From the Calculator repository's README, as published. We do not edit it. Read it on GitHub
Calculator MCP Server
<!-- mcp-name: io.github.slettmayer/calc-mcp-server -->
An MCP server that does arithmetic, exactly — so an LLM does not have to do it mentally.
One tool, calculate, evaluating expressions against a hand-rolled AST allowlist. No eval(), no sympy, no unbounded dependencies.
2 + 3 * (4 - 1) / 2 ** 2 -> 4.25
sqrt(16) + sin(pi/2) -> 5.0
123456789 * 987654321 -> 121932631112635269Why this exists
The widely-used mcp-server-calculator package is abandoned (last commit May 2025) and declares mcp>=1.4.1 with no upper bound. When the MCP Python SDK released v2 and removed mcp.server.fastmcp, every uvx …@latest install of it started crashing on import — which took down the entire MCP proxy hosting it, and every other server alongside it.
No maintained Python replacement exists. The one actively-maintained npm calculator computes in float64, so 123456789 * 987654321 comes back as 121932631112635260 — off by 9. That is a poor trait in a tool whose whole purpose is that the model should not be doing the arithmetic itself.
So this server:
- bounds its one dependency (mcp[cli]>=2,<3) — the failure above cannot recur here;
- keeps integers exact at any size, never coercing to float;
- bounds resource use, not just code execution — see below.
Safety
Two problems, and most calculator servers only solve the first.
Code execution. Expressions are parsed with ast.parse and walked against an explicit allowlist of node types. Attribute is not on it, so (1).class.bases is rejected. A Call is only evaluated when its target is a bare name in the function allowlist, so import('os').system(…) is rejected before any argument is even evaluated.
Resource exhaustion. An allowlist alone still lets 999 occupy the process for minutes on unbounded bignum exponentiation — the incumbent hangs for over five seconds on it. Four caps close that: expression length (500 chars), nesting depth (32), result size (4300 digits, checked on the operands before exponentiating), and factorial argument (1000).
Full detail in docs/tech/SAFE-EVALUATION.md.
Install
uvx calc-mcp-serverPin it. Do not add @latest — that is how the package this replaces broke.
Configure
As a stdio MCP server:
{
"mcpServers": {
"calculator": {
"command": "uvx",
"args": ["calc-mcp-server"]
}
}
}The calculate tool
Returns the result as a string, or a line starting with Error: explaining why the expression was rejected. The tool never raises, so a bad expression is an answer the agent can read back rather than a tool-call failure.
Operators — + - / // % , parentheses, unary +/-. ^ is accepted as a power operator, and × · ÷ − are accepted as their ASCII equivalents (speech-to-text produces them).
Constants — pi, e, tau.
Functions — abs round min max sqrt exp log log2 log10 sin cos tan asin acos atan atan2 degrees radians hypot floor ceil factorial gcd lcm.
Results — integer arithmetic returns an exact integer of any size. Floats are rendered at 12 significant digits, which removes IEEE-754 representation noise (0.1 + 0.2 reads 0.3, not 0.30000000000000004) while keeping far more precision than a calculator result is used at. A whole float keeps its .0, so 8 / 2 reads 4.0 and stays distinct from the exact integer 4.
Development
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Calculator: common questions
- Is Calculator MCP server safe?
- Yes, by our scan: it is graded A (92/100). Read the Calculator safety report
- How do I install Calculator?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Calculator need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is Calculator maintained?
- The last commit was 33 days ago (2026-10-02). The latest release is v0.1.9.
- How does Calculator compare with other MCP servers?
- safety score 92/100 (higher than 95% of 48,255 servers); tools 1 (the typical server has 7); tools that change things 0% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.