home / mcp / weather mcp server

Weather MCP Server

Provides weather data from multiple sources and offers tools for current conditions, forecasts, air quality, METAR, astronomy, and source health.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "koneisto-mcp-weather": {
      "url": "http://localhost:3015",
      "headers": {
        "WEATHERAPI_KEY": "<WEATHERAPI_KEY>",
        "HTTP_TIMEOUT_MS": "<HTTP_TIMEOUT_MS>",
        "CACHE_MAX_ENTRIES": "<CACHE_MAX_ENTRIES>",
        "CACHE_TTL_MINUTES": "<CACHE_TTL_MINUTES>",
        "TOMORROW_IO_API_KEY": "<TOMORROW_IO_API_KEY>",
        "OPENWEATHERMAP_API_KEY": "<OPENWEATHERMAP_API_KEY>"
      }
    }
  }
}

You run a weather-focused MCP server that aggregates data from multiple sources for European and Nordic/Baltic locations. It offers zero-config start with key sources available out of the box and unlocks more data by adding optional API keys. You can query current conditions, forecasts, air quality, aviation weather (METAR), astronomy data, and monitor the health of each source, with smart caching to speed up repeated requests.

How to use

You connect your MCP client to the weather MCP server to request current conditions, forecasts, air quality, aviation weather, and astronomy information. The server automatically aggregates data from multiple sources when possible, giving you merged results for more complete and accurate answers.

How to install

Prerequisites: You need Node.js (including npm) installed on your system. You may also run this via Docker if you prefer containerized deployment.

Step by step installation and run options are shown below. Pick the approach you prefer and follow the exact commands.

# Option 1: Docker (recommended for quickest start)
git clone https://github.com/Koneisto/mcp-weather.git
cd mcp-weather
cp .env.example .env          # optionally add API keys
npm install && npm run build  # build TypeScript
docker compose up -d
```

The server will be accessible at http://localhost:3015 via the Streamable HTTP transport.

```bash
# Option 2: Local development (stdio transport)
git clone https://github.com/Koneisto/mcp-weather.git
cd mcp-weather
npm install
npm run build
node build/index.js           # runs on stdio transport
```

If you want to run from a client configuration, you can use the following example that runs the MCP server via Node and builds the index locally. It shows how to set API key placeholders for optional sources.

Configuration and environment

All settings are controlled via environment variables. Copy the example to your environment file and customize keys for optional sources.

The following environment variables are shown for enabling API keys and tuning cache behavior.

OPENWEATHERMAP_API_KEY=
WEATHERAPI_KEY=
TOMORROW_IO_API_KEY=
CACHE_TTL_MINUTES=60
CACHE_MAX_ENTRIES=200
HTTP_TIMEOUT_MS=10000
```

OpenWeatherMap, WeatherAPI, and Tomorrow.io keys are optional. Open-Meteo, wttr.in, and METAR do not require keys.

Using API keys with MCP client configuration

If you need to enable additional data sources that require keys, you can supply the keys when starting the server or via your MCP client configuration.

Example client integration shows how to embed the server in your MCP client setup. The following snippet demonstrates a client configuration that runs the weather MCP server as a local process.

Other important notes

  • The server includes six MCP tools: current weather, forecast, air quality, aviation METAR, astronomy, and source status.
  • Nordic and Finnish city aliasing speeds up location input (e.g., hki, tre, stadi).
  • Multi-source aggregation merges data from all available providers for more complete results.
  • Zero-config start for core sources (Open-Meteo, wttr.in, METAR).
  • Smart caching with an LRU strategy reduces repeated loads and prevents cache stampede.

Available tools

get_current_weather

Current conditions from up to 5 sources, merged into one result

get_weather_forecast

1-7 day daily forecast (temperature, precipitation, wind, UV)

get_air_quality

European AQI with PM2.5, PM10, NO2, O3, SO2, CO levels

get_metar

Aviation weather (raw + decoded) from aviationweather.gov

get_astronomy

Sunrise, sunset, day length, moon phase and illumination

get_weather_source_status

Health check for all sources + cache statistics