Hello World MCP Server
A simple example of a Model Context Protocol (MCP) server that demonstrates basic functionality with greeting tools.
Quick Start
Install dependencies:
pip install -r requirements.txtRun the server:
Choose one of three transport methods:
# For MCP clients (Claude Desktop, Cursor) - stdio transport python run_stdio.py # For HTTP/REST API testing with curl python run_http.py # For SSE transport (web clients) python run_sse.pyTest the server:
# Test the tools without a client python test_server.py # Test with HTTP API and curl python run_http.py # Then: curl http://localhost:8000/tools
Related MCP server: MCP Server Basic Example
Features
This server provides:
4 tools for creating and managing greetings
1 resource for greeting templates
1 prompt for generating greetings
Documentation
See how-to-run-mcp.md for detailed instructions on:
Running the server locally
Testing with various methods
Integrating with Claude Desktop
Troubleshooting common issues
Project Structure
Transport Methods
This server can run in three different modes:
stdio transport (
run_stdio.py) - For MCP clients like Claude Desktop and CursorHTTP transport (
run_http.py) - REST API for testing with curl commandsSSE transport (
run_sse.py) - Server-Sent Events for web clients (requires MCP-compatible web client)
Docker Support
Building the Docker Image
Running with Docker
Testing the Dockerized Server
Once running the HTTP transport container:
Development with Docker
Available Tools
say_hello(name) - Basic greeting
get_greeting_info() - Server information
create_custom_greeting(name, type, include_time) - Customized greetings
list_available_greetings() - List greeting types
License
This is an example project for learning MCP.