Claude Arithmetic MCP Server
README.md
Claude Arithmetic MCP Server
A simple Model Context Protocol (MCP) project built with Python andFastMCP. The server exposes basic arithmetic operations as MCP tools andcan be used locally with Claude Desktop or deployed as a remote MCPserver.
Project Overview
This project demonstrates the basic MCP client-server architecture:
Claude Desktop
|
| MCP
v
Arithmetic MCP Server
|
+-- add()
+-- subtract()
+-- multiply()
+-- divide()
The server was tested using MCP Inspector and deployed remotely usingPrefect Horizon.
Features
Addition
Subtraction
Multiplication
Division
MCP tool registration using FastMCP
Local testing with MCP Inspector
Claude Desktop integration
Remote deployment through Prefect Horizon
Tech Stack
Python
MCP
FastMCP
MCP Inspector
Claude Desktop
Prefect Horizon
Git & GitHub
MCP Tools
Tool Description
add Adds two numberssubtract Subtracts the second number from the firstmultiply Multiplies two numbersdivide Divides the first number by the second
The divide tool also handles division by zero.
Project Structure
MCP-Client-Server-Integration/
│
├── server.py
├── fastmcp.json
├── pyproject.toml
├── uv.lock
├── README.md
├── .gitignore
└── src/
Running Locally
Create and activate a virtual environment, then install the projectdependencies.
Run the MCP server:
fastmcp run server.py
The server uses the MCP stdio transport for local client connections.
Testing with MCP Inspector
The server can be inspected with FastMCP:
fastmcp inspect server.py
MCP Inspector can also be used to connect to the server and test theregistered tools.
Claude Desktop
The server can be connected to Claude Desktop as an MCP server.
Claude Desktop acts as the MCP client and can discover and invoke thearithmetic tools when required.
Example:
User: Calculate 25 × 8
Claude Desktop
|
v
multiply(a=25, b=8)
|
v
200
Remote Deployment
The MCP server was deployed using Prefect Horizon.
Remote MCP endpoint:
https://claude-arithmetic-mcp.fastmcp.app/mcp
The deployed server provides the same four arithmetic tools through aremote MCP endpoint.
What I Learned
Basic MCP architecture and client-server communication
How to create and register MCP tools with FastMCP
How MCP clients discover and call tools
Testing MCP servers with MCP Inspector
Connecting an MCP server with Claude Desktop
Deploying a remote MCP serverThis server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessNo issues