introLABSCO SUMMARY
The algebra stops being guesswork.
Models permute terms, invent constants and hallucinate variables when asked to manipulate symbols. Routing the manipulation through SymPy leaves the model orchestrating a sequence of transforms while the kernel does the work — and the LaTeX comes back ready to paste.
What it is
A SymPy front end for MCP clients. Variables and expressions are introduced into a symbolic kernel, then solved, transformed and printed, so the manipulation is done by a computer algebra system rather than by the model.
What you get
- Variables, expressions and functions introduced into the working kernel, singly or several at a time
- Equations solved algebraically
- Linear and nonlinear systems solved
- Ordinary differential equations solved
- An expression printed as LaTeX
- The wider SymPy surface underneath: integration and differentiation, vector calculus, tensor calculus for general relativity, and partial differential equations
Requirements
uv, then uv sync, and either uv run mcp install server.py for Claude Desktop or uv run mcp run server.py for other clients. No account and no key.
Setup effort
Build from source — git clone https://github.com/sdiehl/sympy-mcp.git
USE CASES
Solving an equation you need to be right
Introduce the expression into the kernel and solve it there, rather than accepting a plausible-looking rearrangement.
Working through a differential equation
Define the function and its equation and get the ODE solved symbolically.
Handling a system of equations
Set the variables up in one call and solve the linear system as a whole.
Getting a result into a document
Print the resulting expression as LaTeX and paste it into the write-up.
Checking a nonlinear model
Introduce the constraints and let the nonlinear solver find what satisfies them.
31 tools
Listed in project docs. Your client may show a different list.
intro_manyintroduce_expressionprint_latex_expressionsolve_algebraicallysolve_linear_systemsolve_nonlinear_systemintroduce_functiondsolve_odepdsolve_pdecreate_predefined_metricsearch_predefined_metricscalculate_tensorcreate_custom_metricprint_latex_tensorsimplify_expressionsubstitute_expressionintegrate_expressiondifferentiate_expressioncreate_coordinate_systemcreate_vector_fieldcalculate_curlcalculate_divergencecalculate_gradientconvert_to_unitsquantity_simplify_unitscreate_matrixmatrix_determinantmatrix_inversematrix_eigenvaluesmatrix_eigenvectorsBEFORE YOU INSTALL
What to know first
Tools you get
31 tools named in the project's documentation.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/sdiehl/sympy-mcp.git
cd sympy-mcp
uv syncMCP Clients
Claude Desktop
{
"mcpServers": {
"sympy-mcp": {
"command": "/opt/homebrew/bin/uv",
"args": [
"run",
"--with",
"einsteinpy",
"--with",
"mcp[cli]",
"--with",
"pydantic",
"--with",
"sympy",
"mcp",
"run",
"<YOUR_PATH_TO_SYMPY_MCP>/server.py"
]
}
}
}<YOUR_PATH_TO_SYMPY_MCP>/server.py is the full path to server.py in your clone. The command /opt/homebrew/bin/uv is where Homebrew puts uv on Apple Silicon — use the output of which uv if yours is elsewhere. Running uv run mcp install server.py from the clone normally writes this entry for you.
Claude Desktop — Docker
{
"mcpServers": {
"sympy-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"-p",
"8081:8081",
"--rm",
"ghcr.io/sdiehl/sympy-mcp:main"
]
}
}
}Cursor
{
"mcpServers": {
"sympy-mcp": {
"command": "/opt/homebrew/bin/uv",
"args": [
"run",
"--with",
"einsteinpy",
"--with",
"mcp[cli]",
"--with",
"pydantic",
"--with",
"sympy",
"mcp",
"run",
"<YOUR_PATH_TO_SYMPY_MCP>/server.py"
]
}
}
}Add to ~/.cursor/mcp.json. <YOUR_PATH_TO_SYMPY_MCP>/server.py is the full path to server.py in your clone. The command /opt/homebrew/bin/uv is where Homebrew puts uv on Apple Silicon — use the output of which uv if yours is elsewhere.
VS Code, VS Code Insiders
{
"servers": {
"sympy-mcp": {
"command": "uv",
"args": [
"run",
"--with",
"einsteinpy",
"--with",
"mcp[cli]",
"--with",
"pydantic",
"--with",
"sympy",
"mcp",
"run",
"<YOUR_PATH_TO_SYMPY_MCP>/server.py"
]
}
}
}<YOUR_PATH_TO_SYMPY_MCP>/server.py is the full path to server.py in your clone.
Cline
Start the server over SSE first, from your sympy-mcp clone (it listens on port 8081 by default): uv run python server.py --transport sse
In Cline, select MCP Servers at the top, then Remote Servers, and add:
{
"Server Name": "sympy-mcp",
"Server URL": "http://127.0.0.1:8081/sse"
}5ire
/opt/homebrew/bin/uv run --with einsteinpy --with mcp[cli] --with pydantic --with sympy mcp run <YOUR_PATH_TO_SERVER>In 5ire, go to Tools → New: Tool Key sympy-mcp, Name SymPy MCP, and this as the Command. <YOUR_PATH_TO_SERVER> is the full path to server.py in your clone.