Skip to content
MCP server

mathguard

Check LLM maths with SymPy and Pint: identities, derivations, calculus and units

Runs locallyStatus and history
Install
Platforms
CLI, API
Runs
Locally
Version
0.4.0
Listing updated
today

Similar MCP servers

About mathguard

mathguard is an MCP server for education and exams. It runs locally on your machine and is started by your AI client.

Language models set up calculations well but often slip when carrying them out. mathguard is a verification layer built on SymPy and Pint that checks a claim and, when it is wrong, gives a concrete counterexample. It can test a single identity, walk a derivation step by step and point at the faulty line, or grade a model's answer against a reference with unit conversion and rounding tolerance.

Results use deliberately honest statuses. Verified means a computer algebra system confirmed the claim; likely means many random points agreed without a proof; refuted, inconclusive and error cover the rest. The README notes that verified is not formal proof and points to Lean 4 for that.

A whole worked solution written in Markdown or LaTeX can be checked in one go, and the server also exists as a Python library and command-line tool (mathguard doc, mathguard grade). A browser demo is hosted on Hugging Face. It installs from PyPI.

Install

Run in a terminal

claude mcp add mathguard -- uvx mathguard

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mathguard": {
      "command": "uvx",
      "args": [
        "mathguard"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mathguard": {
      "command": "uvx",
      "args": [
        "mathguard"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "mathguard": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mathguard"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mathguard": {
      "command": "uvx",
      "args": [
        "mathguard"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mathguard": {
      "command": "uvx",
      "args": [
        "mathguard"
      ]
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Tools this server provides (11)

Taken from the project documentation; the running server may differ.

check_equal
Tests whether two expressions are equal.
check_chain
Checks each step of a derivation.
check_derivative
Differentiates and compares.
check_antiderivative
Differentiates a claimed antiderivative.
check_definite_integral
Verifies a definite integral.
check_solutions
Checks claimed solutions and missing ones.
check_value
Evaluates a numeric claim to tolerance.
check_limit
Checks a limit.
check_answer
Grades final results against a reference.
check_document
Checks a whole Markdown or LaTeX solution.
check_dimensions
Dimensional analysis with units.

What it does

Step-by-step derivation check
Finds the first wrong step in a chain of rewritings.
Answer grading
Compares formulas symbolically and numbers with unit conversion.
Calculus checks
Verifies derivatives, antiderivatives, definite integrals and limits.
Solution set check
Substitutes claims and flags missing solutions.
Dimensional analysis
Detects unit mismatches with Pint.
Whole-document check
Reads LaTeX or Markdown solutions and reports per step.

Good for

  • Verify a model's worked physics solution
  • Grade LLM answers in an evaluation against reference results
  • Confirm an integral or derivative claim
  • Catch a missing root in a solved equation
  • Detect inconsistent units in an equation

mathguard FAQ

Does verified mean proven?

No. It means a computer algebra system confirmed it; the README points to Lean 4 for machine-checked proofs.

How do I install it?

pip install mathguard.

What formats can it read?

Plain text, Markdown and LaTeX, including align and equation environments.

Can I try it without installing?

Yes, there is a Hugging Face demo.

How do I add mathguard to Claude Code?

Run this command in your terminal: claude mcp add mathguard -- uvx mathguard

What are the best alternatives to mathguard?

The closest alternatives to mathguard are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers