Skip to main content
Glama
Amankhan1009

calculator-mcp-server

by Amankhan1009

Calculator MCP Server

A Model Context Protocol server exposing calculator operations, built as a learning project.

Tools

  • add(a, b)

  • subtract(a, b)

  • multiply(a, b)

  • divide(a, b)

  • power(base, exponent)

  • square_root(number)

  • modulus(a, b)

Related MCP server: Calculator MCP

Run

uv run mcp dev src/calculator_mcp/server.py

Test

uv run pytest tests/ -v

Architecture

  • operations.py — pure calculator logic, no MCP dependency

  • server.py — FastMCP tool registration, thin wrappers over operations.py

  • exceptions.py — custom exception hierarchy (CalculatorError base)

  • tests/ — pytest unit tests, independent of the MCP layer

Connect to Claude Desktop

Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "calculator": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/calculator-mcp-server", "mcp", "run", "src/calculator_mcp/server.py"]
    }
  }
}

This structure generalizes to any MCP server: keep domain logic separate from protocol code, use typed exceptions per failure mode, annotate tools honestly (readOnly/idempotent/destructive/openWorld), and test the logic layer without needing a live server.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Amankhan1009/calculator-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server