Swiss Statistics MCP
Überblick
Beschreibung vom Entwickler (englisches Original)
BFS STAT-TAB PxWeb API for official Swiss statistics
Die drei Säulen von PopNx MCP
Diese drei werden nie zu einer Punktzahl zusammengefasst: Meinungen, Messungen und Beliebtheit sind verschiedene Dinge.
- Stimmen der NutzeriNoch keine BewertungenBewertungen starten in einem späteren Schritt zusammen mit Benutzerkonten
- Unsere Basischecksi1 von 1 bestandenAnhand öffentlicher Informationen geprüft; Code noch nicht gescannt
- NutzungiGanz neu↓ 41/Wo. · ★ –
Was du damit machen kannst
Für diesen Server haben wir noch keine Zusammenfassung in einfacher Sprache geschrieben. Unten stehen die Fakten, die wir aus der Registry gelesen haben.
- Verbindung: Läuft auf deinem Computer
- Transport: stdio
- Kategorie: Datenbanken & Datensätze
Installation
Wähle die KI-App, die du nutzt, und kopiere die Einstellungen.
Bevor du installierst
- Basischecks: 1 von 1 bestanden
- Läuft auf deinem Computer mit den Rechten deines Benutzerkontos (Dateien, Netzwerk, Apps).
- Die Registry nennt keinen Schlüssel zum Eintragen.
Du brauchst
- PyPIuv für Python installiert (für den Befehl uvx)
Welche App nutzt du?
Wähle oben deine App. Wir merken sie uns, damit der Button beim nächsten Mal „In … installieren“ anzeigt.
Öffne Claude Desktop → Settings → Developer → Edit Config und füge dies in claude_desktop_config.json ein
{
"mcpServers": {
"swiss-statistics": {
"command": "uvx",
"args": [
"swiss-statistics-mcp"
]
}
}
}Führe das in deinem Terminal aus
claude mcp add swiss-statistics -- uvx swiss-statistics-mcpOder kopier die Einstellungen selbst
In .cursor/mcp.json in deinem Projekt oder in ~/.cursor/mcp.json einfügen
{
"mcpServers": {
"swiss-statistics": {
"command": "uvx",
"args": [
"swiss-statistics-mcp"
]
}
}
}Dein Browser fragt, ob er die App öffnen darf, dann zeigt die App die Einstellungen und bittet dich um Bestätigung. Schlüsselwerte bleiben leer, damit du sie selbst einträgst.
Oder kopier die Einstellungen selbst
In .vscode/mcp.json in deinem Projekt einfügen
{
"servers": {
"swiss-statistics": {
"type": "stdio",
"command": "uvx",
"args": [
"swiss-statistics-mcp"
]
}
}
}Dein Browser fragt, ob er die App öffnen darf, dann zeigt die App die Einstellungen und bittet dich um Bestätigung. Schlüsselwerte bleiben leer, damit du sie selbst einträgst.
Dieser Server läuft auf deinem Computer, und ChatGPT kann sich nur mit Servern im Internet verbinden. Wähle eine andere App.
Deine Auswahl bleibt in einem Cookie auf diesem Gerät; kein Konto nötig.
Diese Einstellungen werden aus dem Registry-Eintrag des Entwicklers erzeugt. Wenn in der README etwas anderes steht, folge der README.
Was er kann
Läuft auf deinem Computer; die Tool-Liste erscheint nach der Installation in deiner KI-App.
Basischecksi
Wir prüfen Informationen, die jeder sehen kann; den Code haben wir nicht gelesen. Checks, die nicht zutreffen, werden nicht mitgezählt. · Geprüft am 9. Nov. 2026
- ✓ Bestanden
Entwickler passt zum Repo
Der Registry-Name wurde mit dem GitHub-Konto malkreide bestätigt, dem das Repo gehört
- … Noch nicht geprüft
Wird noch gepflegt
Dieses Repo haben wir noch nicht von GitHub gelesen
- … Noch nicht geprüft
Hat eine Lizenz
Dieses Repo haben wir noch nicht von GitHub gelesen
- – Nicht zutreffend
Endpunkt antwortet
Dieser Server läuft auf deinem Computer; es gibt keinen Endpunkt im Internet
- – Nicht zutreffend
Anmeldung mit OAuth
Läuft auf deinem Computer und nutzt stattdessen lokale Einstellungen
- … Noch nicht geprüft
Keine versteckten Anweisungen in Tool-Beschreibungen
Läuft auf deinem Computer; Tool-Listen können wir nur von Endpunkten im Internet lesen
Im Vergleich mit anderen in Datenbanken & Datensätzei
- Mehr Sterne als 0 % der anderen 1151 Server in dieser Kategorie
- Neuer in der Registry veröffentlicht als 41 % der anderen 1151 Server in dieser Kategorie
- Basischecks gleich gut wie oder besser als bei 100 % der anderen 1151 Server in dieser Kategorie
Verglichen mit allen aktiven Servern dieser Kategorie in der Registry. Sterne zählen nur, wenn dem Herausgeber das Repo gehört.
Häufige Fragen
Ist Swiss Statistics MCP sicher?
Er hat 1 von 1 zutreffenden Basischecks bestanden. Den Code haben wir nicht gelesen. Bevor du einen Schlüssel oder Token hinzufügst, sieh nach, welche Zugriffe der Server verlangt, und nutze einen Schlüssel, der nur die Berechtigungen hat, die du brauchst.
Welche Schlüssel oder Codes braucht er?
Die Registry nennt keinen erforderlichen Schlüssel, manche Server bitten dich aber bei der ersten Nutzung, dich anzumelden.
Läuft er auf meinem Computer oder in der Cloud?
Er läuft auf deinem Computer. Deine KI-App startet ihn bei Bedarf, und die Daten laufen nicht über die Server des Entwicklers (außer der Server ruft selbst einen Onlinedienst auf).
Wird er noch gepflegt?
Das GitHub-Repo wurde zuletzt – geändert, und die neueste Version (0.8.0) kam vor 43 Tagen in die Registry.
Welche Apps können ihn nutzen?
Apps, die MCP unterstützen, etwa Claude Desktop, Claude Code, Cursor und VS Code. Außerdem brauchst du Python (uv) auf deinem Computer.
Was kann ich stattdessen nutzen?
In derselben Kategorie: Supabase, MongoDB MCP Server, Elasticsearch MCP Server
Alternativen
Server derselben Kategorie von anderen Entwicklern, sortiert nach Sternen.
So liest du eine Karte:↓ Downloads pro Wochei★ GitHub-SterneiDrei Säulen: Bewertungen · Checks · NutzungiAktualisiert = neueste Version in der Registry veröffentlichti
README vom Entwickler
README öffnen
Unverändert aus dem Repo des Entwicklers übernommen. PopNx MCP hat den Inhalt weder geprüft noch empfiehlt es ihn. HTML, Bilder und Skripte wurden entfernt. Links führen von dieser Website weg.
🇨🇭 Part of the [Swiss Public Data MCP Portfolio](https://github.com/malkreide)
📊 swiss-statistics-mcp
MCP Server for Swiss Federal Statistical Office (BFS) data via STAT-TAB PxWeb API — 682 datasets across 21 themes, no authentication required
🇩🇪 Deutsche Version
Demo
Maturity
This server is Alpha (0.x) as per the PyPI classifier. Until 1.0:
- Tool names, input schemas, and output JSON keys MAY change between minor versions
- Pin cloud deployments to a specific git tag, not
main - Production use is acceptable for read-only Open Data scenarios; consider it experimental for anything user-facing
See CHANGELOG.md for breaking changes.
Overview
swiss-statistics-mcp provides AI-native access to the Swiss Federal Statistical Office (BFS) via the STAT-TAB PxWeb API, without authentication:
| Property | Details |
|---|---|
| API | STAT-TAB PxWeb API v1 |
| Endpoint | https://www.pxweb.bfs.admin.ch/api/v1/ |
| Provider | Swiss Federal Statistical Office (BFS) |
| Datasets | 682 tables across 21 thematic areas |
| Languages | German (de), French (fr), Italian (it), English (en) |
| Licence | Open Government Data (OGD) — BFS Terms of Use |
| Authentication | None — fully public |
Anchor demo query: *"How many students attended lower secondary schools in the canton of Zurich in 2024?"* — real BFS figures, no hallucination.
Features
- 📊 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
- 🔓 No API key required — all data under open licences
- ☁️ Dual transport — stdio (Claude Desktop) + Streamable HTTP (cloud)
Prerequisites
- Python 3.11+
- uv (recommended) or pip
Installation
# Clone the repository
git clone https://github.com/malkreide/swiss-statistics-mcp.git cd swiss-statistics-mcp
Install
pip install -e .
or with uv:
uv pip install -e .
Or with uvx (no permanent installation):
uvx swiss-statistics-mcp
Quickstart
# stdio (for Claude Desktop)
python -m swiss_statistics_mcp.server
Streamable HTTP, loopback only (default: host=127.0.0.1, port=8000)
python -m swiss_statistics_mcp.server --http --port 8000
Streamable HTTP, all interfaces (only behind a reverse proxy with access control)
MCP_HOST=0.0.0.0 python -m swiss_statistics_mcp.server --http --port 8000
or
python -m swiss_statistics_mcp.server --http --host 0.0.0.0 --port 8000
Try it immediately in Claude Desktop:
*"How many teachers worked in the canton of Zurich in 2023?"*
*"What is the population of canton Bern broken down by age?"*
*"Compare the social assistance rate across all cantons for 2022."*
Configuration
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": { "swiss-statistics": { "command": "python", "args": ["-m", "swiss_statistics_mcp.server"] } } }
Or with uvx:
{
"mcpServers": { "swiss-statistics": { "command": "uvx", "args": ["swiss-statistics-mcp"] } } }
Config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Cursor / Windsurf / VS Code + Continue
The configuration syntax is identical to Claude Desktop. The file name depends on the client:
- Cursor:
.cursor/mcp.jsonin the project folder, or~/.cursor/mcp.jsonglobally - Windsurf:
~/.codeium/windsurf/mcp_config.json - VS Code + Continue:
.continue/config.json
Cloud Deployment (SSE for browser access)
For use via claude.ai in the browser (e.g. on managed workstations without local software).
⚠️ Security note — this server has no authentication. A public URL
turns it into an open proxy to the BFS API on your deployment's IP. Any
client with the URL can drive the tools, consume your platform quota, and
attribute traffic to your IP. Two mitigations, in order of preference:
1. Put it behind access control — Render's «Private Service», Cloudflare
Access, or a reverse proxy with Basic-Auth / IP allowlist in front of the
container.
2. Accept it as a public open-data proxy — only acceptable because all
data is BFS OGD (Public Open Data) and tools are read-only.
The server binds to
127.0.0.1by default. To expose it on a container
port you must explicitly set
MCP_HOST=0.0.0.0(e.g. as a Render env var)
or pass
--host 0.0.0.0. Do not do this without one of the mitigations above.
Render.com:
- Push/fork the repository to GitHub
- On render.com: New Web Service → connect GitHub repo
- Set environment variable:
MCP_HOST=0.0.0.0 - Set start command:
python -m swiss_statistics_mcp.server --http --port 8000 - In claude.ai under Settings → MCP Servers, add:
https://your-app.onrender.com/sse
💡 *"stdio for the developer laptop, SSE for the browser."*
Output Schema
Since v0.2.0, every tool returns a typed Pydantic model rather than a JSON string. FastMCP serializes these as structured content so MCP clients can read fields directly.
# Old (pre-0.2.0)
result = await bfs_get_data(...) # str data = json.loads(result) # dict print(data["rows_total"])
New (>= 0.2.0)
result = await bfs_get_data(...) # DataTableResult print(result.rows_total) # 1000 print(result.truncated) # True
Every result carries error: str | None and hint: str | None at the top level — result.error is None means success. Data-returning tools (bfs_get_data, bfs_education_stats, bfs_population, bfs_compare_cantons) additionally expose truncated: bool, rows_total: int, and rows_returned: int for machine-readable cap detection.
| Tool | Result type |
|---|---|
bfs_browse_catalog | BrowseCatalogResult |
bfs_search_tables | SearchTablesResult |
bfs_get_table_metadata | TableMetadataResult |
bfs_get_data | DataTableResult |
bfs_education_stats | DataTableResult |
bfs_population | DataTableResult |
bfs_compare_cantons | DataTableResult |
bfs_featured_datasets | FeaturedDatasetsResult |
lookup_commune | LookupCommuneResult |
resolve_historical_commune | ResolveHistoricalCommuneResult |
list_communes | ListCommunesResult |
search_historical_series | SearchHistoricalSeriesResult |
bfs_construction_activity | ConstructionActivityResult |
bfs_construction_investment | ConstructionInvestmentResult |
bfs_price_index | PriceIndexResult |
Reference-layer results additionally carry source (attribution) and provenance (live_api \| cached); SearchHistoricalSeriesResult also carries licence_note with the mandatory HSSO NonCommercial notice. The construction and price-index results carry source + provenance on the same envelope pattern.
Available Tools
| Tool | Description |
|---|---|
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) |
bfs_construction_activity | New buildings & dwellings per commune (yearly), incl. dwelling room-size mix |
bfs_construction_investment | Building investment & Arbeitsvorrat (leading indicator) by region/canton/commune |
bfs_price_index | Construction price index (Baupreisindex, parsed series) / residential property price index (IMPI, source links) |
Four of these tools form the reference layer of the portfolio (see Join Keys): they turn official BFS commune numbers into a reliable join key and let you re-key statistics that predate a municipal merger. The two bfs_construction_* tools cover STAT-TAB theme 09 (Bau- und Wohnungswesen) — see Construction sources. bfs_price_index covers price indices that are not in STAT-TAB — see Price-index sources.
Construction sources
| Cube ID | Title | Coverage | Used by |
|---|---|---|---|
px-x-0904030000_106 | Neu erstellte Gebäude mit Wohnungen nach Gemeinde, Gebäudetyp | 2013– | bfs_construction_activity |
px-x-0904030000_105 | Neu erstellte Wohnungen nach Gemeinde, Anzahl Zimmer | 2013– | bfs_construction_activity |
px-x-0904010000_205 | Bauinvestitionen und Arbeitsvorrat nach Grossregion/Kanton/Gemeinde | 1994– | bfs_construction_investment |
The pre-2013 Gemeinde-level building series lives in the discontinued cubes
px-x-0904030000_101/_104(1995–2012), which use a different geo coding and are not queried by these tools. Building/dwelling figures are the consolidated official yearly statistics — for up-to-date register states and the construction pipeline, cross-validate againstswiss-housing-mcp(deliberate redundancy).
Price-index sources
bfs_price_index covers two indices that are not published via STAT-TAB. Their datasets live on opendata.swiss (CKAN); the data files themselves are BFS DAM assets.
| Index | Source | Returns |
|---|
| baupreisindex | opendata.swiss dataset *Schweizerischer Baupreisindex (Multibasen)* → DAM XLSX asset | Parsed national semi-ann
Nur der Anfang wird gezeigt; den Rest findest du im Repo