Home / MCP / Calculator MCP Server

Calculator MCP Server

A Model Context Protocol server that evaluates expressions via a calculator tool for precise numerical computations.

python
Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

Prerequisites: you need Python installed if you plan to run via Python, or you can use the uvx installer for a streamlined setup.

Install using uv (recommended) and run the server

curl -LsSf https://astral.sh/uv/install.sh | sh
```

```
# Start the MCP server using uvx
uvx mcp-server-calculator

Install using Python and run the server

pip install mcp-server-calculator
```

```
python -m mcp_server_calculator

Configure your MCP client to connect to the server

{
  "mcpServers": {
    "calculator": {
      "command": "uvx",
      "args": ["mcp-server-calculator"]
    }
  }
}

Available tools

calculate

Calculates/evaluates the given expression. Provide an expression string to perform arithmetic or more advanced math, and receive the computed result.