sympy
A MCP server for symbolic manipulation of mathematical expressions
claude mcp add --transport stdio sdiehl-sympy-mcp uv run --with einsteinpy --with mcp[cli] --with pydantic --with sympy mcp run /ABSOLUTE_PATH_TO_SYMPY_MCP/server.py
How to use
Sympy MCP Server exposes a suite of SymPy-based symbolic mathematics tools via the MCP protocol, enabling an LLM or automation agent to perform algebraic manipulation, equation solving, calculus, tensor operations, and more through well-defined tool calls. Clients can introduce variables, parse expressions, differentiate, integrate, solve equations, work with vectors and tensors, and render results in LaTeX. The server supports both general symbolic tasks (e.g., solving algebraic equations, integrating expressions) and specialized calculus tools (e.g., ODE/PDE solving, tensor computations in relativity contexts) via a consistent tool interface. To begin, run the server through uv as described in the installation section, then connect using an MCP-compatible client or Claude Desktop, which will enumerate the available tools and provide a UI for issuing tool calls to functions like intro, introduce_expression, solve_algebraically, dsolve_ode, calculate_tensor, print_latex_expression, and more. The tools are designed to integrate with natural language prompts, enabling the LLM to orchestrate multiple steps (parsing an expression, introducing variables, solving an equation, and presenting results in LaTeX).
How to install
Prerequisites:
- Python installed (Python 3.8+)
- uv (Astral UV) installed per their installation guide
Installation steps:
- Clone the repository: git clone https://github.com/sdiehl/sympy-mcp.git
- Navigate into the project: cd sympy-mcp
- Install and run the MCP server via uv (per README usage): uv run mcp install uv run mcp run server.py
- Optional: If you want a standalone one-shot run of the server, you can use: uv run --with https://github.com/sdiehl/sympy-mcp/releases/download/0.1/sympy_mcp-0.1.0-py3-none-any.whl python server.py
- To enable relativity tools, sync additional dependencies: uv sync --group relativity
Notes:
- Ensure you have the required Python dependencies installed for SymPy and EinsteinPy if you plan to use relativity features.
- The MCP server is designed to be run behind a client (e.g., Claude Desktop or another MCP client) that can call the available tools by their IDs.
Additional notes
Tips and common issues:
- If the server does not appear in Claude Desktop, verify that the mcpServers entry points to the correct server.py path and that uv is installed and in your PATH.
- For general relativity calculations, install einsteinpy as indicated in the README (uv sync --group relativity).
- When using the standalone one-shot command, be mindful that it executes code from GitHub releases; review the wheel contents before running in sensitive environments.
- Use print_latex_expression or print_latex_tensor to get nicely formatted LaTeX output for expressions and tensors.
- By default, variables have SymPy-like assumptions (complex, commutative, etc.); adjust via introduce_variable calls if you need different assumptions.
Related MCP Servers
web-eval-agent
An MCP server that autonomously evaluates web applications.
mcp-neo4j
Neo4j Labs Model Context Protocol servers
Gitingest
mcp server for gitingest
zotero
Model Context Protocol (MCP) server for the Zotero API, in Python
fhir
FHIR MCP Server – helping you expose any FHIR Server or API as a MCP Server.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.