SymPyCAUTION
A MCP server for symbolic manipulation of mathematical expressions
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
This library is no longer maintained. It is Apache licensed, so feel free to fork it.
Sympy-MCP is a Model Context Protocol server for allowing LLMs to autonomously perform symbolic mathematics and computer algebra. It exposes numerous tools from SymPy's core functionality to MCP clients for manipulating mathematical expressions and equations.
Why?
Language models are absolutely abysmal at symbolic manipulation. They hallucinate variables, make up random constants, permute terms and generally make a mess. But we have computer algebra systems specifically built for symbolic manipulation, so we can use tool-calling to orchestrate a sequence of transforms so that the symbolic kernel does all the heavy lifting.
While you can certainly have an LLM generate Mathematica or Python code, if you want to use the LLM as an agent or on-the-fly calculator, it's a better experience to use the MCP server and expose the symbolic tools directly.
The server exposes a subset of symbolic mathematics capabilities including algebraic equation solving, integration and differentiation, vector calculus, tensor calculus for general relativity, and both ordinary and partial differential equations.
For example, you can ask it in natural language to solve a differential equation:
Solve the damped harmonic oscillator with forcing term: the mass-spring-damper system described by the differential equation where m is mass, c is the damping coefficient, k is the spring constant, and F(t) is an external force.
$$ m\frac{d^2x}{dt^2} + c\frac{dx}{dt} + kx = F(t) $$
Or involving general relativity:
Compute the trace of the Ricci tensor $R_{\mu\nu}$ using the inverse metric $g^{\mu\nu}$ for Anti-de Sitter spacetime to determine its constant scalar curvature $R$.
Usage
You need uv first.
- Homebrew :
brew install uv - Curl :
curl -LsSf https://astral.sh/uv/install.sh | sh
Then
94c8d79b8512OBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add sympy-mcp -- uvx sympy-mcp
{
"mcpServers": {
"sympy-mcp": {
"command": "uvx",
"args": [
"sympy-mcp"
]
}
}
}Exposed tools (32)
26 read · 5 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
calculate_curl | read | Calculates the curl of a vector field using SymPy |
calculate_divergence | read | Calculates the divergence of a vector field using SymPy |
calculate_gradient | read | Calculates the gradient of a scalar field using SymPy |
calculate_tensor | read | Calculates a tensor from a metric using einsteinpy.symbolic. |
convert_to_units | read | Converts a quantity to the given target units using sympy.physics.units.convert_to. |
create_coordinate_system | write | Creates a 3D coordinate system for vector calculus operations. |
create_custom_metric | write | Creates a custom metric tensor from provided components and symbols. |
create_matrix | write | Creates a SymPy matrix from the provided data. |
create_predefined_metric | write | Creates a predefined spacetime metric from einsteinpy.symbolic.predefined. |
create_vector_field | write | Creates a vector field in the specified coordinate system. |
differentiate_expression | read | Differentiates an expression with respect to a variable using SymPy |
dsolve_ode | read | Solves an ordinary differential equation using SymPy |
integrate_expression | read | Integrates an expression with respect to a variable using SymPy |
intro | read | Introduces a sympy variable with specified assumptions and stores it. |
intro_many | read | Introduces multiple sympy variables with specified assumptions and stores them. |
introduce_expression | read | Parses a sympy expression string using available local variables and stores it. Assigns it to either a temporary name (expr_0, expr_1, etc.) or a user-specified global name. |
introduce_function | read | Introduces a SymPy function variable and stores it. |
matrix_determinant | read | Calculates the determinant of a matrix using SymPy |
matrix_eigenvalues | read | Calculates the eigenvalues of a matrix using SymPy |
matrix_eigenvectors | read | Calculates the eigenvectors of a matrix using SymPy |
matrix_inverse | read | Calculates the inverse of a matrix using SymPy |
pdsolve_pde | read | Solves a partial differential equation using SymPy |
print_latex_expression | read | Prints a stored expression in LaTeX format, along with variable assumptions. |
print_latex_tensor | read | Prints a stored tensor expression in LaTeX format. |
quantity_simplify_units | read | Simplifies a quantity with units using sympy |
reset_state | destructive | Resets the state of the SymPy MCP server. |
search_predefined_metrics | read | Searches for predefined metrics in einsteinpy.symbolic.predefined. |
simplify_expression | read | Simplifies a mathematical expression using SymPy |
solve_algebraically | read | Solves an equation (expression = 0) algebraically for a given variable. |
solve_linear_system | read | Solves a system of linear equations using SymPy |
solve_nonlinear_system | read | Solves a system of nonlinear equations using SymPy |
substitute_expression | read | Substitutes a variable in an expression with another expression using SymPy |
Trust audit
CAUTIONgrade B · trust 89/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | WARN |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (2 observation(s))
- Network
- declared (4 observation(s))
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (6)
ENV PATH="/root/.local/bin/:$PATH"
url = f"http://127.0.0.1:{mcp_port}/mcp"reset_state
streamable-http
.github/logo.png
- **Curl** : `curl -LsSf https://astral.sh/uv/install.sh | sh`
Gates applied: no_behavioural_pass.
94c8d79b8512full audit observations/trust-audit/mcp-server/sdiehl__sympy.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | 94c8d79b8512 | CAUTION | B | 89 | first audit |
Questions
What is the SymPy MCP server?
A MCP server for symbolic manipulation of mathematical expressions
What tools does SymPy expose?
32 in total: 26 read-only, 5 that write, and 1 that can delete or overwrite (reset_state). Every one is listed on this page with its risk.
Is SymPy safe to connect to an agent?
With care. The audit graded it B (89/100) and found 6 things worth knowing before you trust this server, listed below with the exact line each was found on. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does SymPy need?
No credential environment variables were found in its source, so it appears to need none.
How does SymPy run?
It speaks streamable-http, so it runs as a service you connect to over the network. It is published on PyPI as sympy-mcp.
How current is this page?
The grade is for one exact copy of the source (94c8d79b8512), read on 2026-10-07. The repository is watched and re-audited when it changes.