# Pycodemath

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8 repo stars
- Author: cybersora9
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cybersora9/pycodemath
- Updated: 2026-11-14
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/pycodemath

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add pycodemath -- uvx pycodemath
```
uvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>

### Codex

**Platform CLI**
```bash
codex mcp add pycodemath -- uvx pycodemath
```
uvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add pycodemath uvx pycodemath
```
uvx runs the command named after the package; if the README names another one, use uvx --from pycodemath <command>

## When to use it
- 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
- Check whether `sum_to` computes the sum from 0 to `n` using `n*(n+1)/2`.
- Find an input where this function disagrees with its formula.
- Solve `x^2 + y^2 = 25` and `x + y = 7` for `x` and `y`.

## Similar
- [Context7](https://affpapa.org/en/nevibecode/mcp/context7.md) — MCP server · 5563 installs
- [Search Google Flights](https://affpapa.org/en/nevibecode/mcp/search-google-flights.md) — MCP server · 2595 installs
- [Math-MCP](https://affpapa.org/en/nevibecode/mcp/math-mcp.md) — MCP server · 5958 installs
- [pipeworx gateway](https://affpapa.org/en/nevibecode/mcp/pipeworx-gateway.md) — MCP server · 419019 installs
- [SparkForge](https://affpapa.org/en/nevibecode/mcp/sparkforge.md) — MCP server · 219896 installs
- [OpenWebSearch](https://affpapa.org/en/nevibecode/mcp/openwebsearch.md) — MCP server · 494 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
