sympy-mcp
by sdiehl·★ 70·Score 48
A Model Context Protocol server that exposes SymPy's symbolic mathematics capabilities through MCP tool calling for LLMs.
Overview
Sympy-MCP is a comprehensive MCP server that provides LLMs with access to powerful symbolic mathematics capabilities through the Model Context Protocol. It exposes numerous SymPy tools for manipulating mathematical expressions, solving equations, performing calculus operations, and even handling advanced topics like tensor calculus for general relativity. The server bridges the gap between LLMs and specialized computer algebra systems, enabling accurate symbolic manipulation without the hallucination issues that typically affect language models with mathematical operations.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this server when you need precise symbolic mathematics calculations and want to leverage LLMs for orchestrating mathematical workflows without risking hallucinations in mathematical operations.
When NOT to choose this
Don't choose this server if you need numerical computation rather than symbolic manipulation, or if you're working in an environment where Python/uv package management is not feasible.
Tools this server exposes
12 tools extracted from the READMEintroIntroduces a variable with specified assumptions and stores it
intro_manyIntroduces multiple variables with specified assumptions simultaneously
introduce_expressionParses an expression string using available local variables and stores it
solve_algebraicallySolves an equation algebraically for a given variable over a given domain
dsolve_odeSolves an ordinary differential equation
integrate_expressionIntegrates an expression with respect to a variable
differentiate_expressionDifferentiates an expression with respect to a variable
simplify_expressionSimplifies a mathematical expression using SymPy's canonicalize function
create_matrixCreates a SymPy matrix from the provided data
matrix_determinantCalculates the determinant of a matrix
calculate_tensorCalculates tensors from a metric (Ricci, Einstein, Weyl tensors)
create_predefined_metricCreates a predefined spacetime metric (e.g. Schwarzschild, Kerr, Minkowski)
Comparable tools
Installation
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) first.
# Setup the project
git clone https://github.com/sdiehl/sympy-mcp.git
cd sympy-mcp
uv sync
# Install the server to Claude Desktop
uv run mcp install server.py
# Run the server
uv run mcp run server.pyFor Claude Desktop configuration:
{
"mcpServers": {
"sympy-mcp": {
"command": "/opt/homebrew/bin/uv",
"args": [
"run",
"--with",
"einsteinpy",
"--with",
"mcp[cli]",
"--with",
"pydantic",
"--with",
"sympy",
"mcp",
"run",
"/ABSOLUTE_PATH_TO_SYMPY_MCP/server.py"
]
}
}
}FAQ
- What mathematical operations are supported by this MCP server?
- The server supports algebraic equation solving, integration and differentiation, vector calculus, tensor calculus for general relativity, both ordinary and partial differential equations, matrix operations, unit conversions, and more.
- Can this server handle general relativity calculations?
- Yes, it can compute tensors from metrics (Ricci, Einstein, Weyl tensors) and includes predefined spacetime metrics like Schwarzschild, Kerr, and Minkowski. For general relativity calculations, you need to install the einsteinpy library.
Compare sympy-mcp with
Last updated · Auto-generated from public README + GitHub signals.