A Model Context Protocol (MCP) server that provides basic mathematical and statistical functions to Large Language Models (LLMs). This server enables LLMs to perform accurate numerical calculations through a simple API.
Configuration
View docs{
"mcpServers": {
"ethanhenrickson-math-mcp": {
"command": "node",
"args": [
"PATH\\\\TO\\\\PROJECT\\\\math-mcp\\\\build\\\\index.js"
]
}
}
}Math-MCP is a server that provides basic mathematical, statistical, and trigonometric functions to help you perform accurate numerical calculations within language model workflows. It exposes a simple API through MCP, enabling your models to compute arithmetic, statistics, and trigonometry on demand.
To use Math-MCP with your MCP client, add it as a server you can connect to via the MCP protocol. You will be able to call arithmetic operations like addition and division, statistical functions such as mean and max, and trigonometric operations including sin and arctan. Each function accepts the specific parameters described in its section and returns the computed result. You can combine multiple function calls within a single session to perform complex calculations needed by your prompts.
Typical usage patterns include performing a sequence of computations to derive a result that depends on intermediate values, such as calculating a mean from a list, then using that mean in a subsequent calculation, or converting between radians and degrees before applying a trigonometric function. The server supports a wide range of operations so you can offload numerical work from your prompt logic to the MCP server.
Prerequisites: ensure you have Node.js installed on your system. You will also need npm (the Node package manager) to install dependencies if applicable.
1) Clone the project to your local machine.
2) Save the repository on your computer in a preferred location.
3) Add the Math-MCP server to your MCP configuration using the following snippet. Replace PATH\TO\PROJECT with the actual path to where you cloned the repository.
"math": {
"command": "node",
"args": ["PATH\\TO\\PROJECT\\math-mcp\\build\\index.js"]
}If your setup requires building the project before running the server, follow your usual workflow to build the project and then start the MCP server using the command shown in the configuration snippet above. Ensure the path to the built index.js file is correct for your environment.
The Math-MCP server provides arithmetic, statistical, and trigonometric operations. Use these functions by specifying the function name and the required parameters in your MCP requests.
Adds two numbers together. Parameters: firstNumber and secondNumber.
Subtracts the second number from the first. Parameters: minuend and subtrahend.
Multiplies two numbers. Parameters: firstNumber and SecondNumber.
Divides the first number by the second. Parameters: numerator and denominator.
Adds any number of numbers. Parameters: numbers (array of numbers).
Calculates the remainder after division. Parameters: numerator and denominator.
Rounds a number down to the nearest integer. Parameters: number.
Rounds a number up to the nearest integer. Parameters: number.
Rounds a number to the nearest integer. Parameters: number.
Calculates the arithmetic mean of a list of numbers. Parameters: numbers (array).
Calculates the median of a list of numbers. Parameters: numbers (array).
Finds the most common value in a list of numbers. Parameters: numbers (array).
Finds the minimum value in a list of numbers. Parameters: numbers (array).
Finds the maximum value in a list of numbers. Parameters: numbers (array).
Calculates the sine of a number in radians. Parameters: number.
Calculates the arcsine of a number in radians. Parameters: number.
Calculates the cosine of a number in radians. Parameters: number.
Calculates the arccosine of a number in radians. Parameters: number.
Calculates the tangent of a number in radians. Parameters: number.
Calculates the arctangent of a number in radians. Parameters: number.
Converts a radian value to degrees. Parameters: number.
Converts a degree value to radians. Parameters: number.