Skip to main content
Glama

MCP Server Demo

by bollam1818

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

  1. Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Quick Start

Run the server in development mode with hot reloading:

mcp dev server.py

This will start the MCP Inspector where you can test your server interactively.

Direct Execution

Run the server directly:

python server.py

Claude Desktop Integration

Install the server in Claude Desktop:

mcp install server.py

Project Structure

mcp-server/ ├── server.py # Main MCP server implementation ├── requirements.txt # Python dependencies ├── pyproject.toml # Project configuration ├── run_dev.py # Development runner script └── README.md # This file

API Reference

Tools

  • add(a: int, b: int) -> int: Add two numbers
  • multiply(a: int, b: int) -> int: Multiply two numbers
  • calculate_bmi(weight_kg: float, height_m: float) -> float: Calculate BMI

Resources

  • greeting://{name}: Get a personalized greeting for a given name
  • config://app: Get application configuration

Prompts

  • review_code: Template for code review requests
  • debug_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

-
security - not tested
F
license - not found
-
quality - not tested

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.

  1. What is MCP?
    1. Features
      1. Installation
        1. Quick Start
          1. Development Mode (Recommended)
          2. Direct Execution
          3. Claude Desktop Integration
        2. Project Structure
          1. API Reference
            1. Tools
            2. Resources
            3. Prompts
          2. Development
            1. Learn More

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/bollam1818/MCPServer'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server