Used as the HTTP client for examples and testing in the MCP server, enabling streamable HTTP transport instead of stdio for better accessibility.
Provides comprehensive Docker support for deploying the MCP server with multi-stage builds, health checks, and production-ready orchestration with logging and resource management.
Used for request/response validation in the MCP server, ensuring type safety when processing tool calls and generating responses.
Integrated for running comprehensive test suites against the MCP server, including coverage reporting.
The primary language for implementing the MCP server, requiring version 3.8 or higher.
Integrated for code linting in the development workflow, with auto-fix capabilities for addressing linting issues.
Used as the base image (Ubuntu 24.04 LTS) for the Docker container deployment, providing stability for the production environment.
MCP Hello World Server
A simple Hello World MCP (Model Context Protocol) server built with the FastMCP framework in Python using HTTP transport.
Features
- Multi-language greetings: Say hello in 10 different languages
- Server information: Get details about the server capabilities
- Resource serving: Access hello world resources
- HTTP transport: Uses streamable HTTP instead of stdio for better accessibility
- FastMCP framework: Built on the modern FastMCP framework
- Type safety: Uses Pydantic for request/response validation
- Testing: Includes comprehensive test suite
Installation
Prerequisites
- Python 3.8 or higher
- pip package manager
Install dependencies
Using uv (Recommended)
Using pip (Alternative)
Usage
Running the Server
Using Docker (Recommended for Production)
Using uv (Development)
Using pip installation
Accessing the HTTP Server
Once running, the server will be available at:
- Default:
http://0.0.0.0:8000
- Local access:
http://localhost:8000
- Custom: Set
MCP_HOST
andMCP_PORT
environment variables
Available Tools
1. say_hello
Generate greetings in different languages.
Parameters:
name
(str, optional): Name to greet (default: "World")language
(str, optional): Language code (default: "en")
Supported languages:
en
- Englishes
- Spanishfr
- Frenchde
- Germanit
- Italianpt
- Portugueseru
- Russianja
- Japaneseko
- Koreanzh
- Chinese
Example:
Response:
2. get_server_info
Get information about the server capabilities.
Parameters: None
Response:
Available Resources
1. file://hello-world
A simple hello world message resource.
2. file://server-status
Current server status and available tools/resources.
Development
Project Structure
Running Tests
Using uv (Recommended)
Using pip installation
Code Formatting
Using uv (Recommended)
Using pip installation
Example Client Usage
HTTP Client Example
The project includes an HTTP client example that demonstrates how to interact with the MCP server over HTTP:
Using uv (Recommended)
Using pip installation
Original Client Example
See mcp_hello/client_example.py
for a conceptual demonstration of MCP interactions:
Using uv (Recommended)
Using pip installation
Configuration
The project uses pyproject.toml
for configuration:
- Build system: Hatchling
- Dependencies: FastMCP, Pydantic, and aiohttp
- Development tools: pytest, black, ruff (configured for uv)
- Entry point:
mcp-hello
command - Virtual environment: Managed by uv
- Transport: HTTP (streamable) instead of stdio
Environment Variables
The server supports the following environment variables:
MCP_HOST
: Server host address (default:0.0.0.0
)MCP_PORT
: Server port number (default:8000
)
Example:
Make Commands
The project includes a Makefile with commands for both local development and Docker:
Local Development Commands
Docker Commands
Docker Configuration
The project includes comprehensive Docker support:
- Multi-stage build: Optimized for production with separate build and runtime stages
- Ubuntu 24.04 base: Latest LTS Ubuntu for stability
- uv integration: Fast dependency installation during build
- Security: Non-root user, read-only filesystem, resource limits
- Health checks: Automatic container health monitoring
- docker-compose: Production-ready orchestration with logging and resource management
Requirements
For Local Development
- Python: 3.8 or higher
- uv: Fast Python package installer and resolver (recommended)
- Core dependencies:
fastmcp>=0.1.0
- FastMCP framework for building MCP serverspydantic>=2.0.0
- Data validation and settings managementaiohttp>=3.8.0
- HTTP client for examples and testing
For Docker Deployment
- Docker: 20.10 or higher
- docker-compose: 2.0 or higher (for orchestration)
- Operating System: Ubuntu 24.04 LTS (container base image)
Contributing
Using uv (Recommended for Local Development)
- Fork the repository
- Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Create virtual environment:
uv sync --dev
- Create a feature branch
- Make your changes
- Run tests:
make test
oruv run pytest
- Format code:
make format
oruv run black .
- Test Docker build:
make docker-build
- Submit a pull request
Using Docker (Testing Production Build)
- Fork the repository
- Create a feature branch
- Make your changes
- Build and test with Docker:
make docker-build && make docker-run
- Check logs:
make docker-logs
- Stop container:
make docker-stop
- Submit a pull request
Using pip (Alternative)
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
pytest
- Format code:
black .
- Submit a pull request
License
This project is licensed under the terms specified in the LICENSE file.
This server cannot be installed
A simple MCP server that generates multi-language greetings and provides server information using the FastMCP framework.
Related MCP Servers
- AsecurityFlicenseAqualityA server that enables communication with multiple unichat-based MCP servers simultaneously, allowing users to query different language models and combine their responses for more comprehensive results.Last updated -2JavaScript
- -securityFlicense-qualityA simple MCP server implementation that demonstrates streaming capabilities with tools for greetings and notifications, accessible through an interactive command-line client.Last updated -1TypeScript
- -securityFlicense-qualityA feature-rich Model Context Protocol server built with FastMCP that provides various tools including basic utilities, network services, file operations, encryption tools, and system information functions.Last updated -Python
- -securityAlicense-qualityA simple demonstration MCP server that provides a greeting functionality when integrated with Gemini CLI.Last updated -PythonMIT License