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
calc with a portable Rust‑based version
Comments