MCP Hub
Back to servers

foehn

Access Swiss meteorological open data from MeteoSwiss, powered by foehn

Registry
Stars
33
Updated
Apr 4, 2026
Validated
Apr 6, 2026

Quick Install

uvx foehn

foehn

MeteoSwiss Open Data → Python API, CLI, MCP server, Parquet & Delta tables

PyPI Latest Release Python Versions MIT License Monthly Downloads


foehn downloads every MeteoSwiss OGD collection via the STAC API, converts CSV/TXT to Parquet with Polars, and optionally ingests everything into Databricks Unity Catalog Delta tables on a daily schedule. It also ships an MCP server so LLMs can query Swiss weather data directly.

Why foehn?

  • 20+ collections in one command — weather stations, radar, hail maps, forecasts, climate scenarios, and more
  • MCP server for LLMs — give your favorite LLM live access to MeteoSwiss data with the MCP server
  • Significantly smaller on disk — columnar Parquet with Zstandard compression vs. raw CSVs
  • Incremental by default — only re-downloads files that changed since your last run, tracked via _last_run.json
  • No Spark required locally — download + conversion uses Polars only; Spark is optional for Delta ingestion
  • Ships a Declarative Automation Bundle — ready-to-deploy daily job and historical backfill, no pipeline config needed

Quick start

pip install foehn
foehn download

Recent data (Jan 1 → yesterday) is downloaded and converted to Parquet under ./data/meteoswiss/.

foehn CLI demo

Collections

MeteoSwiss organises its open data into five categories. Category B (atmosphere measurements — radio soundings, ceilometer, ozone, etc.) is not yet released (B1 radio soundings expected first half of 2026).

A — Ground-based measurements

Station-level time series in CSV, split into time slices (historical, recent, now). Converted to Parquet.

DatasetIDDescriptionFrequenciesStationsParameters
smnA1Automatic weather stations — the core SwissMetNet network. ~160 stations across Switzerland measuring temperature, humidity, pressure, precipitation, wind, radiation, sunshine, soil temperature, and dew point.10-min, hourly, daily, monthly, yearly158181
smn_precipA2Automatic precipitation stations — rain-gauge-only network. Reports precipitation totals at multiple granularities.10-min, hourly, daily, monthly, yearly1416
smn_towerA3Tower stations — tall mast measurements for temperature, humidity, wind (scalar + gusts), radiation, and sunshine at tower height.10-min, hourly, daily, monthly, yearly446
nimeA5Manual precipitation stations — observer-read gauges reporting daily precipitation, plus fresh snow depth and snow cover.daily, monthly, yearly27317
totA6Totaliser precipitation — remote alpine rain gauges read once per year, reporting precipitation reduced to hydrological year (Oct 1 – Sep 30).yearly571
pollenA7Pollen stations — airborne pollen concentrations for 7 taxa: alder, birch, hazel, beech, ash, oak, and grasses (Poaceae).hourly, daily, yearly1628
obsA8Visual / meteorological observations — human-observed daily cloud cover, counts of days with rain, snowfall, hail, fog, and snow coverage.daily, monthly, yearly2027
phenologyA9Phenological observations — day-of-year for lifecycle events (leaf unfolding, flowering, fruit maturity, leaf colouring, leaf drop) across 26 plant species including horse chestnut, beech, cherry, apple, grape vine, and larch.yearly17571

C — Climate data

KeyIDDescriptionFormat
nbcnC1Homogeneous climate stations — break-adjusted series for temperature, pressure, precipitation, sunshine, and cloud cover (29 stations). Used for long-term trend analysis.CSV → Parquet
nbcn_precipC2Homogeneous precipitation — break-adjusted precipitation series (46 stations).CSV → Parquet
surface_derived_gridC3Ground-based spatial analyses — gridded fields of precipitation, temperature, and sunshine duration derived from station interpolation.NetCDF (opt-in)
satellite_derived_gridC4Satellite-based spatial analyses — gridded radiation, cloud cover, and land surface temperature derived from satellite.NetCDF (opt-in)
climate_normalsC6Station normals — 30-year reference averages for 1961–1990 and 1991–2020. Monthly values per station.TXT → Parquet
climate_normals_*C7Spatial normals — gridded 30-year reference maps for precipitation, sunshine, and temperature (both reference periods).NetCDF / GeoTIFF (opt-in)
climate_scenariosC8CH2025 local scenarios — station-level climate projections.CSV → Parquet
climate_scenarios_gridC9CH2025 gridded scenarios — spatially gridded climate projections.NetCDF (opt-in)

D — Radar data

KeyIDDescriptionFormat
radar_precipD1Precipitation radar — composite precipitation grids at 5–10 min intervals.HDF5 (opt-in)
radar_hailD3Hail radar — probability-of-hail grids at 5 min intervals.HDF5 (opt-in)

Radar collections are large and require --grids to download.

E — Forecast data

KeyIDDescriptionFormat
forecast_icon_ch1E2ICON-CH1-EPS — 1 km ensemble forecast model over Switzerland.GRIB2 (opt-in)
forecast_icon_ch2E3ICON-CH2-EPS — 2.1 km ensemble forecast model.GRIB2 (opt-in)
forecast_localE4Local point forecasts — forecasts for ~5,600 points (stations + postal codes) covering temperature, precipitation, wind, radiation, and more (32 parameters).CSV → Parquet

GRIB2 forecast collections are large and require --grids to download.

Hail hazard maps

Static spatial reference grids showing expected hail grain size (cm) at different return periods. These are not categorised under A–E because they are static hazard assessments, not measured or forecasted time series — they represent probabilistic climatological analyses published as fixed reference maps.

KeyDescriptionFormat
hail_hazard_10yHail grain size — 10-year return periodNetCDF / GeoTIFF (opt-in)
hail_hazard_20yHail grain size — 20-year return periodNetCDF / GeoTIFF (opt-in)
hail_hazard_50yHail grain size — 50-year return periodNetCDF / GeoTIFF (opt-in)
hail_hazard_100yHail grain size — 100-year return periodNetCDF / GeoTIFF (opt-in)

Time slices

MeteoSwiss splits CSV data into three time slices, encoded in the filename:

SliceRangeUpdate frequencyFrequencies
recentJan 1 this year → yesterdayDaily at 12:00 UTC10-min, hourly, daily, monthly
historicalStart of measurement → Dec 31 last yearOnce per year (early January)10-min, hourly, daily, monthly
nowYesterday 12:00 UTC → nowEvery 10 minutes10-min, hourly only

Some collections (phenology, totaliser, yearly aggregates) don't use time slices — they publish a single file per station.

All timestamps are UTC. For 10-min and hourly data the timestamp marks the end of the interval (16:00 = 15:50:01–16:00:00). For daily, monthly, and yearly data the timestamp marks the start (2023-06-01 = the whole of June).


Installation

From PyPI:

pip install foehn

From source:

git clone https://github.com/kayhendriksen/foehn
cd foehn
pip install -e .

With Databricks extras (PySpark + Delta):

pip install "foehn[databricks]"

Requires Python ≥ 3.10.


Python API

Use foehn directly from notebooks or scripts:

import foehn

# List all available datasets
foehn.list_datasets()
# [{'dataset': 'smn', 'collection_id': 'ch.meteoschweiz.ogd-smn', 'category': 'A',
#   'subcategory': 'A1', 'description': 'Automatic weather stations',
#   'format': 'CSV', 'frequencies': ['t', 'h', 'd', 'm'],
#   'time_slices': ['historical', 'recent', 'now']}, ...]

# Load data directly into a Polars DataFrame (nothing written to disk)
df = foehn.load("smn", station="BER", frequency="d")

# Filter by multiple stations and frequencies
df = foehn.load("smn", station=["BER", "ZUR"], frequency=["d", "h"])

# Include historical data
df = foehn.load("smn", station="BER", frequency="d", time_slice=["historical", "recent"])

# Explore dataset metadata (fetched live from the API)
foehn.parameters("smn")   # column name mappings: shortname, description, unit, type, ...
foehn.stations("smn")     # station info: abbr, name, canton, altitude, lat, lon, ...
foehn.inventory("smn")    # what each station measures and since when

# Download a single dataset to disk
foehn.download("smn", data_dir="./data/meteoswiss")

# Download with specific time slices
foehn.download("smn", time_slice=["historical", "recent"])

# Convert downloaded CSVs to Parquet
foehn.to_parquet("smn", data_dir="./data/meteoswiss")

MCP server

foehn includes an MCP server that gives LLMs live access to MeteoSwiss data. It's published on the MCP Registry.

pip install "foehn[mcp]"

Add it to your MCP client config:

{
  "mcpServers": {
    "foehn": {
      "command": "foehn",
      "args": ["mcp"]
    }
  }
}

Tools available:

ToolDescription
list_datasetsBrowse all MeteoSwiss datasets with metadata
load_dataFetch weather measurements as rows
get_parametersLook up what each column measures
get_stationsFind station abbreviations and locations
get_inventoryCheck data availability per station

CLI reference

The CLI uses subcommands that mirror the Python API:

foehn list

List all available datasets.

foehn list

foehn download [DATASET...]

Download datasets. Without arguments, downloads all CSV collections. Specify one or more datasets to download specific ones.

foehn download              # all CSV collections
foehn download smn pollen   # specific datasets only
FlagDescription
--historicalInclude historical time slice
--nowInclude realtime 'now' time slice
--allInclude all time slices (historical + recent + now)
--full-refreshIgnore incremental tracking, re-download everything
--gridsInclude grid/binary datasets (GRIB2, NetCDF)
--no-parquetSkip CSV → Parquet conversion
--data-dir PATHOutput root (default: ./data/meteoswiss)

foehn to-parquet [DATASET...]

Convert downloaded CSVs to Parquet. Without arguments, converts all collections.

foehn to-parquet            # all collections
foehn to-parquet smn        # single dataset
FlagDescription
--data-dir PATHRoot data directory

foehn metadata KIND DATASET

Show dataset metadata fetched live from the API. KIND is one of parameters, stations, or inventory.

foehn metadata parameters smn   # what each column name means
foehn metadata stations smn     # station locations and info
foehn metadata inventory smn    # which station has which parameter

foehn load DATASET

Load a dataset from the API and print a preview (no files written to disk).

foehn load smn --station BER --frequency d
foehn load smn --station BER ZUR --frequency d h -n 50
FlagDescription
--stationFilter by station(s)
--frequencyFilter by frequency (t, h, d, m, y)
--time-sliceTime slices to include (default: recent)
-nNumber of rows to show (default: 20)

Parquet files land in <data-dir>/parquet/<collection>/.


Environment variables

Settings can also be configured via environment variables. CLI flags always take precedence.

VariableEquivalentDescription
FOEHN_DATA_DIR--data-dirRoot data directory
FOEHN_FULL_REFRESH--full-refreshSet to 1, true, or yes to ignore incremental tracking

Databricks pipeline

The recommended setup uses Declarative Automation Bundles.

1. Set variables:

export BUNDLE_VAR_host=https://adb-xxx.azuredatabricks.net
export BUNDLE_VAR_alert_email=you@example.com

2. Deploy:

pip install databricks-cli
databricks bundle validate
databricks bundle deploy -t prod

This deploys two jobs:

  • foehn_daily — runs at 13:30 UTC every day; downloads recent data and refreshes Delta tables
  • foehn_historical — paused by default; trigger manually for first run or on Jan 1 for the annual archive slice

Data sources

STAC APIhttps://data.geo.admin.ch/api/stac/v1
Documentationhttps://opendatadocs.meteoswiss.ch
MeteoSwiss OGDhttps://github.com/MeteoSwiss/opendata

License

MIT

Reviews

No reviews yet

Sign in to write a review