Weather MCP Server
mcp-name: io.github.isdaniel/mcp_weather_server
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
- Get weather data for a date range with hourly details
- 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:
npx -y @smithery/cli install @isdaniel/mcp_weather_serverStandard Installation (for MCP clients like Claude Desktop)
This package can be installed using pip:
pip install mcp_weather_serverManual Configuration for MCP Clients
This server is designed to be installed manually by adding its configuration to the cline_mcp_settings.json file.
- Add the following entry to the
mcpServersobject in yourcline_mcp_settings.jsonfile:
{
"mcpServers": {
"weather": {
"command": "python",
"args": [
"-m",
"mcp_weather_server"
],
"disabled": false,
"autoApprove": []
}
}
}- Save the
cline_mcp_settings.jsonfile.
HTTP Server Installation (for web applications)
For HTTP SSE or Streamable HTTP support, you'll need additional dependencies:
pip install mcp_weather_server starlette uvicornServer Modes
This MCP server supports stdio, SSE, and streamable-http modes in a single unified server:
Mode Comparison
| Feature | stdio | SSE | streamable-http |
|---|---|---|---|
| Use Case | Desktop MCP clients | Web applications (legacy) | Web applications (modern) |
| Protocol | Standard I/O streams | Server-Sent Events | MCP Streamable HTTP |
| Session Management | N/A | Stateful | Stateful or Stateless |
| Endpoints | N/A | /sse, /messages/ | /mcp (single) |
| Best For | Claude Desktop, Cline | Browser-based apps | Modern web apps, APIs |
| State Options | N/A | Stateful only | Stateful or Stateless |
1. Standard MCP Mode (Default)
The standard mode communicates via stdio and is compatible with MCP clients like Claude Desktop.
# Default mode (stdio)
python -m mcp_weather_server
# Explicitly specify stdio mode
python -m mcp_weather_server.server --mode stdio2. HTTP SSE Mode (Web Applications)
The SSE mode runs an HTTP server that provides MCP functionality via Server-Sent Events, making it accessible to web applications.
# 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 --debugSSE Endpoints:
GET /sse- SSE endpoint for MCP communicationPOST /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.
# 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 --debugStreamable 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:
--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 modeExample SSE Usage:
// Connect to SSE endpoint
const eventSource = new EventSource('http://localhost:8080/sse');
// Send MCP tool request
fetch('http://localhost:8080/messages/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
type: 'tool_call',
tool: 'get_weather',
arguments: { city: 'Tokyo' }
})
});Example Streamable HTTP Usage:
// Initialize session and call tool using Streamable HTTP protocol
async function callWeatherTool() {
const response = await fetch('http://localhost:8080/mcp', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'tools/call',
params: {
name: 'get_current_weather',
arguments: { city: 'Tokyo' }
},
id: 1
})
});
const result = await response.json();
console.log(result);
}Configuration
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 metricsget_weather_by_datetime_range- Get weather data for a date range with hourly detailsget_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 adviceget_air_quality_details- Get detailed air quality data as structured JSON
Time & Timezone Tools
get_current_datetime- Get current time in any timezoneget_timezone_info- Get timezone informationconvert_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:
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)
Returns: Comprehensive weather analysis including:
- Hourly weather data with all enhanced metrics
- Temperature trends (highs, lows, averages)
- Precipitation patterns and probabilities
- Wind conditions assessment
- UV index trends
- Weather warnings and recommendations
Example Response:
[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 midweekget_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μmpm2_5- Particulate matter ≤2.5μmcarbon_monoxide- CO levelsnitrogen_dioxide- NO2 levelsozone- O3 levelssulphur_dioxide- SO2 levelsammonia- NH3 levelsdust- Dust particle levelsaerosol_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:
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
…