MCP Server Demo
A demonstration project for building MCP (Model Context Protocol) servers using the Python MCP SDK.
What is MCP?
The Model Context Protocol (MCP) allows applications to provide context for LLMs in a standardized way. This project demonstrates how to:
- Build MCP servers that expose resources, tools, and prompts
- Use the FastMCP framework for rapid development
- Run servers in development mode with hot reloading
Features
This demo server includes:
- Calculator Tools: Basic arithmetic operations
- Greeting Resources: Dynamic personalized greetings
- Code Review Prompts: Reusable templates for code review
- Development Mode: Hot reloading and debugging support
Installation
- Create and activate a virtual environment:
- Install dependencies:
Quick Start
Development Mode (Recommended)
Run the server in development mode with hot reloading:
This will start the MCP Inspector where you can test your server interactively.
Direct Execution
Run the server directly:
Claude Desktop Integration
Install the server in Claude Desktop:
Project Structure
API Reference
Tools
add(a: int, b: int) -> int
: Add two numbersmultiply(a: int, b: int) -> int
: Multiply two numberscalculate_bmi(weight_kg: float, height_m: float) -> float
: Calculate BMI
Resources
greeting://{name}
: Get a personalized greeting for a given nameconfig://app
: Get application configuration
Prompts
review_code
: Template for code review requestsdebug_error
: Template for debugging error messages
Development
The server uses FastMCP which provides:
- Automatic type validation
- Built-in error handling
- Development mode with hot reloading
- Easy integration with Claude Desktop
Learn More
This server cannot be installed
A demonstration MCP server that provides calculator tools for arithmetic operations, personalized greeting resources, and code review prompt templates. Enables users to perform basic math calculations, generate dynamic greetings, and access reusable code review templates through the Model Context Protocol.