Calculates/evaluates the given mathematical expression
The Calculator MCP server enables large language models to perform precise numerical calculations. It provides a simple yet powerful interface for evaluating mathematical expressions, ensuring accurate results for arithmetic operations, complex formulas, and mathematical functions. With support for Python's math library, this tool extends beyond basic arithmetic to include advanced mathematical operations. It's designed to be lightweight, reliable, and easy to integrate into any MCP-compatible client.
The Calculator MCP server provides a reliable way for language models to perform precise numerical calculations. Instead of approximating math results, models can delegate calculations to this dedicated server for accurate answers.
There are two recommended ways to install the Calculator MCP server:
Install uv
if you don't have it already:
curl -LsSf https://astral.sh/uv/install.sh | sh
No additional installation is needed as we'll use uvx
to run the server directly.
Alternatively, you can install the package via pip:
pip install mcp-server-calculator
To configure your MCP client to use the Calculator server, add the appropriate configuration to your client settings.
"mcpServers": {
"calculator": {
"command": "uvx",
"args": ["mcp-server-calculator"]
}
}
"mcpServers": {
"calculator": {
"command": "python",
"args": ["-m", "mcp_server_calculator"]
}
}
Once configured, you can use the calculator in your conversations with the language model. The model will automatically use the calculator when it needs to perform precise calculations.
Example prompts that would trigger calculator usage:
The calculator supports a wide range of operations from basic arithmetic to more complex mathematical functions through the Python math library.