Pycodemath — Claude Code MCP server: checks Python math
The Pycodemath MCP server for Claude Code checks whether a Python function matches a formula. The agent gets a proof or a specific input that exposes a faulty result.
MIT ★ 8 updated 2026-11-14
claude mcp add pycodemath -- uvx pycodemathWhat Pycodemath does
Pycodemath compares a Python function with a formula and reports VERIFIED, REFUTED with a counterexample, or UNDECIDED with a reason. Counterexamples are actually run, rather than drawn from random samples. The server also handles math requests and returns exact answers or Python and NumPy code, using SymPy and NumPy for its calculations.
Claude Code connects with claude mcp add pycodemath -- uvx pycodemath. In the Windows example, the function runs in a worker process, so the code uses an if __name__ == "__main__" guard. Python 3.11–3.14 is listed as supported.
What it helps with
- check whether a function implements a formula
- find an input that makes code return the wrong result
- get an exact solution to a math expression
- generate Python or NumPy code from an expression
Example prompts for the agent
- Check whether
sum_tocomputes the sum from 0 tonusingn*(n+1)/2. - Find an input where this function disagrees with its formula.
- Solve
x^2 + y^2 = 25andx + y = 7forxandy.
How to install Pycodemath
Platform CLI
claude mcp add pycodemath -- uvx pycodemathuvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>
Platform CLI
codex mcp add pycodemath -- uvx pycodemathuvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>
Config file
{
"mcpServers": {
"pycodemath": {
"command": "uvx",
"args": [
"pycodemath"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>
Config file
{
"servers": {
"pycodemath": {
"type": "stdio",
"command": "uvx",
"args": [
"pycodemath"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>
Platform CLI
gemini mcp add pycodemath uvx pycodemathuvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Pycodemath
How do I install Pycodemath in Claude Code?
Run claude mcp add pycodemath -- uvx pycodemath.
What does Pycodemath do?
It checks Python functions against formulas and handles math requests, returning exact results or Python and NumPy code. A code check returns a proof, a counterexample, or a reason the result is undecided.
What does Pycodemath need to run?
The Claude Code setup command uses uvx. Python 3.11–3.14 is listed as supported.