Get the FREE Ultimate OpenClaw Setup Guide →

mcp -calculator

A Model Context Protocol server for calculating.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio githejie-mcp-server-calculator uvx mcp-server-calculator

How to use

The Calculator MCP Server exposes a single tool named calculate, which lets your language models perform precise numerical calculations by evaluating expressions. This enables LLMs to offload arithmetic and complex expressions to a dedicated calculator service, reducing drift and improving numerical accuracy in responses. You interact with it by routing a calculator request through the MCP client using the server name calculator.

To use the tool, send a request containing an expression string under the expression parameter. The server will evaluate the expression and return the result. This is useful for computing sums, products, powers, parentheses expressions, and other mathematical operations within the model's context. Use it wherever you need deterministic numeric results during a chat session or a multi-step reasoning task.

How to install

Prerequisites:

  • Python (3.8+)
  • Optional: uv (for uvx usage) or pipx/virtual environments

Installation options:

  1. Using uv (recommended)
  • Install uv as described by the project: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Run the server using uvx (no extra installation beyond uv): uvx mcp-server-calculator
  1. Using PIP
  • Install the package via pip: pip install mcp-server-calculator
  • Run the server as a module: python -m mcp_server_calculator
  1. Quick verification
  • After installation, you should be able to access the calculator tool by configuring an MCP client to connect to the server with the provided commands below.

Additional notes

  • The primary tool is calculate with a single required parameter: expression (string).
  • If you deploy via uvx, the recommended configuration in MCP client should be: { "command": "uvx", "args": ["mcp-server-calculator"] }.
  • If you deploy via Python, configuration should be: { "command": "python", "args": ["-m", "mcp_server_calculator"] }.
  • Ensure the environment allows network access if you are integrating with remote LLM services.
  • For debugging, check server logs for syntax errors in expressions or invalid inputs. Expressions follow standard arithmetic rules (parentheses, operators, etc.).

Related MCP Servers

Sponsor this space

Reach thousands of developers