weather-stations
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Open Weather Stations
A zero-dependency directory of publicly licensed weather & METAR stations with a typed JS API, CLI, REST/OpenAPI server, MCP server for AI agents, and a Python client. Station metadata ships offline; live observations come straight from official public feeds and always fall back gracefully to a bundled sample.
Explorer: https://shadojus.github.io/open-weather-stations/ (interactive world map, wind compass, live METAR).
Zero runtime dependencies – Node ≥ 22.5 (
node:sqlite,node:http,node:test), Python ≥ 3.9 stdlib only.Offline-first – a curated catalog (
data/seed.json, ~130 stations) is bundled; build an indexed SQLite DB on demand.Honest sourcing – every source carries license + attribution (
data/SOURCES.json); live fetches are HTTPS-only against a strict host allowlist.Four surfaces – library, CLI, HTTP/OpenAPI 3.1, MCP (stdio).
Quick start
npx @shadojus/open-weather-stations near 48.35 11.79 --radius 50
npx @shadojus/open-weather-stations station EDDM --live
npx @shadojus/open-weather-stations search munich --json
npx @shadojus/open-weather-stations sources
npx @shadojus/open-weather-stations serve --port 8787CLI
Command | Description |
| Nearest stations first, with |
| Metadata + latest observation (id, ICAO or WMO) |
| Ranked text search |
| Upstream sources, licenses, attribution |
| Start the REST server |
| Start the MCP server on stdio |
Global flags: --json (machine output), --live (query upstream; falls back to sample), --db <file> (SQLite backend), -h, -v.
Exit codes: 0 ok, 1 not found / runtime error, 2 usage error.
Library
import { createWeatherStations, stationsNear, getLatestObservation } from "@shadojus/open-weather-stations";
const near = stationsNear(48.35, 11.79, { radiusKm: 50 }); // [{ stationId: "EDDM", distanceKm: 0.51, … }]
const obs = await getLatestObservation("EDDM", { live: true }); // { isLive: true, … } or { fallback: true, … }
const ws = createWeatherStations({ dbPath: "data/stations.sqlite" }); // optional SQLite backendTypes are included (src/index.d.ts). Parsers (parseMetarText, parseMetarObservation, parseDwdPoiCsv) are exported too.
REST server
npx @shadojus/open-weather-stations serve
curl 'http://localhost:8787/v1/stations/near?lat=48.35&lng=11.79&radiusKm=50'Route | Description |
| Liveness + backend + station count |
| OpenAPI 3.1.0 document |
| Sources, licenses, attribution |
| Search |
| Proximity |
| Station by id / ICAO / WMO |
| Latest observation (sample, or live with fallback) |
Behaviour: CORS *, SHA-256 ETag with conditional 304, Cache-Control: public, max-age=60 (live responses no-store), per-client rate limiting (default 120 req/min; IPv6 clients share a budget per /64) with 429 + Retry-After, errors as { "error": { "code", "message" } }. Binds to 127.0.0.1 by default; use --host 0.0.0.0 (and --trust-proxy behind a reverse proxy) to expose it.
MCP (AI agents)
{
"mcpServers": {
"weather-stations": { "command": "npx", "args": ["-y", "@shadojus/open-weather-stations", "--mcp"] }
}
}JSON-RPC 2.0 over stdio (protocolVersion: "2024-11-05"). Tools: search_stations, stations_near, get_station, latest_observation, list_sources.
Python
pip install shadojus-weather-stations # stdlib only, Python >= 3.9from shadojus_weather_stations import WeatherStations
ws = WeatherStations()
ws.near(48.35, 11.79, radius_km=50)
ws.latest("EDDM", live=True)CLI: shadojus-weather-stations near 48.35 11.79 --json. See python/.
Related MCP server: weather_mcp
Data sources & licensing
Source | Coverage | License | Live |
NOAA/NWS Aviation Weather Center (METAR) | Global | Public domain | yes |
Deutscher Wetterdienst (DWD) Open Data | DE | CC BY 4.0 | yes |
NOAA NCEI GHCNh / ISD | Global | Public domain | catalog only |
GeoSphere Austria TAWES | AT | CC BY 4.0 | yes |
MET Norway | NO | CC BY 4.0 | yes |
MeteoSwiss SwissMetNet | CH | CC BY 4.0 | catalog only |
When you redistribute observations from CC BY sources, keep the attribution string from GET /v1/sources. Live requests identify themselves with a descriptive User-Agent; please be a good citizen and cache (the server already does).
The code is MIT licensed (see LICENSE); the data keeps its original licenses above.
Building the SQLite database
npm run build:data # data/seed.json -> data/stations.sqlite (+ SHA-256 manifest)
node tools/build-data.mjs --dry-run # validate only
node tools/build-data.mjs --refresh-live # refresh sample observations from aviationweather.govWhen data/stations.sqlite exists it is picked up automatically.
Development
npm test # node --test (53 tests: core, parsers, SQLite, HTTP, CLI, MCP)
python -m unittest discover -s python/tests # Python clientNo install step is needed – there is nothing to install.
Security notes
Outbound requests are HTTPS-only and restricted to the allowlisted hosts in
src/sources/http.mjs, with timeouts.Station ids are validated (
[A-Za-z0-9._:-]{1,64}); query parameters are range-checked; the server is read-only.The Explorer escapes all data before rendering and loads no third-party scripts, fonts or CDNs.
Contributing
Add stations to data/seed.json (verified coordinates, official id, source network, license) and mirror to docs/stations.json; npm test checks catalog consistency.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Flight and sky conditions for agents, from METAR/TAF and airports to aurora and satellite passes.
Current weather and forecast lookup as an agent tool.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides access to aviation weather data from aviationweather.gov, enabling LLMs to fetch and analyze METAR, TAF, PIREPs, AIRMETs, and other aviation weather information.7MIT
- AlicenseAqualityCmaintenanceProvides real-time weather data by exposing a get_current_weather tool via MCP, using the Open-Meteo API over stdio JSON-RPC.1MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to retrieve current weather conditions and 3-day forecasts for cities through standardized MCP tools over stdio.-
- AlicenseAqualityCmaintenanceProvides Open-Meteo weather tools that return both structured forecast data for the model and a weather card (image link or text) for the user, plus geocoding of place names to coordinates. Requires no API key and works over stdio or streamable HTTP.2Mozilla Public 2.0