A Rust port of calc (Landon Curt Noll's arbitrary-precision calculator)
@carlomagnoglobal
About A Rust port of calc (Landon Curt Noll's arbitrary-precision calculator)
A Rust port of calc (Landon Curt Noll's arbitrary-precision calculator) that works as:
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"toRustCalcMCP": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/carlomagnoglobal/torustcalcmcp:latest"
]
}
}
}Tools
3evaluate an expression
get/set session precision & display
list builtins
Overview
What is toRustCalcMCP?
A Rust port of Landon Curt Noll’s arbitrary‑precision calculator (calc) that provides three interfaces: a command‑line calculator (rcalc), a web REPL, and an MCP server for LLM/agent integration. It uses exact rational arithmetic (num‑rational over num‑bigint) so computations like 1/3 * 3 yield exactly 1.
How to use toRustCalcMCP?
Build with cargo build --release. Use the CLI via rcalc 'expression', the web REPL with rcalc-web (served on localhost:8888), or the MCP server with toRustCalcMCP --mcp. For MCP, perform the initialize handshake then call tools like calc_eval, calc_config, or calc_functions. A detailed MCP tool schema is provided in the repository.
Key features of toRustCalcMCP
- 351 builtins (100%+ coverage of calc’s ~350 functions)
- Exact rational arithmetic – no floating‑point approximations
- Three interfaces: CLI, web REPL, and MCP server
- Arbitrary‑precision transcendentals via Taylor series and Newton’s method
- User‑defined functions, control flow (
if/else,while,for), and lists - Session‑configurable precision and display mode
Use cases of toRustCalcMCP
- Perform arbitrary‑precision arithmetic from the command line
- Explore and test calc functions interactively in a browser
- Integrate exact‑rational computation into LLM agents via MCP tools
- Replace the original C
calcwith a portable Rust‑based version
FAQ from toRustCalcMCP
What precision does toRustCalcMCP use?
Numbers are exact rationals. Irrational results are approximated to within a session epsilon (default 1e-20). Transcendentals like sin, cos, and exp are computed via Taylor series until the term is smaller than epsilon.
How many builtin functions are implemented?
351 builtins are implemented, covering 100% of calc’s ~350 functions. Core categories (arithmetic, number theory, trigonometry, transcendental, bitwise, lists, strings, etc.) are fully or partially implemented; about 100 exotic/specialized functions (e.g., rare trig variants, file I/O, cryptography) are not yet added.
What transport does the MCP server use?
The MCP server uses JSON‑RPC 2.0 over stdio. Clients must perform initialize, then tools/list, and then tools/call with the appropriate arguments.
Is toRustCalcMCP compatible with the original calc language?
Yes. It supports the same expression syntax, operators, variables, user‑
More Other MCP servers
Mcp
browsermcpBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Nginx UI
0xJackyYet another WebUI for Nginx
XcodeBuildMCP
cameroncookeA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Codelf
unbugA search tool helps dev to solve the naming things problem.
Comments