math-reasoning-mcp
Click on "Deploy 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., "@math-reasoning-mcp What's the Laplace transform of t^2 e^{-3t} sin(2t)?"
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.
Math Reasoning MCP

A Model Context Protocol (MCP) server that gives AI agents a deterministic mathematical brain. Instead of hallucinating algebra, the agent delegates symbolic computation to a SymPy engine over JSON-RPC — getting exact, verifiable results every time.
Built for engineers, researchers, and students working in Algebra, Calculus, Signals & Systems, and Digital Signal Processing (DSP).
Why This Exists
Large Language Models are statistical text predictors. They can describe a Laplace transform, but when asked to execute one — especially a multi-step derivation involving chain rules, frequency shifts, and polynomial expansion — they routinely:
Drop negative signs
Hallucinate polynomial terms
Produce plausible-looking but wrong final answers
Models with built-in code execution (like Gemini) work around this by writing and running Python scripts in a proprietary sandbox. This MCP provides the same deterministic SymPy power as a universal, open standard — pluggable into any AI agent, no proprietary sandbox required.
Related MCP server: ReasonForge
Proof of Value
Problem: Compute the Laplace Transform of $f(t) = t^2 e^{-3t} \sin(2t)$ and find the system poles.
Raw LLM (no tools) | With Math MCP | |
Accuracy | ❌ Fails on the 2nd-derivative chain rule. Wrong poles. | ✅ Exact: $\frac{4(3(s+3)^2 - 4)}{((s+3)^2 + 4)^3}$, poles at $-3 \pm 2i$ |
Tokens | ~800+ (lengthy, incorrect derivation) | ~150 (two tool calls + final answer) |
Time | Slow (multi-step generation) | < 2 seconds |
21 Tools
📐 Core Algebra & Calculus
Tool | Description | Example |
| Convert LaTeX → SymPy |
|
| Simplify expressions |
|
| Solve for a variable |
|
| Numeric evaluation |
|
| Symbolic derivative (nth-order) |
|
| Symbolic integral |
|
| Partial fractions |
|
📡 Signals & Continuous Transforms
Tool | Description | Example |
| $f(t) \to F(s)$ |
|
| $F(s) \to f(t)$ |
|
| $f(t) \to F(\omega)$ |
|
| $F(\omega) \to f(t)$ | Inverse of the above |
| $(f * g)(t)$ with Heaviside support | Causal signals handled automatically |
💻 Discrete-Time & DSP
Tool | Description | Example |
| One-sided Z-transform |
|
| Discrete-Time Fourier Transform |
|
| Numerical FFT (numpy) |
|
| ADC quantization simulation |
|
⚙️ System Analysis
Tool | Description | Example |
| Poles & zeros of $H(s)$ or $H(z)$ |
|
| Prove/disprove linearity |
|
| Prove/disprove TI |
|
Both check_linearity and check_time_invariance support:
Memoryless systems: expressions in
xandt(e.g.,x**2,t*x + 5)Difference equations: expressions in
x_n,x_n1,x_n2,n(e.g.,x_n + x_n1)
check_linearity also detects affine systems (constant offset makes it non-linear).
🧮 Step-by-Step Solvers
Tool | Description |
| Derives the Laplace transform showing each property applied (linearity, frequency shift, time multiplication) with verification |
| Solves equations showing expansion, factoring, discriminant analysis, and verification of each root |
These tools don't just return the answer — they show the derivation, making them ideal for education and debugging.
Testing
55 tests covering all 21 tools, edge cases, and error handling:
uv run pytest tests/ -vtests/test_tools.py 55 passed in 4.38sTests cover:
All core algebra operations (simplify, solve, differentiate, integrate)
All transform tools (Laplace, Fourier, Z-transform, FFT)
System analysis (linearity, time-invariance) for both memoryless and memory systems
Affine vs. linear detection
Step-by-step output structure
Structured error handling for malformed input
Installation
Requires uv.
git clone https://github.com/TeleEng/math-reasoning-mcp.git
cd math-reasoning-mcp
uv syncUsage
Add to your MCP client configuration:
{
"mcpServers": {
"math-reasoning": {
"command": "uv",
"args": [
"run",
"--directory",
"<absolute-path-to-this-repository>",
"math-reasoning-mcp"
]
}
}
}Compatible with any MCP client: Claude Desktop, Cursor, Windsurf, Antigravity, custom agents, etc.
Architecture
┌──────────────┐ JSON-RPC ┌──────────────────┐
│ AI Agent │ ◄──── MCP ──────► │ Math MCP Server │
│ (any LLM) │ (stdio/SSE) │ (SymPy+NumPy) │
└──────────────┘ └──────────────────┘
│ │
Reads files, Deterministic
understands symbolic math
context engineTech Stack
SymPy — Symbolic mathematics engine
NumPy — Numerical computation (FFT, quantization)
MCP SDK — Model Context Protocol server framework
uv — Fast, reproducible Python dependency management
pytest — Test framework (55 tests)
License
MIT
Available Tools
21 toolscheck_linearityA
Checks if a system is linear using the superposition principle.
For system_type='memoryless': expression is in terms of 'x' and optionally 't'. Example: 'x**2', '3x', 'tx + 5'
For system_type='difference': expression is a difference equation in terms of 'x_n', 'x_n1' (x[n-1]), 'x_n2' (x[n-2]), 'y_n1' (y[n-1]), etc. Example: 'x_n + x_n1' (y[n] = x[n] + x[n-1])
Returns whether the system is linear with a symbolic proof.
Inputs: system_expression (required), system_type. Returns: result
check_time_invarianceA
Checks if a system is time-invariant.
For system_type='memoryless': expression is in terms of 'x' and 't'. Computes y(t-t0) and T{x(t-t0)} and checks equality.
For system_type='difference': expression is in terms of 'x_n', 'x_n1', 'n'. A system depending explicitly on 'n' is time-variant. Computes y[n-n0] and T{x[n-n0]} and checks equality.
Returns whether the system is time-invariant with a symbolic proof.
Inputs: system_expression (required), system_type. Returns: result
compute_fftB
Computes the Fast Fourier Transform (FFT) of a discrete numerical sequence using numpy. Returns complex-valued frequency bins.
Inputs: sequence (required). Returns: result
continuous_convolutionA
Computes the continuous-time convolution (f * g)(t) for causal signals. Automatically handles Heaviside (unit step) functions. Signals are assumed causal (zero for t < 0) unless they already contain Heaviside terms.
Inputs: f_t (required), g_t (required). Returns: result
differentiateB
Computes the nth-order derivative of an expression with respect to a variable.
Inputs: variable (required), expression (required), order. Returns: result
dtft_signalC
Computes the Discrete-Time Fourier Transform (DTFT) of x[n]. Returns X(W) where W is omega.
Inputs: expression (required). Returns: result
evaluate_expressionA
Evaluates a symbolic expression to a numeric result (floating-point).
Inputs: expression (required). Returns: result
fourier_transform_signalB
Computes the continuous Fourier transform of a signal f(t). Returns F(w).
Inputs: expression (required). Returns: result
integrate_expressionA
Computes the indefinite integral of an expression with respect to a variable.
Inputs: variable (required), expression (required). Returns: result
inverse_fourier_transform_signalA
Computes the Inverse Fourier transform of F(w). Returns f(t).
Inputs: expression (required). Returns: result
inverse_laplace_transform_signalB
Computes the Inverse Laplace transform of F(s). Returns f(t).
Inputs: expression (required). Returns: result
laplace_transform_signalA
Computes the Laplace transform of a causal signal f(t). Returns F(s) and the convergence condition.
Inputs: expression (required). Returns: result
parse_latex_to_sympyA
Parses a LaTeX math string into a SymPy expression string, which can be used in other tools.
Inputs: latex_str (required). Returns: result
partial_fraction_decompositionB
Performs Partial Fraction Decomposition on a rational function (crucial for inverse transforms).
Inputs: variable (required), expression (required). Returns: result
poles_and_zerosA
Finds the poles and zeros of a system transfer function H(s) or H(z).
Inputs: variable (required), transfer_function (required). Returns: result
simplify_expressionC
Simplifies a mathematical expression using algebraic identities.
Inputs: expression (required). Returns: result
solve_equationB
Solves an equation for a given variable. Pass equation as 'lhs - rhs' (set equal to 0) or use Eq(lhs, rhs).
Inputs: equation (required), variable (required). Returns: result
step_by_step_algebraA
Solves an equation step-by-step, showing intermediate algebraic manipulations. Returns the solution process including factoring, simplification, and final roots.
Inputs: variable (required), expression (required). Returns: result
step_by_step_laplaceA
Solves the Laplace transform of f(t) step-by-step, showing each transformation property applied (linearity, frequency shift, time multiplication). Returns both the derivation steps and the final answer.
Inputs: expression (required). Returns: result
uniform_quantizationA
Simulates uniform quantization of a continuous value. Returns the quantized value, quantization error, step size (Δ), and theoretical maximum SQNR.
Inputs: bits (required), v_max (required), v_min (required), value (required). Returns: result
z_transform_signalA
Computes the one-sided Z-transform of a discrete signal x[n]. Returns X(z).
Inputs: expression (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Each tool targets a distinct operation or transform family, and the descriptions clearly separate direct computation from step-by-step variants. The main ambiguity is between solve_equation/step_by_step_algebra and laplace_transform_signal/step_by_step_laplace, but the stated outputs make the distinction usable.
Transform and check tool families are consistent (laplace_transform_signal, inverse_laplace_transform_signal, check_linearity, check_time_invariance), but the overall set mixes verb_noun names, bare verbs like differentiate, and noun-phrase names like poles_and_zeros and uniform_quantization. The naming is readable and snake_case throughout, but not a uniform verb_noun pattern.
With 21 tools, the server is on the heavy side and overlaps somewhat with redundant step-by-step variants. Most tools do serve distinct math or signals purposes, but the count sits in the borderline 16-25 range rather than being tightly scoped.
Core algebra, calculus, convolution, and major transforms are covered, including inverse Laplace and Fourier transforms. However, there are notable gaps such as inverse Z-transform, inverse DTFT, definite integration, limits, and series support, which leave dead ends for some signal workflows.
Related MCP Connectors
Deterministic reasoning stack for AI agents: simulate, decide & compute, plus cross-domain tools.
AI-callable calculators and engineering models with real formulas. No hallucinated math.
Scientific compute for AI agents: symbolic, numerical, quantum, chemistry, ODE. Paid via x402.
500+ deterministic tools for AI agents: math, conversion, validation, hashing, encoding, date/time.
Related MCP Servers
- AlicenseBqualityCmaintenanceA Model Context Protocol server that enables LLMs to autonomously perform symbolic mathematics and computer algebra through SymPy's functionality for manipulating mathematical expressions and equations.3285Apache 2.0
- AlicenseNot gradedqualityDmaintenanceProvides a suite of deterministic math tools powered by SymPy to handle algebra, calculus, linear algebra, and statistics via the Model Context Protocol. It enables smaller language models to delegate complex computations to a verified symbolic backend for accurate and reliable results.Apache 2.0
- AlicenseAqualityDmaintenanceA secure mathematical computation sandbox that enables LLMs to perform symbolic math operations like algebra, calculus, and equation solving via SymPy. It features low-latency execution through pre-warmed process pools and provides standardized JSON outputs for reliable agent integration.12MIT
- AlicenseNot gradedqualityBmaintenanceProvides a token-efficient exact math engine for AI agents, enabling computation of derivatives, integrals, equations, and optimized Python/NumPy code via a single MCP tool.56 PyPI8MIT