home / mcp / weather mcp server
A Model Context Protocol (MCP) server that provides weather information using the Open-Meteo API.
Configuration
View docs{
"mcpServers": {
"isdaniel-mcp_weather_server": {
"command": "python",
"args": [
"-m",
"mcp_weather_server.server",
"--mode",
"stdio"
]
}
}
}You can run a Weather MCP Server locally or in a web context to fetch current weather, forecasts, and air quality data via Open-Meteo. It supports multiple transport modes (stdio for desktop MCP clients, SSE for web apps, and streamable-http for modern web integrations) so you can plug weather insights into desktop tools, dashboards, or web services with a single server.
Choose a transport mode that fits your workflow. For desktop MCP clients, run in stdio mode. For web apps, run SSE or streamable-http mode and connect through the appropriate endpoints. The server exposes reliable weather and air quality tools, time utilities, and timezone conversions so you can build interactive weather experiences across platforms.
- In stdio mode you interact through standard I/O streams, suitable for desktop clients. - In SSE mode you connect to an HTTP SSE endpoint to receive streaming MCP messages, and you send requests via a dedicated messages endpoint. - In streamable-http mode all MCP communication happens through a single HTTP endpoint, with optional stateful or stateless transport depending on your needs.
Start in stdio mode from the server package by running the following command to use the native MCP entry point for standard desktop clients.
python -m mcp_weather_server.server --mode stdioIf you choose web integration, run the server in SSE or streamable-http mode and connect through the HTTP endpoints. SSE provides a streaming channel for MCP messages, while the streamable HTTP mode uses a single /mcp endpoint for all MCP interactions.
SSE usage overview: start the server in SSE mode, then connect to the /sse endpoint and post requests to /messages/ to issue MCP tool calls.
Streamable HTTP usage overview: start the server in streamable-http mode and post all MCP interactions to the /mcp endpoint.
# Start SSE server (default host/port)
python -m mcp_weather_server --mode sse
# Start SSE server on a custom host/port
python -m mcp_weather_server --mode sse --host localhost --port 3000
# Start streamable-http server (default)
python -m mcp_weather_server --mode streamable-http
# Start streamable-http server with stateless transport
python -m mcp_weather_server --mode streamable-http --statelessThis Weather MCP Server does not require an API key. It relies on free Open-Meteo data and local transport channels. When exposing the server to the internet, ensure your host firewall allows only desired ports and consider network-layer authentication for web modes.
Retrieve current weather for a city with comprehensive metrics such as temperature, humidity, wind, precipitation, UV index, and visibility.
Fetch weather data for a city over a date range with hourly details, including temperature trends and precipitation probabilities.
Return detailed weather information for a city as structured JSON for programmatic use.
Provide current air quality for a city with pollutant levels and health advisories.
Return detailed air quality data as structured JSON for programmatic use.
Return the current date and time in a specified timezone.
Provide timezone information including offset and DST data.
Convert a given time from one timezone to another.