- Home
- MCP servers
- Calculator
Calculator
- python
42
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"huhabla-calculator-mcp-server": {
"command": "uvx",
"args": [
"--from",
"calculator-mcp-server@git+https://github.com/huhabla/calculator-mcp-server.git",
"--",
"calculator-mcp-server",
"--stdio"
]
}
}
}You can use the Mathematical Calculator MCP Server to perform advanced mathematical tasks—from quick arithmetic to symbolic math, statistical analysis, and matrix operations—within your MCP-enabled environment. It’s designed to be accessed by an MCP client, enabling Claude to perform calculations, solve equations, derive expressions, compute integrals, analyze data, and manipulate matrices with ease.
How to use
You interact with the Calculator MCP Server through your MCP client. Start the server and connect it as a local or remote MCP endpoint, then invoke any of its capabilities by framing your queries as standard MCP requests. Use it to perform a wide range of tasks, such as evaluating expressions, solving equations, differentiating or integrating expressions, computing basic statistics, and executing matrix operations. For example, you can ask the server to evaluate a complex expression, solve a quadratic equation, compute the mean of a dataset, or multiply two matrices. The server exposes these capabilities as tools you can call from your MCP client.
How to install
Prerequisites you need to have before installing are Python 3.10 or newer, and a method to run Python packages (uv is recommended; pip also works). You should also have Claude Desktop installed to use the MCP server with Claude.
Install steps
# 1. Clone the calculator MCP server repository
git clone https://github.com/huhabla/calculator-mcp-server.git
cd calculator-mcp-server
# 2. Option 1: Use the provided setup script
chmod +x setup_venv.sh
./setup_venv.sh
# 3. Option 2: Manually set up the virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# 4. Run doctests to verify everything works
bash run_doctests.sh
Integration with Claude Desktop
To expose the Calculator MCP Server to Claude Desktop, configure the MCP server entry in Claude’s client settings. The following stdio configuration uses uvx to load the server directly from the Git URL and run it with the appropriate arguments.
{
"mcpServers": {
"calculator": {
"name": "calculator",
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"calculator-mcp-server@git+https://github.com/huhabla/calculator-mcp-server.git",
"--",
"calculator-mcp-server",
"--stdio"
]
}
}
}
Usage examples
Once connected, you can request a variety of mathematical operations. Examples include basic calculations, solving equations, derivatives, integrals, and statistical analyses, as well as matrix operations. Use concise natural-language prompts that specify the task you want to perform.
Development
For development and debugging, you can run the MCP server in development mode to test tools interactively.
License
This project is licensed under the MIT License.
Available tools
basic_calculation
Evaluate mathematical expressions safely and return results.
symbolic_solve
Solve equations (linear, quadratic, polynomial, etc.).
derivative
Compute derivatives of expressions with respect to a variable.
integral
Compute integrals of expressions.
mean
Calculate the mean of a dataset.
median
Calculate the median of a dataset.
mode
Calculate the mode of a dataset.
variance
Compute the variance of a dataset.
stddev
Compute the standard deviation of a dataset.
correlation
Compute the correlation coefficient between two datasets.
linear_regression
Perform linear regression on a set of points.
matrix_add
Add two matrices.
matrix_multiply
Multiply two matrices.
matrix_transpose
Transpose a matrix.