Home / MCP / Calculator MCP Server
A Model Context Protocol server that evaluates expressions via a calculator tool for precise numerical computations.
Configuration
View docs{
"mcpServers": {
"calculator": {
"command": "uvx",
"args": [
"mcp-server-calculator"
]
}
}
}You can use the Calculator MCP Server to let language models perform precise numerical calculations by evaluating expressions through a dedicated calculator endpoint. It enables seamless, on-demand math within your MCP-enabled workflows.
To use this MCP server, configure your MCP client to connect either via a local stdio command or a remote URL, then send calculation requests through the calculate tool. The server exposes a single tool named calculate that evaluates the given expression and returns the result. Use it anytime you need exact arithmetic, complex expressions, or unit-aware calculations as part of your conversations with an LLM.
Prerequisites: you need Python installed if you plan to run via Python, or you can use the uvx installer for a streamlined setup.
curl -LsSf https://astral.sh/uv/install.sh | sh
```
```
# Start the MCP server using uvx
uvx mcp-server-calculatorpip install mcp-server-calculator
```
```
python -m mcp_server_calculator{
"mcpServers": {
"calculator": {
"command": "uvx",
"args": ["mcp-server-calculator"]
}
}
}Calculates/evaluates the given expression. Provide an expression string to perform arithmetic or more advanced math, and receive the computed result.