mcp-registry/mcp-server-calculator

    ==================
      
       /// MCP ///
      /// MCP ///
        
    ==================
        
    [server:online]
    [protocol:ready]

mcp-server-calculator

by githejie

A Model Context Protocol (MCP) server that exposes a single "calculate" tool for precise numerical expression evaluation by LLMs.

98
13
Open Source

01

calculate

Calculates/evaluates the given expression

Installation

1. Prerequisites
• Python ≥ 3.9
• Git
2. Clone the repository
git clone https://github.com/githejie/mcp-server-calculator.git cd mcp-server-calculator
3. Create a virtual environment (recommended)
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
4. Install dependencies
If a requirements.txt file exists (common for this repo):
pip install -r requirements.txt
Otherwise install FastAPI & Uvicorn (typical MCP server stack):
pip install fastapi uvicorn pydantic
5. Environment configuration (optional)
• Create a .env file to hold secrets / API tokens used by MCP, e.g.
MCP_AUTH_TOKEN=your-strong-token
• The server will start in open mode if no token is supplied.
6. Run the MCP server
uvicorn mcp_server_calculator.app:app --host 0.0.0.0 --port 8000 --reload
7. Verify
Open http://localhost:8000/docs to view the autogenerated OpenAPI UI and test the /calculate endpoint.
8. Production deployment (example)
uvicorn mcp_server_calculator.app:app --host 0.0.0.0 --port 80 --workers 4
9. Docker (if a Dockerfile is present)
docker build -t mcp-server-calculator . docker run -d -p 8000:8000 --name calculator mcp-server-calculator

Documentation

License: MIT License
Updated 7/30/2025