Swiss MCP Server

BFS STAT-TAB PxWeb API for official Swiss statistics

Local serverstdioPython

What is the Swiss MCP server?

Swiss MCP server exists for a simple reason — assistants are far more useful when they can act on Swiss directly instead of describing what you should do. BFS STAT-TAB PxWeb API for official Swiss statistics.

What you get

This server is Alpha (0.x) as per the PyPI classifier. Until 1.0:

swiss-statistics-mcp provides AI-native access to the Swiss Federal Statistical Office (BFS) via the STAT-TAB PxWeb API, without authentication:

  • 📊 15 tools: 8 across 21 statistical themes (682 datasets) + a 4-tool commune/historical reference layer + 2 construction/real-estate tools + a price-index tool
  • 🔍 Full-text search across the entire BFS data catalogue
  • 🎓 Convenience tools for education statistics and population data
  • 🏗️ Construction statistics — new buildings/dwellings and building investment incl. the Arbeitsvorrat leading indicator
  • 🏠 Price indices — construction price index (Baupreisindex, parsed series) and residential property price index (IMPI) via the BFS DAM/CKAN sources
  • 🏔️ Cross-cantonal comparison for any table and variable

Setting it up

swiss-statistics-mcp on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

What the assistant can call

Once Swiss is connected, these are the calls the assistant has available:

  • bfs_featured_datasets — Curated list of highly relevant datasets (focus on education and demographics)
  • bfs_browse_catalog — Browse the catalogue: all 21 themes (no theme_code), or all tables in a theme (e.g. theme_code="15" = Education and Science)
  • bfs_search_tables — Full-text search across the entire data catalogue (682 datasets)
  • bfs_get_table_metadata — Variables, values and metadata for a specific table
  • bfs_get_data — Data retrieval with optional filters by dimensions and values
  • bfs_education_stats — Convenience tool: teachers, pupils, demographic scenarios, scholarships
  • bfs_population — Resident population by canton, year, age structure or sex
  • bfs_compare_cantons — Cross-cantonal comparison for any table and any variable
  • lookup_commune — Resolve a commune by name or BFS number as of a given date (canton, validity, LINDAS URI)
  • resolve_historical_commune — Map a historical BFS number onto today's number(s) — re-key old statistics across fusions
  • list_communes — List all communes of a canton as of a given date
  • search_historical_series — Search long-run time series in Historical Statistics of Switzerland (HSSO)

Configuration and credentials

  • Python 3.11+ - uv (recommended) or pip ---

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Swiss.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the swiss mcp server does with a few real requests.

Choosing this one

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Swiss's toolset — bfs_featured_datasets, bfs_browse_catalog, bfs_search_tables and 11 more — is a fair guide to whether it matches your workflow. It is maintained by malkreide; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
bfs_featured_datasetsCurated list of highly relevant datasets (focus on education and demographics)
bfs_browse_catalogBrowse the catalogue: all 21 themes (no theme_code), or all tables in a theme (e.g. theme_code="15" = Education and Science)
bfs_search_tablesFull-text search across the entire data catalogue (682 datasets)
bfs_get_table_metadataVariables, values and metadata for a specific table
bfs_get_dataData retrieval with optional filters by dimensions and values
bfs_education_statsConvenience tool: teachers, pupils, demographic scenarios, scholarships
bfs_populationResident population by canton, year, age structure or sex
bfs_compare_cantonsCross-cantonal comparison for any table and any variable
lookup_communeResolve a commune by name or BFS number as of a given date (canton, validity, LINDAS URI)
resolve_historical_communeMap a historical BFS number onto today's number(s) — re-key old statistics across fusions
list_communesList all communes of a canton as of a given date
search_historical_seriesSearch long-run time series in Historical Statistics of Switzerland (HSSO)
bfs_construction_activityNew buildings & dwellings per commune (yearly), incl. dwelling room-size mix
bfs_construction_investmentBuilding investment & Arbeitsvorrat (leading indicator) by region/canton/commune

How to install the Swiss MCP server

{
  "mcpServers": {
    "swiss-statistics": {
      "command": "python",
      "args": ["-m", "swiss_statistics_mcp.server"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Python 3.11+ - uv (recommended) or pip ---

Example prompts to try

  • Use Swiss to bfs featured datasets.
  • Use Swiss to bfs browse catalog.
  • Use Swiss to bfs search tables.

Frequently asked questions

It connects Swiss to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (bfs_featured_datasets, bfs_browse_catalog, bfs_search_tables, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Swiss directly.