providing weather information, air quality data, and timezone utilities using the Open-Meteo API.
A MCP server that provides weather information, air quality data, and timezone utilities by leveraging the Open-Meteo API. It exposes weather-related capabilities as part of the MCP ecosystem and is organized for Python-based tooling and integration.
🛠️ Key Features
Weather data retrieval via Open-Meteo API
Air quality information
Timezone utility support
MCP-compatible server implementation
Python/Python3-oriented tooling and ecosystem
🚀 Use Cases
Retrieve current and forecast weather for a location
Access air quality metrics for environmental monitoring
Convert times between time zones for coordinated MCP workflows
⚡ Developer Benefits
Clear MCP server integration points
Python-friendly structure and dependencies
Reusable components for weather- and air-quality-related MCP tasks
⚠️ Limitations
Based on Open-Meteo data; accuracy depends on external API availability
Details natively exposed depend on the underlying MCP surface for the server
Readme excerpt indicates project scaffolding; exact endpoints may vary with updates
A Model Context Protocol (MCP) server that provides weather information using the Open-Meteo API. This server supports multiple transport modes: standard stdio, HTTP Server-Sent Events (SSE), and the new Streamable HTTP protocol for web-based integration.
Features
Weather & Air Quality
Get current weather information with comprehensive metrics:
Temperature, humidity, dew point
Wind speed, direction, and gusts
Precipitation (rain/snow) and probability
Atmospheric pressure and cloud cover
UV index and visibility
"Feels like" temperature
Sunrise and sunset times (local time at the location)
Get weather data for a date range with hourly details and daily sunrise/sunset times
Get air quality information including:
PM2.5 and PM10 particulate matter
Ozone, nitrogen dioxide, carbon monoxide
Sulfur dioxide, ammonia, dust
Aerosol optical depth
Health advisories and recommendations
Time & Timezone
Get current date/time in any timezone
Convert time between timezones
Get timezone information
Transport Modes
Multiple transport modes:
stdio - Standard MCP for desktop clients (Claude Desktop, etc.)
SSE - Server-Sent Events for web applications
streamable-http - Modern MCP Streamable HTTP protocol with stateful/stateless options
RESTful API endpoints via Starlette integration
Installation
Installing via Smithery
To install Weather MCP Server automatically via Smithery:
The SSE mode runs an HTTP server that provides MCP functionality via Server-Sent Events, making it accessible to web applications.
bash
# Start SSE server on default host/port (0.0.0.0:8080)
python -m mcp_weather_server --mode sse
# Specify custom host and port
python -m mcp_weather_server --mode sse --host localhost --port 3000
# Enable debug mode
python -m mcp_weather_server --mode sse --debug
SSE Endpoints:
GET /sse - SSE endpoint for MCP communication
POST /messages/ - Message endpoint for sending MCP requests
3. Streamable HTTP Mode (Modern MCP Protocol)
The streamable-http mode implements the new MCP Streamable HTTP protocol with a single /mcp endpoint. This mode supports both stateful (default) and stateless operations.
bash
# Start streamable HTTP server on default host/port (0.0.0.0:8080)
python -m mcp_weather_server --mode streamable-http
# Specify custom host and port
python -m mcp_weather_server --mode streamable-http --host localhost --port 3000
# Enable stateless mode (creates fresh transport per request, no session tracking)
python -m mcp_weather_server --mode streamable-http --stateless
# Enable debug mode
python -m mcp_weather_server --mode streamable-http --debug
Streamable HTTP Features:
Stateful mode (default): Maintains session state across requests using session IDs
Stateless mode: Creates fresh transport per request with no session tracking
Single endpoint: All MCP communication happens through /mcp
Modern protocol: Implements the latest MCP Streamable HTTP specification
Streamable HTTP Endpoint:
POST /mcp - Single endpoint for all MCP communication (initialize, tools/list, tools/call, etc.)
Command Line Options:
code
--mode {stdio,sse,streamable-http} Server mode: stdio (default), sse, or streamable-http
--host HOST Host to bind to (HTTP modes only, default: 0.0.0.0)
--port PORT Port to listen on (HTTP modes only, default: 8080)
--stateless Run in stateless mode (streamable-http only)
--debug Enable debug mode
This server does not require an API key. It uses the Open-Meteo API, which is free and open-source.
Usage
This server provides several tools for weather and time-related operations:
Available Tools
Weather Tools
get_current_weather - Get current weather for a city with comprehensive metrics
get_weather_by_datetime_range - Get weather data for a date range with hourly details
get_weather_details - Get detailed weather information as structured JSON data
Air Quality Tools
get_air_quality - Get air quality information with pollutant levels and health advice
get_air_quality_details - Get detailed air quality data as structured JSON
Time & Timezone Tools
get_current_datetime - Get current time in any timezone
get_timezone_info - Get timezone information
convert_time - Convert time between timezones
Tool Details
get_current_weather
Retrieves comprehensive current weather information for a given city with enhanced metrics.
Parameters:
city (string, required): The name of the city (English names only)
Returns: Detailed weather data including:
Temperature and "feels like" temperature
Humidity, dew point
Wind speed, direction (as compass direction), and gusts
Precipitation details (rain/snow) and probability
Atmospheric pressure and cloud cover
UV index with warning levels
Visibility
Example Response:
code
The weather in Tokyo is Mainly clear with a temperature of 22.5°C (feels like 21.0°C),
relative humidity at 65%, and dew point at 15.5°C. Wind is blowing from the NE at 12.5 km/h
with gusts up to 18.5 km/h. Atmospheric pressure is 1013.2 hPa with 25% cloud cover.
UV index is 5.5 (Moderate). Visibility is 10.0 km.
get_weather_by_datetime_range
Retrieves hourly weather information with comprehensive metrics for a specified city between start and end dates.
Parameters:
city (string, required): The name of the city (English names only)
start_date (string, required): Start date in format YYYY-MM-DD (ISO 8601)
end_date (string, required): End date in format YYYY-MM-DD (ISO 8601)
[Analysis of weather trends over 2024-01-01 to 2024-01-07]
- Temperature ranges from 5°C to 15°C
- Precipitation expected on Jan 3rd and 5th (60% probability)
- Wind speeds averaging 15 km/h from SW direction
- UV index moderate (3-5) throughout the period
- Recommendation: Umbrella needed for midweek
get_weather_details
Get detailed weather information for a specified city as structured JSON data for programmatic use.
Parameters:
city (string, required): The name of the city (English names only)
Returns: Raw JSON data with all weather metrics suitable for processing and analysis
get_air_quality
Get current air quality information for a specified city with pollutant levels and health advisories.
Parameters:
city (string, required): The name of the city (English names only)
variables (array, optional): Specific pollutants to retrieve. Options:
pm10 - Particulate matter ≤10μm
pm2_5 - Particulate matter ≤2.5μm
carbon_monoxide - CO levels
nitrogen_dioxide - NO2 levels
ozone - O3 levels
sulphur_dioxide - SO2 levels
ammonia - NH3 levels
dust - Dust particle levels
aerosol_optical_depth - Atmospheric turbidity
Returns: Comprehensive air quality report including:
Current pollutant levels with units
Air quality classification (Good/Moderate/Unhealthy/Hazardous)
Health recommendations for general population
Specific warnings for sensitive groups
Comparison with WHO and EPA standards
Example Response:
code
Air quality in Beijing (lat: 39.90, lon: 116.41):
PM2.5: 45.3 μg/m³ (Unhealthy for Sensitive Groups)
PM10: 89.2 μg/m³ (Moderate)
Ozone (O3): 52.1 μg/m³
Nitrogen Dioxide (NO2): 38.5 μg/m³
Carbon Monoxide (CO): 420.0 μg/m³
Health Advice: Sensitive groups (children, elderly, people with respiratory conditions)
should limit outdoor activities.
get_air_quality_details
Get detailed air quality information as structured JSON data for programmatic analysis.
Parameters:
city (string, required): The name of the city (English names only)
variables (array, optional): Specific pollutants to retrieve (same options as get_air_quality)
Returns: Raw JSON data with complete air quality metrics and hourly data
get_current_datetime
Retrieves the current time in a specified timezone.
Parameters:
timezone_name (string, required): IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use UTC if no timezone provided.
Returns: Current date and time in the specified timezone
The project is available as a Docker image on Docker Hub and includes configurations for easy deployment.
Quick Start with Docker Hub
Pull and run the latest image directly from Docker Hub:
bash
# Pull the latest image
docker pull dog830228/mcp_weather_server:latest
# Run in stdio mode (default)
docker run dog830228/mcp_weather_server:latest
# Run in SSE mode on port 8080
docker run -p 8080:8080 dog830228/mcp_weather_server:latest --mode sse
# Run in streamable-http mode on port 8080
docker run -p 8080:8080 dog830228/mcp_weather_server:latest --mode streamable-http
# Pull a specific version
docker pull dog830228/mcp_weather_server:0.5.0
docker run -p 8080:8080 dog830228/mcp_weather_server:0.5.0 --mode sse
Images are automatically built and published when new versions are released.
Building from Source
If you want to build the Docker image yourself:
Standard Build
bash
# Build
docker build -t mcp-weather-server:sse .
# Run (port will be read from PORT env var, defaults to 8081)
docker run -p 8081:8081 mcp-weather-server:sse
# Run with custom port
docker run -p 8080:8080 mcp-weather-server:local --mode sse
Streamable HTTP Build
bash
# Build using streamable-http Dockerfile
docker build -f Dockerfile.streamable-http -t mcp-weather-server:streamable-http .
# Run in stateful mode
docker run -p 8080:8080 mcp-weather-server:streamable-http
# Run in stateless mode
docker run -p 8080:8080 -e STATELESS=true mcp-weather-server:streamable-http
Development
Project Structure
code
mcp_weather_server/
├── src/
│ └── mcp_weather_server/
│ ├── __init__.py
│ ├── __main__.py # Main MCP server entry point
│ ├── server.py # Unified server (stdio, SSE, streamable-http)
│ ├── utils.py # Utility functions
│ └── tools/ # Tool implementations
│ ├── __init__.py
│ ├── toolhandler.py # Base tool handler
│ ├── tools_weather.py # Weather-related tools
│ ├── tools_time.py # Time-related tools
│ ├── tools_air_quality.py # Air quality tools
│ ├── weather_service.py # Weather API service
│ └── air_quality_service.py # Air quality API service
├── tests/
├── Dockerfile # Docker configuration for SSE mode
├── Dockerfile.streamable-http # Docker configuration for streamable-http mode
├── pyproject.toml
├── requirements.txt
└── README.md
Running for Development
Standard MCP Mode (stdio)
bash
# From project root
python -m mcp_weather_server
# Or with PYTHONPATHexport PYTHONPATH="/path/to/mcp_weather_server/src"
python -m mcp_weather_server