Code & logic calculator for AI agents: run 31 languages, symbolic math, SMT logic, complexity.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
codecalc is an offline, self-hosted MCP server that gives an AI agent a calculator, a code runner, and a logic checker β so it gets a correct answer instead of a guessed one. It runs code in 31 languages, does exact symbolic math, solves SMT/logic problems, and measures complexity, all exposed as 52 MCP tools.
Fastest path: uvx 'codecalc[full]' setup --write registers codecalc with your MCP client automatically. New to MCP, or want more detail first? See QUICKSTART.md, or the Install section below.
Three things nobody else offers together cleanly:
install_package, the
runtime-update tools, executed code unless no_net, and a one-time
in-process grammar download on first analyze_complexity β full breakdown
in the network-boundary table below).verify_translation proves a port to another
language behaves identically, verify_optimization proves an optimization
preserved behavior, and z3_check proves or refutes logic with an SMT
solver.Use it when you want a free, local, private, hardened code-runner and verifier that an MCP agent can call directly β no vendor account, no cloud spend, nothing leaving the machine except where a tool's job explicitly requires it.
Reach for something else when you want managed cloud scale instead of self-hosting (a hosted sandbox like E2B or Modal), or when you're not self-hosting at all and the model vendor's built-in code interpreter already covers what you need.
codecalc is not a general cloud sandbox and not a vendor code interpreter. It overlaps with several things and beats them in only one narrow place β forcing a model to measure a claim instead of asserting it. Where that isn't what you need, one of these is the better tool, and this table says so plainly.
| You want⦠| Better fit | Why |
|---|---|---|
| To just run some Python/JS quickly, zero setup | Your model vendor's built-in interpreter | Already there, already sandboxed, nothing to install. Anthropic's code-execution tool has internet access "completely disabled" and cannot install packages at runtime; OpenAI's hosted containers have no outbound network access by default, with an org-level network_policy allowlist as an opt-in. Both return output artifacts by reference (Anthropic a file_id via the Files API, OpenAI a container_file_citation) rather than inline (Anthropic code-execution tool docs, https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool; OpenAI shell/container tool guide, https://developers.openai.com/api/docs/guides/tools-shell; both retrieved 2026-09-07) |
| Heavy or multi-tenant workloads, managed scale | A cloud sandbox (E2B, Modal, Daytona) | Per-tenant Firecracker/gVisor isolation codecalc does not claim by default |
| Pure arithmetic or symbolic math, nothing else | A small calculator or SymPy MCP | Lower token cost; none of the 31-language runtime machinery |
| A model to stop guessing numbers, equivalence, and speedups β locally, privately, with graded evidence | codecalc | Exact rationals, verify_translation/verify_optimization, and unenforced/grade honesty β offline, no account |
Do not reach for codecalc if you need multi-tenant or network-exposed isolation (its threat model is explicitly single-operator, local, stdio), if zero-setup convenience matters more than measurement, or if a hosted interpreter already covers your case. It earns its keep only when the correctness of the claim β not just "it ran" β is the point.
codecalc setupThe fastest path to a working MCP connection, without reading the rest of this section:
It detects which MCP client is installed (Claude Desktop, Claude Code,
Cursor, VS Code, Zed β pass --client=NAME if none or several are found),
reuses codecalc doctor's own backend/extras/grammar-cache checks, prints the
exact config block in that client's own JSON shape with absolute paths
already filled in, runs two real canaries (execute_code, evaluate_expression)
to prove the connection would work, and ends in one verdict: ready /
degraded / not-ready. --write is the only mode that changes anything β
it MERGES the codecalc entry into your existing client config (every other
server stays exactly as it was) and backs up the original to
<path>.codecalc-bak first. codecalc --help lists every subcommand.
[!NOTE] Published as
codecalc0.8.0 on PyPI (pip install codecalc) and thecodecalc-exec0.8.0 executor on crates.io (#91). Every release artifact carries a keyless sigstore build-provenance attestation β verify one withgh attestation verify <file> --repo The-40-Thieves/codecalc; PyPI wheels additionally carry PEP 740 attestations.
The published install (simplest β no build step, and what most people want):
From source, if you would rather build the executor yourself:
Without the cargo build, everything still runs on the pure-Python fallback β
doctor will say so, and the network table below says what that costs.
Why [full]. The base install is the MCP surface and the sandbox executor:
31 language runtimes, sessions, packages, ~32 MB. The symbolic half β sympy and
z3 β is 88.6 MB measured, and a caller who only runs code should not download an
SMT solver to do it. So it is an extra:
| install | size | what you get |
|---|---|---|
codecalc | ~32 MB | execute_code, sessions, packages, complexity-free tools |
codecalc[symbolic] | +83 MB | evaluate_expression, solve, limits, truth tables, z3, units |
codecalc[parsing] | +5 MB installed, +89 MB fetched on first use | analyze_complexity via tree-sitter |
codecalc[full] | ~120 MB | everything |
Nothing fails silently: a tool whose extra is missing returns
{"ok": false, "error": "sympy is not installed. It ships in the 'symbolic' extra: pip install 'codecalc[symbolic]' ..."}, and codecalc doctor lists
which extras are present before you make a call.
Four names for the capability sets above, plus the two that live outside
pyproject.toml entirely β a Docker image and an opt-in isolation boundary.
The invariant that makes "edition" a meaningful word here: in the edition
that lists a tool, that tool is functional β never listed-but-missing-its-extra.
A tool an edition doesn't have returns the dependency_missing contract error
naming the extra that provides it (see above), not a silent failure or a
tool that appears to exist and doesn't work.
| Edition | Install | What you get |
|---|---|---|
| Full | uvx 'codecalc[full]' / pip install 'codecalc[full]' | The recommended local product: the native (Rust) executor, symbolic tools (evaluate_expression, solve_linear, z3_check, β¦), and parsing (analyze_complexity). Everything this README documents actually runs. |
| Core | uvx codecalc / pip install codecalc | Execution + non-symbolic tools only β the base install in the table above. Every symbolic/parsing tool is still listed by tools/list (MCP doesn't support per-install schemas), but calling one returns dependency_missing naming the extra, before any other work happens. |
| Docker | docker build -f docker/mcp-server.Dockerfile . | The MCP server itself, packaged to run as an ordinary container. Core-shaped by default: ships python3/node/ruby/php/perl/gawk/lua/c/cpp/jq/sqlite3 and the default rlimit sandbox β symbolic/parsing are absent by design (no [full] in the base image; see the Dockerfile's own comment for why, including an arm64 z3-solver wheel gap). --build-arg CODECALC_EXTRA=full adds them. This image cannot nest the Strict Host boundary below inside itself (no privileged docker-in-docker), and codecalc doctor inside it says so rather than claiming a boundary it doesn't have. |
| Strict Host | opt-in; CODECALC_STRICT_URL (client) or the gVisor+Docker host itself (server) β see docs/deployment/README.md | Not an install, a boundary: the gVisor runsc sandbox on Linux, or AppContainer hardening on Windows, layered above whichever install above is already running. Fails closed β no digest pinned, no fallback to unenforced local execution. |
codecalc doctor reports which of these you're actually running (backend,
extras present, strict_runtime prerequisites) β read it before assuming a
capability rather than after a tool call surprises you.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/codecalc)<a href="https://allmcps.com/mcp/codecalc"><img src="https://allmcps.com/api/badge/codecalc?style=directory" alt="Codecalc on AllMCPs" /></a>