Checks the math in your code and gives AI agents an exact math engine (SymPy + NumPy).
MCPpedia last refreshed this data
io.github.cybersora9/pycodemath is an MCP server that checks the math in your code and gives AI agents an exact math engine (SymPy + NumPy). Its tool list has not been published yet over stdio and sse, requires no API key, and scores 85/100 on MCPpedia's security, maintenance and efficiency rubric.
Config is the same across clients - only the file and path differ.
{
"mcpServers": {
"io-github-cybersora9-pycodemath": {
"args": [
"pycodemath"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Checks the math in your code and gives AI agents an exact math engine (SymPy + NumPy).
This server supports HTTP transport. Be the first to test it - help the community know if it works.
Five weighted categories - click any category to see the underlying evidence.
No known CVEs.
Checked pycodemath against OSV.dev.
Be the first to review
Have you used this server?
Share your experience - it helps other developers decide.
Sign in to write a review.
Others in ai-ml / security
🛡️ BLA (Blind LLM Agents) — Adversarial defense shield that protects binaries, Electron apps, JS bundles, Python, and WebAssembly against AI reverse-engineering agents like REA. Poison -> Exhaust -> Hallucinate.
Unified real-time search engine skill for AI agents.
The official MCP server implementation for the Perplexity API Platform
Free, open-source MCP server that gives AI coding agents (Claude Code, Codex, Cursor, OpenCode, ZCode…) design inspiration from award-winning websites — search with real screenshots, pull design DNA, capture and record live sites. A Mobbin alternative. No API key.
MCP Security Weekly
Get CVE alerts and security updates for io.github.cybersora9/pycodemath and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Your code looks right. Is the math?
Pycodemath checks the math in your Python code. Give it a function and the formula it should compute. You get a proof that they match, or the exact input that breaks the function. No guessing, no random samples.
pip install pycodemath
# example.py
from pycodemath import check_code
SRC = '''
def sum_to(n: int) -> int: # should return 0 + 1 + ... + n
total = 0
for k in range(n): # off by one: stops at n-1
total += k
return total
'''
if __name__ == "__main__": # needed on Windows: your function runs in a worker process
r = check_code(SRC, "n*(n+1)/2")
print(r.verdict) # refuted
print(r.counterexample.call) # sum_to(n=1)
print(r.reason) # sum_to(n=1) returns 0, the formula gives 1 ...
REFUTED always comes with a concrete input that was really executed (the
witness). VERIFIED is a proof. Anything else is UNDECIDED, with a reason.
Fix the loop to range(n + 1), tell it n is a non-negative integer
(domain={"n": "integer, n>=0"}), and the same call comes back VERIFIED.
Pycodemath is also an exact math engine and an MCP server for AI agents (SymPy + NumPy): write math in a few characters, get an exact answer or standalone, optimized Python/NumPy code back, instead of asking a language model to "do arithmetic in its head".
Polska wersja tego dokumentu: README.pl.md.
Contents: Check the math in your code · Install · First run · Quick start · Verify · Results you can branch on · Code generation · Design contracts
1. A solver that silently drops a root. exp(x) = 3x has two real solutions;
SymPy's solve returns one. certify re-checks the answer and finds the missing root:
$ python -m pycodemath "certify solve exp(x) = 3*x for x"
-LambertW(-1/3)
certificate: REFUTED (sign-scan) — a root is missing: the expression changes sign at x ≈ 1.51213455165784 (confirmed at 30 and 60 digits), where no listed root lies
2. A system of equations, with proof the list is complete:
$ python -m pycodemath "solve x^2 + y^2 = 25, x + y = 7 for x, y"
x = 3, y = 4; x = 4, y = 3
proof: every solution substituted gives 0; the number of distinct complex solutions equals the dimension of Q[vars]/radical(I) (Seidenberg), so the list is complete
certificate: VERIFIED (groebner) — every solution substituted gives 0; the number of distinct complex solutions equals the dimension of Q[vars]/radical(I) (Seidenberg), so the list is complete
3. A formula that loses precision, rewritten and proved equal:
$ python -m pycodemath "improve sqrt(x+1)-sqrt(x) for x in [1e6, 1e12]"
1 / (sqrt(x + 1) + sqrt(x)): 28.5 -> 0.4 bits of error on average (39.9 -> 1.6 at worst), proved by check_equal
proof:
... [View full README on GitHub](https://github.com/cybersora9/pycodemath#readme)