A simple calculator app using Model Context protocol
@KeerthiNingegowda
A simple calculator app with MCP compliant server and client
Overview
What is A simple calculator app using Model Context protocol?
A minimal calculator server and client built with FastMCP to explore the Model Context Protocol (MCP) and tool calling. It supports basic arithmetic operations (add, subtract, multiply, divide, modulo) and is intended for developers learning MCP fundamentals.
How to use A simple calculator app using Model Context protocol?
Install dependencies with uv sync, then activate the environment with source .venv/bin/activate. To inspect the server, navigate to the fastmcp_calculator_server folder and run mcp dev server.py. To run the full MCP application, go to mcp_calculator/mcp_compliant_client and run python client.py <path to server.py>. A valid Anthropic API key must be set in a .env file.
Key features of A simple calculator app using Model Context protocol
- Supports addition, subtraction, multiplication, division, and modulo.
- Built using FastMCP for simplicity and automatic error handling.
- Includes a debugging interface via MCP Inspector.
- Provides a minimal MCP client that takes user queries for calculations.
- Designed for exploring tool calling without external IDE dependencies.
Use cases of A simple calculator app using Model Context protocol
- Learning how to build and run an MCP server from scratch.
- Understanding how MCP tool calls are made and returned.
- Testing arithmetic with different number formats (e.g., "add 2 and 3" vs "add two and three").
- Exploring sequential tool calling and input validation in future iterations.
FAQ from A simple calculator app using Model Context protocol
What arithmetic operations does the server support?
The server supports addition, subtraction, multiplication, division, and modulo.
How do I run the server and client?
First install dependencies with uv sync and activate the virtual environment. To inspect the server, run mcp dev server.py inside the fastmcp_calculator_server folder. To run the full app, execute python client.py <path to server.py> from the mcp_calculator/mcp_compliant_client folder.
What are the runtime requirements?
The project requires Python, uv, FastMCP, and an Anthropic API key stored in a .env file. The MCP client needs access to an LLM (Anthropic).
Does the server store chat history?
No. The README explicitly notes that storing previous chat history is not supported to keep the implementation simple.
What known limitations exist?
Annotations in FastMCP are not supported in the version specified by the lock file. Input validation by server or client is not implemented. Some newer MCP features may be unavailable or buggy due to the early stage of the technologies used.