mcp_servers_demo

aRaafat21/mcp_servers_demo

3.2

If you are the rightful owner of mcp_servers_demo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A demonstration project for implementing a Model Context Protocol (MCP) server with multiple tools organized in a modular structure.

Tools
9
Resources
0
Prompts
0

MCP Servers Demo

A demonstration project for implementing a Model Context Protocol (MCP) server with multiple tools organized in a modular structure.

Overview

This project showcases how to create an MCP server with tools for various functionalities:

  • A simple echo tool directly in the main module
  • Translation tools in a dedicated module
  • Notes resource management with CRUD operations

The server supports both stdio and streamable-http transports.

Project Structure

mcp_servers_demo/
│
├── main.py                # Main MCP server implementation
├── translator/            # Translator tools module
│   ├── __init__.py        # Module exports
│   └── translator_tool.py # Translator tool implementation
├── resources/             # Resources module
│   ├── __init__.py        # Module exports
│   └── note_resource.py   # Notes resource implementation
├── prompts/               # Prompts module
│   ├── __init__.py        # Module exports
│   ├── note_prompts.py    # Notes resource prompts
│   └── translator_prompts.py # Translator tool prompts
├── pyproject.toml         # Project metadata and dependencies
├── README.md              # This file
├── USAGE.md               # Usage guide with examples
├── RESOURCES.md           # Resources documentation
└── PROMPTS.md             # Prompts documentation

Available Tools

Echo Tool

  • echo: Echoes back the provided message

Translation Tools

  • translate: Translate text between languages
  • list_supported_languages: List all supported languages for translation

Notes Resource Tools

  • list_notes: List all notes, optionally filtered by tag
  • get_note: Get a specific note by ID
  • get_note_by_title: Find notes by title (exact or partial match)
  • create_note: Create a new note
  • update_note: Update an existing note
  • delete_note: Delete a note

Installation

This project uses uv for Python package management.

# Create a virtual environment
uv venv

# Activate the virtual environment
source .venv/bin/activate

# Install dependencies
uv pip install -e .

Running the Server

The server supports multiple transport methods:

stdio transport (default)

uv run main.py

streamable-http transport

MCP_TRANSPORT=streamable-http uv run main.py

Transport Configuration

The transport method is determined by the MCP_TRANSPORT environment variable:

  • stdio: Default transport using standard input/output
  • streamable-http: HTTP-based transport

MCP Resources

This project demonstrates MCP resources with the Notes resource type for storing and retrieving text notes with tags.

See for detailed information about how resources are implemented and used.

MCP Prompts

The project also demonstrates the use of MCP prompts to enhance AI interactions with tools. Prompts provide guidance on how the AI should format requests and responses when using specific tools.

We've implemented prompts for various tools across the project:

  1. Translator Prompts: Prompts for translation and language listing tools
  2. Note Resource Prompts: Prompts for note management operations

See for detailed information about how prompts are implemented and used.

Future Enhancements

  • Integrate with Claude Desktop (already configured)

Development

Follow PEP8 for code style.

Documentation

For more information about MCP, check the official documentation: