Container MCP Server
A Model Context Protocol (MCP) server designed for containerized deployment with HTTP transport. This server provides simple, dependency-free tools and prompts that can be used by MCP clients via streamable HTTP transport.
Features
HTTP Transport: Uses streamable HTTP transport for remote MCP server deployment
Container Ready: Optimized for Docker/Kubernetes deployment with health checks
Simple Tools: Weather data, mathematical calculations, and context-aware operations
Prompts: Reusable templates for weather reports and calculations
No External Dependencies: Mock data for easy testing and demonstration
Tools
1. get_weather
Get mock weather information for a city.
Parameters:
city
(string, optional): City name (default: "San Francisco")
Returns: Weather data including temperature, condition, and humidity
2. sum_numbers
Add two numbers together.
Parameters:
a
(float): First numberb
(float): Second number
Returns: The sum of the two numbers
3. context_info
Demonstrate MCP context capabilities including logging, progress reporting, and metadata access.
Parameters:
message
(string): A message to processctx
(Context): MCP Context object (automatically injected)
Returns: Information about the context and processing
Prompts
1. weather_report
Generate weather report prompts for specified cities.
Arguments:
city
(string): City name for the weather reportformat
(string): Report format ("brief", "detailed", or "forecast")
2. calculation_helper
Generate prompts for mathematical calculations.
Arguments:
operation
(string): Type of mathematical operationcontext
(string): Additional context for the calculation
Installation & Development
Using Virtual Environment (Recommended)
Create and activate virtual environment:
# Create virtual environment python -m venv venv # Activate virtual environment # On Unix/macOS: source venv/bin/activate # On Windows: # venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtRun in development mode:
python -m src.server --port 8000 --log-level DEBUGRun tests:
pytestDeactivate virtual environment when done:
deactivate
Without Virtual Environment (Not Recommended)
Install dependencies:
pip install -r requirements.txtRun in development mode:
python -m src.server --port 8000 --log-level DEBUGRun tests:
pytest
Direct Execution
The server supports direct execution for development and testing:
Command-line options:
--port
: Port to run the server on (default: 8000)--log-level
: Logging level (default: INFO)--json-response
: Use JSON responses instead of SSE streams
Container Deployment
Docker
Build the container:
docker build -t mcp-server .Run the container:
docker run -p 8000:8000 mcp-serverWith custom environment:
docker run -p 8000:8000 -e LOG_LEVEL=DEBUG mcp-server
Docker Compose
Basic deployment:
docker-compose upWith production nginx proxy:
docker-compose --profile production up
Kubernetes
Example deployment:
API Endpoints
Health Check
URL:
GET /health
Response: Server health status and metadata
Use: Container orchestration health checks
Server Info
URL:
GET /
Response: Server information, available tools, and prompts
Use: Discovery and documentation
MCP Endpoint
URL:
POST /mcp
Protocol: MCP over HTTP (JSON-RPC 2.0)
Transport: Streamable HTTP with SSE support
Use: MCP client connections
Connection Details
For MCP Clients
Server URL: http://localhost:8000/mcp
Transport: Streamable HTTP
Authentication: None (can be extended)
Example Client Connection (Python)
Testing
Unit Tests
Integration Tests
Container Tests
Monitoring
Health Checks
The server provides a /health
endpoint that returns:
Server status
Tool and prompt counts
Transport information
Logging
Structured logging with configurable levels:
Metrics
For production deployments, consider adding:
Prometheus metrics endpoint
OpenTelemetry tracing
Request/response logging
Architecture
Security Considerations
The server runs as a non-root user in containers
No secrets or API keys are required for basic functionality
Consider adding authentication for production deployments
Network policies should restrict access to necessary ports only
Contributing
Fork the repository
Create a feature branch
Make changes with tests
Run the test suite
Submit a pull request
License
This project is available under the MIT License.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables weather lookups, mathematical calculations, and context-aware operations through a containerized MCP server with HTTP transport. Optimized for Docker/Kubernetes deployment with health checks and no external dependencies.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol (MCP) server that enables AI assistants and LLMs to access real-time weather data and forecasts by connecting to the OpenWeatherMap API.Last updated -
- -securityFlicense-qualityA modular server based on Model Context Protocol (MCP) that provides weather queries, mathematical calculations, and search functionalities.Last updated -
- -securityFlicense-qualityA Python-based MCP (Model Context Protocol) server that enables weather alerts and conversational AI interactions, with Docker support for easy deployment.Last updated -
- -securityFlicense-qualityDemonstrates custom MCP servers for math and weather operations, enabling multi-agent orchestration using LangChain, Groq, and MCP adapters for both local and remote tool integration.Last updated -1