A Model Context Protocol (MCP) server that provides basic mathematical, statistical and trigonometric functions to Large Language Models (LLMs). This server enables LLMs to perform accurate numerical calculations through a simple API.
- Basic arithmetic operations (addition, subtraction, multiplication, division, sum, modulo)
- Statistical functions (mean, median, mode, min, max)
- Rounding functions (floor, ceiling, round)
- Trigonometric functions (sin, cos, tan, and their inverses; degrees/radians conversions)
Note: Ensure you have Node.js installed on your computer.
Just clone this repository and save it locally somewhere on your computer.
Then add this server to your MCP configuration file:
"math": {
"command": "node",
"args": ["PATH\\TO\\PROJECT\\math-mcp\\build\\index.js"]
}Here is an example for OpenCode
{
"mcp": {
"math-mcp": {
"type": "local",
"command": [
"node",
"PATH\\TO\\PROJECT\\math-mcp\\build\\index.js"
]
}
}
}Replace PATH\\TO\\PROJECT with the actual path to where you cloned the repository.
Note: This project comes prebuilt, so installation is easy but if you change anything in the code, rebuild the project with
npm run build.
The Math-MCP server provides the following mathematical operations: