BFS STAT-TAB PxWeb API for official Swiss statistics
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
๐จ๐ญ Part of the Swiss Public Data MCP Portfolio
MCP Server for Swiss Federal Statistical Office (BFS) data via STAT-TAB PxWeb API โ 682 datasets across 21 themes, no authentication required
This server is Alpha (0.x) as per the PyPI classifier. Until 1.0:
mainSee CHANGELOG.md for breaking changes.
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.
Or with uvx (no permanent installation):
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."
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Or with uvx:
Config file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonThe configuration syntax is identical to Claude Desktop. The file name depends on the client:
.cursor/mcp.json in the project folder, or ~/.cursor/mcp.json globally~/.codeium/windsurf/mcp_config.json.continue/config.jsonFor 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:
- 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.
- 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 setMCP_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:
MCP_HOST=0.0.0.0python -m swiss_statistics_mcp.server --http --port 8000https://your-app.onrender.com/sse๐ก "stdio for the developer laptop, SSE for the browser."
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.
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.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/swiss-statistics-mcp)<a href="https://allmcps.com/mcp/swiss-statistics-mcp"><img src="https://allmcps.com/api/badge/swiss-statistics-mcp?style=directory" alt="Swiss Statistics MCP on AllMCPs" /></a>