About Sympy MCP
Sympy MCP is an MCP server published by sdiehl in the Developer Tools category: a MCP server for symbolic manipulation of mathematical expressions. Conduid read 32 tools from its source: calculate_curl, calculate_divergence, calculate_gradient, calculate_tensor, convert_to_units, create_coordinate_system and 26 more. No package is published for it, so it installs from a source checkout.
The repository has 85 stars and 19 forks, is licensed Apache-2.0, and its last commit was on 5 Oct 2026. The latest release is 0.1.1 (22 May 2025). The release before it was 0.1 (18 May 2025). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include computer-algebra, sympy and devtools.
Install
git clone https://github.com/sdiehl/sympy-mcpTools (32)
calculate_curlCalculates the curl of a vector field using SymPy's curl function.| Parameter | Type | Description |
|---|---|---|
| vector_field_key * | string | The key of the vector field expression. |
calculate_divergenceCalculates the divergence of a vector field using SymPy's divergence function.| Parameter | Type | Description |
|---|---|---|
| vector_field_key * | string | The key of the vector field expression. |
calculate_gradientCalculates the gradient of a scalar field using SymPy's gradient function.| Parameter | Type | Description |
|---|---|---|
| scalar_field_key * | string | The key of the scalar field expression. |
calculate_tensorCalculates a tensor from a metric using einsteinpy.symbolic.| Parameter | Type | Description |
|---|---|---|
| metric_key * | string | The key of the stored metric object. |
| simplify_result | boolean | Whether to apply sympy simplification to the result. |
| tensor_type * | string | The type of tensor to calculate (e.g., "RICCI_TENSOR", "EINSTEIN_TENSOR"). |
convert_to_unitsConverts a quantity to the given target units using sympy.physics.units.convert_to.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression (previously introduced) to convert. |
| target_units * | array | List of unit names as strings (e.g., ["meter", "1/second"]). |
| unit_system | any | Optional unit system (from UnitSystem enum). Defaults to SI. |
create_coordinate_systemCreates a 3D coordinate system for vector calculus operations.| Parameter | Type | Description |
|---|---|---|
| coord_names | array | Optional list of coordinate names (3 names for x, y, z). If not provided, defaults to [name+'_x', name+'_y', name+'_z']. |
| name * | string | The name for the coordinate system. |
create_custom_metricCreates a custom metric tensor from provided components and symbols.| Parameter | Type | Description |
|---|---|---|
| components * | array | A matrix of symbolic expressions as strings representing metric components. |
| config | string | The tensor configuration - "ll" for covariant (lower indices) or "uu" for contravariant (upper indices). |
| symbols * | array | A list of symbol names used in the components. |
create_matrixCreates a SymPy matrix from the provided data.| Parameter | Type | Description |
|---|---|---|
| matrix_data * | array | A list of lists representing the rows and columns of the matrix. Each element can be a number or a string expression. |
| matrix_var_name | string | Optional name for storing the matrix. If not provided, a sequential name will be generated. |
create_predefined_metricCreates a predefined spacetime metric from einsteinpy.symbolic.predefined.| Parameter | Type | Description |
|---|---|---|
| metric_name * | string | The name of the metric to create (e.g., "AntiDeSitter", "Schwarzschild"). |
create_vector_fieldCreates a vector field in the specified coordinate system.| Parameter | Type | Description |
|---|---|---|
| component_x * | string | String expression for the x-component of the vector field. |
| component_y * | string | String expression for the y-component of the vector field. |
| component_z * | string | String expression for the z-component of the vector field. |
| coord_sys_name * | string | The name of the coordinate system to use. |
differentiate_expressionDifferentiates an expression with respect to a variable using SymPy's diff function.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression (previously introduced) to differentiate. |
| order | integer | The order of differentiation (default is 1 for first derivative). |
| var_name * | string | The name of the variable to differentiate with respect to. |
dsolve_odeSolves an ordinary differential equation using SymPy's dsolve function.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression (previously introduced) containing the differential equation. |
| func_name * | string | The name of the function (previously introduced) to solve for. |
| hint | any | Optional solving method from ODEHint enum. If None, SymPy will try to determine the best method. |
integrate_expressionIntegrates an expression with respect to a variable using SymPy's integrate function.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression (previously introduced) to integrate. |
| lower_bound | string | Optional lower bound for definite integration. |
| upper_bound | string | Optional upper bound for definite integration. |
| var_name * | string | The name of the variable to integrate with respect to. |
introIntroduces a sympy variable with specified assumptions and stores it.| Parameter | Type | Description |
|---|---|---|
| neg_assumptions * | array | |
| pos_assumptions * | array | |
| var_name * | string |
intro_manyIntroduces multiple sympy variables with specified assumptions and stores them.| Parameter | Type | Description |
|---|---|---|
| variables * | array |
introduce_expressionParses 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.| Parameter | Type | Description |
|---|---|---|
| canonicalize | boolean | |
| expr_str * | string | |
| expr_var_name | string |
introduce_functionIntroduces a SymPy function variable and stores it.| Parameter | Type | Description |
|---|---|---|
| func_name * | string |
matrix_determinantCalculates the determinant of a matrix using SymPy's det method.| Parameter | Type | Description |
|---|---|---|
| matrix_key * | string | The key of the matrix to calculate the determinant for. |
matrix_eigenvaluesCalculates the eigenvalues of a matrix using SymPy's eigenvals method.| Parameter | Type | Description |
|---|---|---|
| matrix_key * | string | The key of the matrix to calculate eigenvalues for. |
matrix_eigenvectorsCalculates the eigenvectors of a matrix using SymPy's eigenvects method.| Parameter | Type | Description |
|---|---|---|
| matrix_key * | string | The key of the matrix to calculate eigenvectors for. |
matrix_inverseCalculates the inverse of a matrix using SymPy's inv method.| Parameter | Type | Description |
|---|---|---|
| matrix_key * | string | The key of the matrix to invert. |
pdsolve_pdeSolves a partial differential equation using SymPy's pdsolve function.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression (previously introduced) containing the PDE. If the expression is not an equation (Eq), it will be interpreted as PDE = 0. |
| func_name * | string | The name of the function (previously introduced) to solve for. This should be a function of multiple variables. |
| hint | any |
print_latex_expressionPrints a stored expression in LaTeX format, along with variable assumptions.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string |
print_latex_tensorPrints a stored tensor expression in LaTeX format.| Parameter | Type | Description |
|---|---|---|
| tensor_key * | string | The key of the stored tensor object. |
quantity_simplify_unitsSimplifies a quantity with units using sympy's built-in simplify method for Quantity objects.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression (previously introduced) to simplify. |
| unit_system | any | Optional unit system (from UnitSystem enum). Not used with direct simplify method. |
reset_stateResets the state of the SymPy MCP server.search_predefined_metricsSearches for predefined metrics in einsteinpy.symbolic.predefined.| Parameter | Type | Description |
|---|---|---|
| query * | string | A search term to find metrics whose names contain this substring. |
simplify_expressionSimplifies a mathematical expression using SymPy's simplify function.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression (previously introduced) to simplify. |
solve_algebraicallySolves an equation (expression = 0) algebraically for a given variable.| Parameter | Type | Description |
|---|---|---|
| domain | any | The domain to solve in: Domain.COMPLEX, Domain.REAL, Domain.INTEGERS, or Domain.NATURALS. Defaults to Domain.COMPLEX. |
| expr_key * | string | The key of the expression (previously introduced) to be solved. |
| solve_for_var_name * | string | The name of the variable (previously introduced) to solve for. |
solve_linear_systemSolves a system of linear equations using SymPy's linsolve.| Parameter | Type | Description |
|---|---|---|
| domain | any | The domain to solve in (Domain.COMPLEX, Domain.REAL, etc.). Defaults to Domain.COMPLEX. |
| expr_keys * | array | The keys of the expressions (previously introduced) forming the system. |
| var_names * | array | The names of the variables to solve for. |
solve_nonlinear_systemSolves a system of nonlinear equations using SymPy's nonlinsolve.| Parameter | Type | Description |
|---|---|---|
| domain | any | The domain to solve in (Domain.COMPLEX, Domain.REAL, etc.). Defaults to Domain.COMPLEX. |
| expr_keys * | array | The keys of the expressions (previously introduced) forming the system. |
| var_names * | array | The names of the variables to solve for. |
substitute_expressionSubstitutes a variable in an expression with another expression using SymPy's subs method.| Parameter | Type | Description |
|---|---|---|
| expr_key * | string | The key of the expression to perform substitution on. |
| replacement_expr_key * | string | The key of the expression to substitute in place of the variable. |
| var_name * | string | The name of the variable to substitute. |
Security checks
Static checks derived from the repository 11 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 2.3K words.
- ✓License declaredThe repository declares the Apache-2.0 license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by uv.lock.
- ✓No dynamic code executionScanned 2 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdio, Streamable HTTP and HTTP with SSEserver.py:1907, server.py:1907, server.py:1907
- Starts other programs
- No calls that start other programs
- Outbound network calls
- 1 callserver.py:100
- Writes or deletes files
- No file writes or deletes
- Lockfile
- uv.lock
Pattern matches on the source text of 2 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 2.3K words, fetched a month ago. The original in the repository is authoritative.
Read full README