mcp-math MCP Server

Exact arithmetic and verification tools for math competitions.

README.md

mcp-math

Exact arithmetic and verification tools for math competitions.

Purpose

Provides helpers for solving math problems with:

  • Exact arithmetic (fractions, bigints, SymPy)
  • Verification checks (integer, mod, range)
  • Notebook-exportable code

Design

The core is pure Python that works in Jupyter notebooks. The MCP server is a thin wrapper for local development.

mcp-math/
├── src/
│   ├── core/           # Pure Python helpers (notebook-compatible)
│   │   ├── exact.py    # Exact arithmetic functions
│   │   └── verify.py   # Verification functions
│   ├── server.py       # MCP server wrapper
│   └── export.py       # Export helpers for notebooks
└── tests/

Usage

In Claude Code (via MCP)

mikey_math_exact expr="1/3 + 1/4"
mikey_math_verify value=42 check="integer"
mikey_math_export  # Get notebook-ready code

In Jupyter Notebook

# Copy from export or paste directly
from fractions import Fraction
from sympy import *

def exact_eval(expr):
    """Evaluate expression with exact arithmetic."""
    ...

Installation

cd ~/Code/mcp-math
python3 -m venv .venv
source .venv/bin/activate
pip install sympy mcp

Add to ~/.claude.json:

"mcp-math": {
  "command": "/Users/YOUR_USERNAME/Code/mcp-math/.venv/bin/python3",
  "args": ["/Users/YOUR_USERNAME/Code/mcp-math/src/server.py"]
}

Tools 3

mikey_math_exactEvaluate mathematical expressions using exact arithmetic.
mikey_math_verifyPerform verification checks on a value.
mikey_math_exportGenerate notebook-ready Python code for further analysis.

Try it

Calculate the exact value of 1/3 + 1/4 using mikey_math_exact.
Verify if the result 42 satisfies the integer check using mikey_math_verify.
Export the current math problem solution to notebook-ready Python code.

Frequently Asked Questions

What are the key features of mcp-math?

Exact arithmetic support using fractions and SymPy. Verification checks for integer, mod, and range. Notebook-exportable Python code generation. Pure Python core compatible with Jupyter notebooks.

What can I use mcp-math for?

Solving complex math competition problems with high precision. Verifying mathematical results during research or study. Transitioning from Claude-assisted problem solving to Jupyter notebook analysis.

How do I install mcp-math?

Install mcp-math by running: cd ~/Code/mcp-math && python3 -m venv .venv && source .venv/bin/activate && pip install sympy mcp

What MCP clients work with mcp-math?

mcp-math works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep mcp-math docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest