MCP server for Swiss Federal Railways (SBB) open data β passenger frequency, live disruptions, construction projects, platform data & more. No API key required.
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 connecting AI models to Swiss Federal Railways (SBB) open data β passenger frequency, live rail disruptions, infrastructure & real-estate projects, train counts, platform data, rolling stock and station search from data.sbb.ch. No API key required.
sbb-opendata-mcp gives AI assistants like Claude direct access to public SBB data β no copy-pasting or manual API calls. A question like "How many passengers passed through ZΓΌrich HB every day in 2024?" is answered with real measured data.
The SBB Open Data portal speaks the OpenDataSoft REST API (v2.1). This server
translates it into clean Markdown and JSON for the AI model, and adds MCP
structuredContent alongside the human-readable text so programmatic clients can
consume the underlying records without re-parsing. The server is model-agnostic
and works with any MCP-compatible client.
Anchor demo query: "Compare ZΓΌrich HB, Bern and Basel SBB by passenger frequency and platform capacity." β More use cases by audience β
Install uv (recommended):
From PyPI:
Or with uvx (no permanent installation):
For local development, install from a clone in editable mode:
Try it immediately in Claude Desktop:
"How many people boarded at ZΓΌrich HB daily in 2024?" "Are there any current disruptions on the Swiss rail network?"
The server needs no configuration to run over stdio. The variables below tune the optional Streamable HTTP transport, logging and observability.
| Variable | Effect | Default |
|---|---|---|
MCP_HOST | Bind host for the HTTP transport. Keep 127.0.0.1 locally; only bind 0.0.0.0 inside a controlled container/cloud environment. | 127.0.0.1 |
MCP_PORT | Port for the HTTP transport. | 8000 |
MCP_ALLOWED_HOSTS | Comma-separated host allow-list for DNS-rebinding protection (e.g. your-app.onrender.com,your-app.onrender.com:*). | localhost only |
MCP_ALLOWED_ORIGINS | Comma-separated browser-origin allow-list (e.g. https://your-app.onrender.com). | (none) |
LOG_LEVEL | Log verbosity (DEBUG/INFO/WARNING/β¦). | INFO |
LOG_FORMAT | json for structured logs; anything else for human-readable text. Always written to stderr. | text |
π DNS-rebinding / Origin protection is always on; localhost is allow-listed so local HTTP development works out of the box. Logs go to stderr β stdout is reserved for the stdio JSON-RPC channel.
Config file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonRestart Claude Desktop β the server is downloaded automatically on first use.
Works with Cursor, Windsurf, VS Code + Continue, LibreChat, Cline and self-hosted
models via mcp-proxy β same configuration as above.
For use via claude.ai in the browser or remote servers (e.g. Render.com). The cloud transport is Streamable HTTP (endpoint /mcp).
Docker (recommended):
The image is a multi-stage build running as a non-root user; docker-compose.yml
adds read_only, no-new-privileges and memory/CPU/PID limits.
Manual / Render.com:
β οΈ Binding: In a network transport the server binds to
127.0.0.1by default so a locally started server is not exposed to your whole network. SetMCP_HOST=0.0.0.0only in a container/cloud environment where binding to all interfaces is intended (the Docker image does this for you), and place the server behind a reverse proxy that enforces rate limiting (and authentication, if the endpoint should not be public). SeeSECURITY.md.
| Tool | Description | Data Update |
|---|---|---|
sbb_get_passenger_frequency | Boardings/alightings by station and year (daily avg.) | Annual |
sbb_get_rail_disruptions | Live rail traffic messages | Every 5 min. |
sbb_get_real_estate_projects | SBB real estate development projects | Daily |
sbb_get_trains_per_segment | Train counts per route segment (SBB, BLS, SOB β¦) | Annual |
sbb_get_platform_data | Platform data (length, type, area) | Ongoing |
sbb_get_rolling_stock | Rolling stock (capacity, year built) | Ongoing |
sbb_compare_stations | Compare up to 10 stations (multi-dataset) | β |
sbb_search_stations | Search stops (Swiss DiDok register, all CH) | Ongoing |
sbb_list_datasets | List all ~89 SBB open datasets | β |
All tools support response_format: "markdown" (human-readable) and "json"
(machine-readable), plus pagination. Every tool also returns MCP structuredContent
(the underlying records/metadata) alongside the rendered text.
| Query | Tool |
|---|---|
| "How many people boarded at ZΓΌrich HB daily in 2024?" | sbb_get_passenger_frequency |
| "Are there any current disruptions on the Swiss rail network?" | sbb_get_rail_disruptions |
| "Compare ZΓΌrich HB, Bern and Basel SBB" | sbb_compare_stations |
| "Which SBB real-estate construction projects are running?" | sbb_get_real_estate_projects |
| "How many trains run yearly on the ZΓΌrichβWinterthur route?" | sbb_get_trains_per_segment |
| "Which stops exist in WΓ€denswil?" | sbb_search_stations |
β More use cases by audience
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/sbb-opendata-mcp)<a href="https://allmcps.com/mcp/sbb-opendata-mcp"><img src="https://allmcps.com/api/badge/sbb-opendata-mcp?style=directory" alt="Sbb Opendata MCP on AllMCPs" /></a>