Math MCP Server
Provides mathematical tools for symbolic algebra, calculus, numerical methods, linear algebra, statistics, discrete math, graph theory, rendering, and optional GPU acceleration, accessible from GitHub Copilot via MCP.
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., "@Math MCP 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.
Math MCP Server
Math MCP Server is a Python 3.12 Model Context Protocol server that exposes a broad mathematics toolkit over stdio. It combines symbolic algebra, calculus, numerical methods, linear algebra, statistics, discrete mathematics, graph theory, rendering, and optional GPU acceleration behind MCP tools that are usable from Claude Desktop, GitHub Copilot, and other MCP-compatible hosts.
The server is designed to run on CPU-only systems by default. If CUDA and CuPy are available, the GPU tool family accelerates supported workloads automatically and otherwise falls back to CPU implementations when possible.
Installation
Editable install with uv:
uv pip install -e .For GPU acceleration (requires CUDA 12.x and a compatible NVIDIA GPU):
uv pip install -e ".[gpu]"Editable install with uv and optional GPU support:
uv pip install -e ".[gpu]"Editable install with pip:
pip install -e .Use the base install for CPU-only systems. Install the gpu extra only on machines with a compatible CUDA 12.x environment.
For development dependencies and tests:
.venv/bin/uv sync --extra devRunning The Server
Run directly with Python:
python -m math_mcp.serverRun through uv:
uv run python -m math_mcp.serverRun via the console script:
math-mcp-serverThe server communicates over stdio, which is the expected transport for most MCP hosts.
MCP Host Configuration
Most MCP clients accept a JSON config that declares a named server, the command to run, and its arguments. A generic config looks like this:
{
"mcpServers": {
"math": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "math_mcp.server"],
"cwd": "/absolute/path/to/math-mcp-server"
}
}
}If the package is already installed in the active environment, you can use the console script instead:
{
"mcpServers": {
"math": {
"command": "math-mcp-server"
}
}
}Claude Desktop
Add the math server entry to your Claude Desktop MCP configuration file and point it at either the environment Python executable or the installed math-mcp-server script.
GitHub Copilot
Use the same mcpServers structure in your MCP-enabled Copilot or VS Code host configuration. The server name can remain math so it matches the packaged MCP entry point.
Other MCP Hosts
Any host that supports stdio MCP servers can run this project with the same command and args shown above.
Tool Catalog
Symbolic Tools
Tool | Description |
| Simplify algebraic, trigonometric, and rational expressions. |
| Expand products, powers, and composite symbolic expressions. |
| Factor polynomials and integers into structured symbolic factors. |
| Solve equations, systems, and inequalities over configurable domains. |
| Compute indefinite and definite symbolic integrals. |
| Differentiate expressions, including higher-order derivatives. |
| Evaluate one-sided and two-sided limits. |
| Produce Taylor or Laurent-like series expansions. |
| Evaluate finite and infinite symbolic summations. |
| Evaluate finite and infinite symbolic products. |
| Solve ordinary differential equations symbolically. |
| Compute Laplace transforms in the frequency domain. |
| Transform Laplace-domain expressions back to time-domain forms. |
Numerical Tools
Tool | Description |
| Numerically integrate real-valued functions on finite or improper intervals. |
| Find roots with bracketing or open methods such as Brent or Newton. |
| Solve initial value problems for scalar or vector ODE systems. |
| Interpolate tabular data with linear or spline-based methods. |
| Fit parametric models to observed data and report fitted parameters. |
Linear Algebra Tools
Tool | Description |
| Multiply dense matrices and vectors. |
| Solve square linear systems with direct or iterative methods. |
| Solve overdetermined systems with least-squares regression. |
| Compute QR, LU, Cholesky, or SVD-style decompositions. |
| Compute eigenvalues and eigenvectors. |
| Report determinant, rank, conditioning, definiteness, and shape metadata. |
Statistics Tools
Tool | Description |
| Return descriptive statistics for a sample. |
| Evaluate distribution PDFs, CDFs, quantiles, and related functions. |
| Run supported hypothesis tests and report significance details. |
| Fit linear and polynomial regression models. |
| Estimate confidence intervals with bootstrap resampling. |
| Draw samples from supported probability distributions. |
Discrete Math And Number Theory Tools
Tool | Description |
| Factor integers into prime powers. |
| Test whether an integer is prime. |
| Enumerate primes over an interval or generate the first |
| Compute GCD, LCM, extended GCD, or Euclidean algorithm steps. |
| Solve modular arithmetic tasks such as inverses, powers, and congruences. |
| Evaluate permutations, combinations, Catalan numbers, and related counts. |
| Count integer partitions and constrained partition variants. |
| Solve supported Diophantine equations over the integers. |
Graph Theory Tools
Tool | Description |
| Build graphs from named templates, edge lists, or adjacency matrices. |
| Compute shortest paths on weighted or unweighted graphs. |
| Compute a spanning tree or minimum spanning tree. |
| Report graph connectivity and structural metrics. |
| Compute maximum flow on directed graphs. |
GPU Tools
Tool | Description |
| Accelerate matrix multiplication with GPU support and CPU fallback. |
| Compute FFTs on GPU when available. |
| Compute batched eigenvalues for multiple matrices. |
| Solve batched linear systems using GPU acceleration where available. |
Rendering Tools
Tool | Description |
| Convert symbolic expressions to LaTeX and renderable output. |
| Render LaTeX math to an image data URI. |
| Plot explicit functions over configurable domains. |
| Plot implicit equations and inequalities. |
Hardware Requirements
Python 3.12 or newer.
CPU-only systems are fully supported for the non-GPU tool families.
Optional CUDA-capable NVIDIA GPU for the GPU tool family.
If CUDA or CuPy is unavailable, GPU tools either fall back to CPU implementations or report that GPU acceleration is not available.
Memory needs depend on workload size. Large symbolic expressions, large matrices, and graph algorithms can require significant RAM.
Example Queries
Simplify
(x^2 - 1) / (x - 1).Solve
x^2 - 5x + 6 = 0over the reals.Compute the definite integral of
sin(x)from0topi.Find the eigenvalues of
[[4, 1], [1, 3]].Fit an exponential decay model to observed time-series data.
Compute the bootstrap confidence interval for a sample mean.
Factor
123456789into prime powers.Find the shortest weighted path from node
Ato nodeD.Render the equation
x^2 + y^2 = 1as an implicit plot.Multiply a batch of matrices with GPU acceleration if hardware is available.
Verification
uv run python -c "from math_mcp.server import main; print('Import OK')"
uv run python -c "from math_mcp.tools.symbolic import simplify; print('Tools OK')"
uv run pytest tests/ -vResources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/amichae2/Math_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server