A Rust port of calc (Landon Curt Noll's arbitrary-precision calc…
@carlomagnoglobal
About A Rust port of calc (Landon Curt Noll's arbitrary-precision calc…
A Rust port of calc (Landon Curt Noll's arbitrary-precision calculator) that works as:
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‑
Frequently asked questions
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‑
Basic information
More Other MCP servers
Maestro
mobile-dev-incPainless E2E Automation for Mobile and Web
MCP Go 🚀
mark3labsA Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
Blender
ahujasidOpen-source MCP to use Blender with any LLM
FastMCP v2 🚀
jlowin🚀 The fast, Pythonic way to build MCP servers and clients.
🚀 Model Context Protocol (MCP) Curriculum for Beginners
microsoftThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable,
Comments