Math MCP Server
The Math MCP Server performs mathematical operations with 64-bit precision and integrates with development environments like Claude Desktop, VS Code, and Cursor.
Core Operations:
Basic Arithmetic: Addition (list of numbers), subtraction, multiplication (list of numbers), and division - all supporting fractions and positive/negative numbers
Matrix Multiplication: Multiplies two matrices (as nested lists) with compatible dimensions, supporting fractions as elements
Key Features:
64-bit floating point precision for all calculations
Fast dependency management using
uvUnit testing with Pytest for reliability
Easy integration across multiple development environments
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 MCP Server multiply 15 by 3.5"
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
Overview
This is an MCP (Model Context Protocol) server that can do basic arithmetic in 64 bit precision, along with matrix multiplication.
Related MCP server: Calculator MCP Server
Features
Addition
Subtraction
Multiplication
Division
Matrix multiplication
Installation
Prerequisities
Ensure you have the following installed:
Python 3.13+
uv
Installing UV
See installation guide for all options.
Unix/MacOS
curl -LsSf https://astral.sh/uv/install.sh | shor
brew install uvWindows
winget install --id=astral-sh.uv -eClone the Repository
git clone https://github.com/avanishd-3/math-mcp.git
cd math-mcp-server
uv syncIntegration with Clients
Claude Code
fastmcp install claude-code src/math_server.py:math_mcp
Claude Desktop
fastmcp install claude-desktop src/math_server.py:math_mcp
Cursor
fastmcp install cursor src/math_server.py:math_mcp
VS Code
Add the following .vscode/mcp.json and use your actual path.
{
"servers": {
"Math MCP Server": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp",
"--with",
"numpy",
"fastmcp",
"run",
"/absolute/path/Desktop/to/math-mcp-server/src/math_server.py:math_mcp"
]
}
},
}Contributing
Fork the repository
Create a new branch:
git checkout -b add-featureMake changes and commit (remember to add unit tests in test/ directory)
git commit -m "Added a new feature"Push to your fork
git push origin add-featureOpen a pull request.
Project Structure
/
├── src
│ └── math_server.py
├── tests
│ ├── test_arithmetic.py
│ │ └── astro.svg
│ ├── test_linear_algebra.py
├── pytest.ini
├── pyproject.toml
└── uv.lockArchitecture
This MCP server uses Fast MCP 2.0, which provides many more features than Fast MCP 1.0, which is what the official Python SDK for MCP uses.
Also, the unit tests are written with Pytest, which is what Fast MCP 2.0 recommends.
Lastly, if you don't know, uv is a much faster version of pip that also provides a lockfile for project dependencies (this will be familiar if you've used npm or cargo before). The MCP Python SDK itself uses uv, and I use it for all new Python projects, because it's 10-100x faster than pip, and the lockfile makes dependency version management much simpler.
Available Tools
5 toolsaddA
Adds a list of positive and/or negative numbers with 64 bit floating point precision and returns a 64 bit float. You need to provide them in the format of a list. For example, [1, 2, 3] would return 6.0. You can also use fractions if you want to, like [1/2, 1/3, 1/4].
Inputs: numbers (required). Returns: result
divideA
Divides two numbers with 64 bit floating point precision and returns a 64 bit float. For example, dividing 10 by 2 would return 5.0. You can also use fractions if you want to, like 1/2 for number_1 and 1/3 for number_2.
Inputs: number_1 (required), number_2 (required). Returns: result
matrix_multiplicationA
Multiplies two matrices with 64 bit floating point precision and returns the result as a matrix. You need to provide them in the format of nested lists. For example, [[1, 2], [3, 4]] would represent a 2x2 matrix. Each sub list represents a row in the matrix, and each element in the sub list represents a column. The matrices must be compatible for multiplication, meaning the number of columns in the first matrix must equal the number of rows in the second matrix. You can also use fractions for individual elements if you want to, like [1/2, 1/3, 1/4].
Inputs: matrix_1 (required), matrix_2 (required). Returns: result
multiplyA
Multiplies a list of positive and/or negative numbers with 64 bit floating point precision and returns a 64 bit float. You need to provide them in the format of a list. For example, [1, 2, 3] would return 6.0. You can also use fractions if you want to, like [1/2, 1/3, 1/4].
Inputs: numbers (required). Returns: result
subtractB
Subtracts two numbers with 64 bit floating point precision and returns a 64 bit float. For example, subtracting 5 from 10 would return 5.0. You can also use fractions if you want to, like 1/2 for number_1 and 1/3 for number_2.
Inputs: number_1 (required), number_2 (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 5 tools
Each tool has a clearly distinct mathematical operation: addition, division, matrix multiplication, multiplication, and subtraction. There is no overlap in purpose—add and multiply handle lists for their respective operations, while divide and subtract handle two numbers, and matrix_multiplication is uniquely for matrices. An agent can easily tell them apart based on their specific functions.
All tool names follow a consistent verb-based pattern (add, divide, matrix_multiplication, multiply, subtract) without mixing conventions. The naming is straightforward and predictable, using simple action words that directly describe the operation, with matrix_multiplication as a compound term that still fits the verb_noun style.
With 5 tools, the count is reasonable for a math server covering basic arithmetic and matrix operations. It is well-scoped, but slightly under for a comprehensive math toolkit, as it lacks tools for operations like exponentiation, trigonometry, or advanced linear algebra, which might be expected in a broader math domain.
The tool set covers basic arithmetic (add, subtract, multiply, divide) and matrix multiplication, but there are notable gaps for a math server. Missing operations include exponentiation, square roots, trigonometric functions, and other matrix operations (e.g., inversion, determinant), which limits the surface for handling common mathematical tasks and could lead to agent workarounds.
Maintenance
Related MCP Connectors
High-precision finance & business calculations for AI agents — exact decimals, never floats.
Loan & mortgage calculator, compound interest, ROI, crypto prices, FX conversion for AI agents.
AI-callable calculators and engineering models with real formulas. No hallucinated math.
60+ units, live FX, timezones, and date arithmetic for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides basic arithmetic operations and advanced mathematical functions through the Model Context Protocol (MCP), with features like calculation history tracking and expression evaluation.1-
- AlicenseNot gradedqualityDmaintenanceA backend service that provides accurate arithmetic calculation capabilities to AI models via the Model Context Protocol, allowing LLMs to offload mathematical computations for numerical queries.1MIT
- AlicenseBqualityDmaintenanceProvides mathematical computation capabilities including basic arithmetic operations (add, subtract, multiply, divide), advanced functions (square root, factorial, logarithm), and trigonometric functions (sin, cos, tan) through the Model Context Protocol.5MIT
- AlicenseAqualityDmaintenanceProvides basic mathematical operations including addition, subtraction, multiplication, division, and power calculations through a Model Context Protocol interface.51MIT