calc_evalLABSCO SUMMARY
Where a model's own arithmetic stops being trustworthy.
Large factorials, exact rationals and 256-bit powers are precisely the cases language models get subtly wrong, and this returns them exact rather than plausible. The ~ marker is a nice touch: you can tell at a glance whether a result was rendered exactly or rounded to the session epsilon.
What it is
A Rust port of calc, Landon Curt Noll's arbitrary-precision calculator, that speaks JSON-RPC 2.0 over stdio as an MCP server. The numeric core is exact rational arithmetic, which is the same model calc uses natively, so results are not floating-point approximations.
What you get
- calc_eval — evaluate an expression;
expressionis required, withmode(real,fracorint),digitsandepsilonas per-call overrides - calc_config — read or change the session's precision and display settings, including input and output base from 2 to 36
- calc_functions — list the builtins, optionally filtered by substring
- 483 builtin names, with variables, user-defined functions,
if/while/forcontrol flow, lists, complex numbers and string operations - A leading
~in real-mode output marks a rounded or non-terminating rendering, the same convention calc uses - The same binary also runs as the
rcalccommand-line calculator and as a browser REPL
Requirements
Rust 1.75 or later to build; cargo build --release produces toRustCalcMCP, which auto-detects MCP versus CLI mode, and rcalc, which is always the calculator. Start it with toRustCalcMCP --mcp to speak JSON-RPC over stdio. digits defaults to 20 in real mode and accepts up to 10000; the default epsilon is exactly 1/10^20. Licensed LGPL-2.1.
Setup effort
Build from source — git clone https://github.com/carlomagnoglobal/toRustCalcMCP.git
USE CASES
Getting a big-integer result you can rely on
Evaluate it exactly instead of trusting the model's own arithmetic.
Keeping fractions as fractions
Switch the rendering mode so 1/3 + 1/6 comes back as a rational rather than a decimal.
Working at a precision the default does not reach
Raise the digit count or tighten epsilon for the session, or just for one call.
Finding the function you need
Search the builtin list by substring instead of reading the manual.
4 tools
Listed in project docs. Your client may show a different list.
calc_configcalc_functionscalc_sessionBEFORE YOU INSTALL
What to know first
Tools you get
4 tools named in the project's documentation. The README's tools table lists three of the four tools; the fourth, calc_session, which resets or inspects session state, is in the project's tool schema and MCP guide. The calculator's 483 built-in functions are used inside calc_eval expressions, not as separate tools.
Requires
Rust 1.75 or later, with cargo, to build the binary
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
Step 1: Build the binary
git clone https://github.com/carlomagnoglobal/toRustCalcMCP.git
cd toRustCalcMCP
cargo build --releaseStep 2: Get the absolute path
Print the folder's absolute path, to use in the configuration below: pwd
MCP Clients
Claude Desktop
{
"mcpServers": {
"calc": {
"command": "/Users/<YOUR_USERNAME>/Documents/toRustCalcMCP/target/release/toRustCalcMCP",
"args": [
"--mcp"
]
}
}
}/Users/<YOUR_USERNAME>/Documents/toRustCalcMCP is the path pwd printed in Step 2, keeping /target/release/toRustCalcMCP on the end.