aRaafat21/mcp_servers_demo
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.
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 languageslist_supported_languages: List all supported languages for translation
Notes Resource Tools
list_notes: List all notes, optionally filtered by tagget_note: Get a specific note by IDget_note_by_title: Find notes by title (exact or partial match)create_note: Create a new noteupdate_note: Update an existing notedelete_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/outputstreamable-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:
- Translator Prompts: Prompts for translation and language listing tools
- 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: