MCP Calculate Server
The MCP Calculate Server is a mathematical calculation service powered by the SymPy library that evaluates expression strings for symbolic and numerical computations.
Capabilities include:
Basic Operations: Addition, subtraction, multiplication, division, and exponentiation
Algebraic Manipulation: Expand, factor, and simplify expressions
Calculus: Differentiate, integrate, and calculate limits
Equation Solving: Solve single equations and systems of equations
Matrix Operations: Inversion, eigenvalue/eigenvector calculation
Series Expansion: Taylor series computations
Special Functions: Evaluate trigonometric, logarithmic, and exponential functions
Symbolic Variables: Handle variables (x, y, z) and constants (pi, E, oo)
Utilized as the server framework to expose SymPy's mathematical computation capabilities through an API accessible via the MCP protocol.
Offers matrix operations including inversion and eigenvalue/eigenvector calculations through SymPy's Matrix implementation.
Provides access to SymPy's symbolic computation capabilities including basic operations, algebraic manipulations, calculus, equation solving, matrix operations, series expansion, and special functions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Calculate Serversolve x^2 - 5x + 6 = 0"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Calculate Server
A mathematical calculation service based on MCP protocol and SymPy library, providing powerful symbolic computation capabilities.
Security
As of version 0.1.1, the server parses expressions through a restricted SymPy-only evaluator. It does not execute arbitrary Python code, and only a curated set of mathematical symbols, functions, and matrix methods are supported.
This release also adds validation for oversized expressions and large results to reduce denial-of-service risk from expensive symbolic computations.
Related MCP server: Calculator MCP
Key Features
Basic Operations: Addition, subtraction, multiplication, division, exponentiation
Algebraic Operations: Expression expansion, factorization, simplification
Calculus: Differentiation, integration (definite/indefinite), limit calculation
Equation Solving: Algebraic equations, systems of equations
Matrix Operations: Matrix inversion, eigenvalues/eigenvectors calculation
Series Expansion: Taylor series expansion
Special Functions: Trigonometric, logarithmic, exponential functions
Usage Examples
# Basic operations
"2 + 3*5" → 17
# Algebraic operations
"expand((x + 1)**2)" → x² + 2x + 1
"factor(x**2 - 2*x - 15)" → (x - 5)(x + 3)
# Calculus
"diff(sin(x), x)" → cos(x)
"integrate(exp(x), (x, 0, 1))" → E - 1
"integrate(exp(-x**2)*sin(x), (x, -oo, oo))" → 0
"limit(tan(x)/x, x, 0)" → 1
# Equation solving
"solve(x**2 - 4, x)" → [-2, 2]
"solve([x**2 + y**2 - 1, x + y - 1], [x, y])" → [(0, 1), (1, 0)]
# Matrix operations
"Matrix([[1, 2], [3, 4]]).inv()" → [[-2, 1], [3/2, -1/2]]
"Matrix([[1, 2, 3], [4, 5, 6]]).eigenvals()" → {9/2 - sqrt(33)/2: 1, 9/2 + sqrt(33)/2: 1}
"Sum(k, (k, 1, 10)).doit()" → 55
"series(cos(x), x, 0, 4)" → 1 - x²/2 + O(x⁴)Installation
Installing via Smithery
To install Calculate Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @611711Dark/mcp_sympy_calculate_server --client claudeLocal Installation
Clone repository:
git clone https://github.com/611711Dark/mcp_calculate_server.git cd mcp_calculate_serverCreate virtual environment and install dependencies:
uv venv source .venv/bin/activate uv pip install -e .Configuration:
"calculate_expression1": { "isActive": false, "command": "python", "args": [ "server.py" ], "cwd": "/path/to/mcp_calculate_server" }
API Usage
Call calculate_expression tool via MCP protocol by passing a mathematical expression string. The parser accepts a restricted set of SymPy expressions such as arithmetic, expand, factor, simplify, diff, integrate, limit, series, solve, Matrix(...).det()/inv()/eigenvals()/eigenvects(), and Sum(...).doit().
Supported Names
Symbols: lowercase variables such as
x,y,z, andkConstants:
pi,E,oo,IFunctions:
Abs,sin,cos,tan,log,exp,sqrt,expand,factor,simplify,diff,integrate,limit,series,solve,Sum,MatrixMatrix methods:
.det(),.inv(),.eigenvals(),.eigenvects()SymPy method:
.doit()on supported objects such asSum(...)
Validation Rules
Expressions that rely on arbitrary Python features, imports, filesystem access, or other non-mathematical constructs are intentionally rejected. Very large expansions, high-complexity solves, and oversized results may also be rejected to reduce denial-of-service risk. Keyword arguments, private attributes, unsupported matrix methods, malformed matrices, and unsupported names are rejected with an error message.
Dependencies
mcp>=1.5.0
sympy>=1.13.3
Acknowledgements
Thanks to this blog post for the introduction, and to Stefano for his help and responsible disclosure.
License
This project is licensed under MIT License. See LICENSE file.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/611711Dark/mcp_calculate_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server