Skip to content

Repository files navigation

T-MCP Banner

T-MCP Math

A powerful local MCP server for advanced mathematical computation, powered by Python and SymPy.

Part of the T-MCP Series by TMM Interactive


What is T-MCP Math?

T-MCP Math is a local Model Context Protocol (MCP) server that gives AI assistants like Claude, GitHub Copilot, Cursor, and others access to a broad mathematical toolset — running entirely on your machine. No API keys, no cloud, no cost.

It goes well beyond simple calculations, giving your AI agent access to deep mathematics including symbolic computation, calculus, differential equations, number theory, and rich visualizations, all through natural language.


Features

Algebra & Equations

  • Solve equations — algebraic equations for any variable, including polynomial and transcendental forms
  • Simplify expressions — reduce symbolic expressions to their simplest form
  • Solve systems of equations — linear and non-linear systems
  • Solve linear systems (matrix form) — solve Ax = B using matrix methods

Calculus

  • Derivatives — symbolic differentiation with respect to any variable
  • Integrals — indefinite and definite integrals with bounds
  • Limits — one-sided and two-sided limits at any point
  • Multivariable calculus — gradient, Jacobian, Hessian, divergence, curl, partial derivatives, Taylor series
  • Multiple integrals — double and triple integrals with configurable bounds
  • Find extrema — local minima and maxima via numerical optimization
  • Find roots numerically — numerical root finding for arbitrary functions

Differential Equations

  • Solve ODEs — first-order ordinary differential equations numerically
  • Solve systems of ODEs — coupled ODE systems
  • Laplace transform — symbolic Laplace and inverse Laplace transforms

Linear Algebra

  • Matrix operations — addition, multiplication, inverse, determinant, eigenvalues, and eigenvectors

Statistics & Probability

  • Descriptive statistics — mean, median, variance, standard deviation
  • Advanced statistics — quartiles, IQR, mode, skewness, kurtosis
  • Probability distributions — PDF and CDF for normal, binomial, Poisson, and more
  • Linear regression — slope, intercept, and R² value
  • Hypothesis testing — t-test, chi-squared test, ANOVA
  • Correlation analysis — Pearson and Spearman correlation

Number Theory

  • Prime checking — test whether any integer is prime
  • Prime factorization — full prime factor decomposition
  • GCD & LCM — greatest common divisor and least common multiple
  • Advanced number theory — Euler’s phi function, modular inverse, Fibonacci, factorial, divisibility
  • Congruence solving — solve ax ≡ b (mod m)
  • Chinese Remainder Theorem — solve systems of congruences

Complex Numbers

  • Complex operations — magnitude, phase, conjugate, real and imaginary parts, polar/rectangular conversion, arithmetic
  • Complex roots — compute all n-th roots of a complex number

Symbolic Math

  • Symbolic operations — expand, factor, collect, cancel, partial fractions, series expansion, substitution, inequality solving
  • Expression evaluation — evaluate expressions with variable bindings
  • LaTeX export — convert any expression to LaTeX notation

Geometry & Visualization

  • Polygon area — calculate area from arbitrary vertices
  • 2D distance — Euclidean distance between two points
  • Line equations — derive the line equation from two points
  • Function plots — 2D function graphs with configurable range
  • Geometry plots — visualize points, lines, and circles
  • Advanced plots — parametric, polar, 3D surface, histogram, boxplot, scatter, contour, and heatmap

Utilities

  • Unit conversion — convert values between common units
  • Expression pre-parsing — handles implicit multiplication and natural math notation

Installation

Prerequisites

  • Python 3.10 or higher
  • pip package manager

1. Clone the repository

git clone https://github.com/TMM-Interactive/T-MCP-Math.git
cd T-MCP-Math

2. Install dependencies

pip install -r requirements.txt

3. Verify

python mcp_server.py

The server starts and listens on stdio, ready to connect to any MCP-compatible client.


LLM Integration

Claude Desktop (Anthropic)

Add the following to your claude_desktop_config.json:

macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%\Claude\claude_desktop_config.json

{
"mcpServers": {
"t-mcp-math": {
"command": "python",
"args": ["/absolute/path/to/T-MCP-Math/mcp_server.py"]
}
}
}

Restart Claude Desktop, and the math tools will appear automatically.

GitHub Copilot (VS Code)

Add the following to your .vscode/mcp.json (workspace) or VS Code settings.json (global):

{
"mcp": {
"servers": {
"t-mcp-math": {
"type": "stdio",
"command": "python",
"args": ["/absolute/path/to/T-MCP-Math/mcp_server.py"]
}
}
}
}

Then open GitHub Copilot Chat and switch to Agent mode using the @ menu.

Cursor

Open Cursor Settings → MCP → Add new MCP server and use:

{
"t-mcp-math": {
"command": "python",
"args": ["/absolute/path/to/T-MCP-Math/mcp_server.py"]
}
}

You can also add it directly to ~/.cursor/mcp.json.

Windsurf (Codeium)

Add the following to ~/.codeium/windsurf/mcp_config.json:

{
"mcpServers": {
"t-mcp-math": {
"command": "python",
"args": ["/absolute/path/to/T-MCP-Math/mcp_server.py"]
}
}
}

Continue.dev

Add this to your ~/.continue/config.json:

{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "python",
"args": ["/absolute/path/to/T-MCP-Math/mcp_server.py"]
}
}
]
}
}

Usage Examples

Once connected, you can use natural language to invoke the tools:

"Solve the equation x³ - 6x² + 11x - 6 = 0"
"Calculate the derivative of sin(x²) * e^x"
"Plot f(x) = x² - 4x + 3 from -2 to 6"
"Compute the Laplace transform of t * e^(-2t)"
"Run a Pearson correlation on these two datasets: [1,2,3,4] and [2,4,5,4]"


The T-MCP Series

T-MCP Math is part of the T-MCP series — a collection of open-source, free, local MCP servers for specialized domains. You can check out the others here.


License

This project is licensed under the MIT License — free to use, modify, and distribute for any purpose, including commercial use. See LICENSE for details.


Credits & Maintainer

Developed and maintained by TMM Interactive.

TMM Interactive is a young tech company building software, web applications, and interactive digital experiences.


Made with ❤️ by TMM Interactive

About

Comprehensive symbolic and numerical mathematics

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages