Skip to main content
Glama
mcp-calculator

mcp-calculator

by mitvvce-mdot

MCP Calculator Server

A simple Model Context Protocol server that exposes basic calculator tools. Built with the official mcp Python SDK and FastMCP.

Tools

Tool

Description

add

Add two numbers

subtract

Subtract one number from another

multiply

Multiply two numbers

divide

Divide one number by another

power

Raise a number to a power

square_root

Compute the square root of a number

Related MCP server: MCP Playground Server

Setup

Requires Python 3.12+ and uv.

cd mcp-calculator
uv sync

Run

Start the server (stdio transport, default for MCP clients like Cursor):

uv run calculator_server.py

For HTTP transport (e.g. MCP Inspector), change the last line of calculator_server.py to mcp.run(transport="streamable-http") and connect to http://localhost:8000/mcp.

Cursor configuration

Add this to your Cursor MCP settings:

{
  "mcpServers": {
    "calculator": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/Users/premithun/Downloads/cursor_projects/mcp-calculator",
        "calculator_server.py"
      ]
    }
  }
}

Replace the --directory path with the absolute path to this project on your machine.

Available Tools

6 tools
addB

Add two numbers together.

Inputs: a (required), b (required). Returns: result

divideA

Divide a by b. Raises an error if b is zero.

Inputs: a (required), b (required). Returns: result

multiplyA

Multiply two numbers.

Inputs: a (required), b (required). Returns: result

powerB

Raise base to the power of exponent.

Inputs: base (required), exponent (required). Returns: result

square_rootA

Return the square root of a number. Raises an error for negative values.

Inputs: n (required). Returns: result

subtractA

Subtract b from a.

Inputs: a (required), b (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool performs a unique mathematical operation (add, subtract, multiply, divide, power, square root) with no overlap.

    Naming Consistency5/5

    All tool names are single-word or underscore-separated (e.g., square_root), using consistent imperative verbs.

    Tool Count5/5

    Six tools cover essential arithmetic plus power and square root, appropriate for a basic calculator.

    Completeness4/5

    Covers addition, subtraction, multiplication, division, exponentiation, and square root. Missing common operations like modulus or floor division, but reasonable for a simple calculator.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A simple MCP server that provides basic calculator functionality for performing mathematical operations. Built with FastMCP and demonstrates fundamental MCP server implementation patterns.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A simple MCP server that provides calculator tools for basic arithmetic operations with zero-division protection.
      154 npm
      ISC