home / mcp / weather mcp server

Weather MCP Server

A Model Context Protocol (MCP) server that provides weather information using the Open-Meteo API.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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 stdio

HTTP SSE and Streamable HTTP endpoints

If 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 --stateless

Security and access notes

This 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.

Available tools

get_current_weather

Retrieve current weather for a city with comprehensive metrics such as temperature, humidity, wind, precipitation, UV index, and visibility.

get_weather_by_datetime_range

Fetch weather data for a city over a date range with hourly details, including temperature trends and precipitation probabilities.

get_weather_details

Return detailed weather information for a city as structured JSON for programmatic use.

get_air_quality

Provide current air quality for a city with pollutant levels and health advisories.

get_air_quality_details

Return detailed air quality data as structured JSON for programmatic use.

get_current_datetime

Return the current date and time in a specified timezone.

get_timezone_info

Provide timezone information including offset and DST data.

convert_time

Convert a given time from one timezone to another.