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:
- Install dependencies:
- Run in development mode:
- Run tests:
- Deactivate virtual environment when done:
Without Virtual Environment (Not Recommended)
- Install dependencies:
- Run in development mode:
- Run tests:
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:
- Run the container:
- With custom environment:
Docker Compose
- Basic deployment:
- With production nginx proxy:
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
- AsecurityAlicenseAqualityA TypeScript-based MCP server that provides simulated weather data including current conditions, forecasts, alerts, and location search functionality through both MCP protocol and HTTP API endpoints.Last updated -591JavaScriptMIT License
- -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 -Python
- -securityFlicense-qualityA modular server based on Model Context Protocol (MCP) that provides weather queries, mathematical calculations, and search functionalities.Last updated -TypeScript
- -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 -Python