swiss-weather-mcp
v0.1.1
Published
MCP server for Swiss weather — MeteoSwiss forecasts, current conditions, and travel weather for any AI assistant
Downloads
443
Maintainers
Readme
swiss-weather-mcp
MCP server for Swiss weather -- MeteoSwiss forecasts for Switzerland, Open-Meteo worldwide. Works with Claude, Cursor, Windsurf, or any MCP client.
Features
- 6 weather tools -- daily forecast, hourly forecast, current conditions, multi-day overview, travel weather, location search
- MeteoSwiss STAC API -- official Swiss government data for ~6,000 Swiss locations (stations, ZIP codes, mountains)
- Open-Meteo worldwide -- automatic fallback for locations outside Switzerland, up to 16-day forecasts
- On-demand CSV fetching -- downloads MeteoSwiss forecast CSVs with TTL cache (no bulk data storage)
- Dual export -- use as an MCP server for AI assistants or import library functions directly in Node.js
- Zero auth required -- no API keys, no credentials, works out of the box
Quick Start
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "swiss-weather-mcp"]
}
}
}Claude Code
claude mcp add weather -- npx -y swiss-weather-mcpCursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "swiss-weather-mcp"]
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "swiss-weather-mcp"]
}
}
}VS Code Copilot
Add to .vscode/mcp.json:
{
"servers": {
"weather": {
"command": "npx",
"args": ["-y", "swiss-weather-mcp"]
}
}
}Demo Mode
Set WEATHER_MOCK=1 to use mock data for testing without network calls:
WEATHER_MOCK=1 npx swiss-weather-mcpTools
get_forecast
Get daily weather forecast for a location and date.
Input:
location(string, required) -- City name, ZIP code, or "lat,lon" (e.g. "Zermatt", "8001", "46.02,7.75")date(string, required) -- Forecast date YYYY-MM-DD (up to 9 days ahead for Swiss, 16 days worldwide)
Example output:
## Weather: Zermatt -- 2026-04-12
| | |
|---|---|
| **Condition** | sunny |
| **Temperature** | 4°C -- 18°C |
| **Precipitation** | 0% chance |
| **Wind** | 12 km/h SW |get_hourly_forecast
Get hour-by-hour weather for a specific day. Useful for planning departure/arrival times.
Input:
location(string, required) -- City name, ZIP code, or "lat,lon"date(string, required) -- Forecast date YYYY-MM-DD
Example output:
## Hourly Forecast: Zurich -- 2026-04-12
| Hour | Temp | Precip | Wind | Cloud | Sun |
|------|------|--------|------|-------|-----|
| 09:00 | 12°C | 0mm | 8km/h SW | 20% | 48min |
| 10:00 | 14°C | 0mm | 10km/h SW | 25% | 45min |get_current_weather
Get real-time weather conditions. Uses MeteoSwiss stations for Switzerland (updated every 10 min), Open-Meteo for worldwide.
Input:
location(string, required) -- City name, ZIP code, or "lat,lon"
Example output:
## Current Weather: Zurich Fluntern
| | |
|---|---|
| **Temperature** | 15°C |
| **Wind** | 12 km/h SW |
| **Humidity** | 62% |
| **Pressure** | 1018 hPa |
| **Precipitation** | 0 mm |
| **Measured at** | 2026-04-09T14:30:00Z |get_multi_day_forecast
Get a multi-day weather overview for trip planning. Returns one row per day.
Input:
location(string, required) -- City name, ZIP code, or "lat,lon"start_date(string, required) -- First day YYYY-MM-DDdays(number, optional) -- Number of days, 1-16 (default: 5)
get_travel_weather
Get weather at both origin and destination for a travel day. Shows side-by-side comparison.
Input:
from(string, required) -- Origin location (city, ZIP, or "lat,lon")to(string, required) -- Destination locationdate(string, required) -- Travel date YYYY-MM-DD
search_locations
Search Swiss weather locations by name or ZIP code. Returns location IDs, coordinates, and altitude. Covers ~6,000 Swiss locations.
Input:
query(string, required) -- Location name or ZIP code (e.g. "Zermatt", "8001", "Jungfraujoch")limit(number, optional) -- Maximum results (default: 10)
Example output:
- **Zermatt** (plz, 1616m) -- 46.02, 7.75
- **Zermatt / Sunnegga** (station, 2288m) -- 46.03, 7.78Library Usage
Import weather functions directly in Node.js -- no MCP protocol involved:
import { getWeatherSummary, getWeatherForecast, getMultiDayForecast } from 'swiss-weather-mcp'
// One-liner for embedding in other results (e.g. train connections)
const summary = await getWeatherSummary(46.02, 7.75, '2026-04-12')
// -> "4-18°C, sunny, 0% rain"
// Full structured data
const forecast = await getWeatherForecast(46.95, 7.45, '2026-04-12')
// -> { tempMin: 6, tempMax: 17, precipProb: 10, symbol: 'partly cloudy', ... }
// Multi-day for trip itineraries
const days = await getMultiDayForecast(46.95, 7.45, '2026-04-12', 5)Exported types: WeatherData, HourlyForecast, CurrentWeather, Location.
Data Sources
MeteoSwiss (Swiss locations)
Uses the official MeteoSwiss STAC API to discover forecast URLs, then fetches on-demand CSVs for ~6,000 Swiss locations. Data is free and licensed under CC-BY from the Swiss Federal Office of Meteorology and Climatology.
- Daily forecasts: up to 9 days ahead
- Hourly forecasts: up to 5 days ahead
- Current conditions: real-time station data updated every 10 minutes
Open-Meteo (worldwide fallback)
For locations outside Switzerland, falls back to Open-Meteo -- a free, open-source weather API with worldwide coverage.
- Daily forecasts: up to 16 days ahead
- No API key required (free tier)
- WMO weather code mapping for consistent symbol names
Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| WEATHER_MOCK | No | Set to any value to use mock data (no network calls) |
No API keys or authentication required. Both MeteoSwiss and Open-Meteo are free and open.
Self-Hosting
Docker
docker build -t swiss-weather-mcp .
docker run -p 3002:3002 swiss-weather-mcpThe HTTP server exposes an SSE-based MCP endpoint on port 3002.
Railway
Deploy from the repository and set the port to 3002. No environment variables required.
License
FSL-1.1-MIT -- Functional Source License. Free to use for any non-competing purpose. Converts to MIT after 2 years. See LICENSE for details.
