Skip to main content
Glama
abhiram4580

Remote Calculator FastMCP Server

by abhiram4580

Remote Calculator FastMCP Server

A Model Context Protocol (MCP) server built with FastMCP specifically configured to run remotely over HTTP / SSE (Server-Sent Events).

Remote MCP clients (e.g., Claude Desktop, Cursor, LibreChat, Open WebUI, and custom MCP clients) can connect to this server across the network or internet.


🛠 Available Tools

Tool

Description

Parameters

add

Add two numbers together

a (float), b (float)

subtract

Subtract b from a (a - b)

a (float), b (float)

multiply

Multiply two numbers together

a (float), b (float)

divide

Divide a by b (with zero division check)

a (float), b (float)

generate_random_number

Generate a random integer in a range

min_value (int, default: 1), max_value (int, default: 100)


Related MCP server: Math Operations MCP Server

🚀 Running the Remote Server

Option 1: Direct Run (FastMCP Runner)

Runs on all network interfaces (0.0.0.0) by default on port 8000:

uv run python main.py

Option 2: Production ASGI Server (Uvicorn)

The Starlette ASGI application app is exported in main.py:

uv run uvicorn main:app --host 0.0.0.0 --port 8000

Option 3: Using the FastMCP CLI

uv run fastmcp run main.py --transport sse --host 0.0.0.0 --port 8000

⚙️ Configuration (Environment Variables)

Variable

Default

Description

MCP_HOST

0.0.0.0

Host/network interface to bind to

PORT or MCP_PORT

8000

Port number to listen on

MCP_TRANSPORT

sse

Transport protocol: sse or http (streamable HTTP)


🔌 Connecting Remote MCP Clients

  • Endpoint URL: http://<SERVER_IP_OR_DOMAIN>:8000/sse

Example client configuration (e.g., Claude Desktop / Cursor / LibreChat):

{
  "mcpServers": {
    "remote-calculator": {
      "url": "http://your-server-ip:8000/sse"
    }
  }
}

2. Connecting via Streamable HTTP

If using MCP_TRANSPORT=http:

  • Endpoint URL: http://<SERVER_IP_OR_DOMAIN>:8000/mcp

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides basic arithmetic calculation tools through an HTTP-accessible MCP server. Supports mathematical operations like addition with streamable responses for integration with MCP clients.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables performing arithmetic operations (add, subtract, multiply, divide, power, modulo) via natural language through HTTP SSE transport, allowing integration with Claude or other MCP clients for AI-powered calculations.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server that offers basic arithmetic operations (addition, subtraction, multiplication, division) via HTTP.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP clients to perform basic arithmetic operations such as addition, subtraction, multiplication, and division through a remotely hosted HTTP endpoint.
    3 npm
    MIT