deutschebahn_mcp
Provides tools for live German train travel data via Deutsche Bahn OpenBoards and OpenStation APIs. It resolves station names to station records and supports querying departure and arrival boards, including time, line, destination/origin, platform, delay, cancellation status, and notices, with optional filters for destination/direction, train type, and line/train number.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@deutschebahn_mcp When does the next ICE leave Köln Hbf?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
deutschebahn_mcp
An MCP (Model Context Protocol) server for the Deutsche Bahn OpenBoards + OpenStation APIs. It lets an LLM agent look up live German train departures/arrivals by station name — no EVA numbers required, typos and umlauts tolerated.
What it does
getDepartureBoard— departure board for a station: time, line, destination, platform, delay (minutes), cancellation flag, notice count.getArrivalBoard— same, for arrivals (origin instead of destination).findStation— resolves a station name to its station record (name, EVA, DHID, StaDa). Returns a single match, a short list of options if the name is ambiguous (e.g. "Frankfurt" — Frankfurt (Main) Hbf vs. Frankfurt (Oder) are different cities), or "not found".
Station names are resolved automatically inside getDepartureBoard/getArrivalBoard too — you
never need to look up an EVA number yourself. If a name is ambiguous, the tool returns the list
of options instead of guessing, unless there's exactly one obvious main station ("Hbf") among
same-city variants.
Optional filters on the board tools: ziel (destination/direction, substring match), zugart
(fern / regio / sbahn), linie (line/train number, substring match).
Every result carries the source attribution Daten: DB InfraGO / Deutsche Bahn (OpenBoards API).
Related MCP server: Deutsche Bahn MCP Server
Example
You: When does the next ICE leave Köln Hbf?
Claude: The next ICE from Köln Hbf is ICE 77 at 18:50, platform 1, running on time.No EVA number, no manual lookup — Claude resolves "Köln Hbf" through the findStation
logic built into getDepartureBoard and filters the board down to ICE services for you.
Requirements
Node.js >= 22
An account at the DB API Marketplace with an active subscription to both:
OpenBoards (departure/arrival boards)
OpenStation (station directory — needed for name resolution; without it you'd have to pass raw EVA numbers)
Getting DB API credentials
Create an account at developers.deutschebahn.com.
Go to Applications → Create new application and give it any name.
On the application page, subscribe to the OpenBoards product.
On the same application page, also subscribe to the OpenStation product (easy to miss — without it, station-name lookups won't work).
Copy the generated Client ID and Client Secret for that application — these go into
DB_OPENBOARDS_CLIENT_ID/DB_OPENBOARDS_CLIENT_SECRETbelow.
Install
git clone https://github.com/janoschLC/deutschebahn_mcp.git
cd deutschebahn_mcp
npm install
npm run buildConfigure
Copy .env.example to .env and fill in your credentials, or set the environment variables
directly in your MCP client config:
Variable | Required | Description |
| yes | DB API Marketplace client ID |
| yes | DB API Marketplace client secret |
| no | Override the OpenBoards base URL |
| no | Override the OpenStation NeTEx endpoint |
| no | Where the station-name cache is stored (default: |
| no | Station used when no |
The legacy variable names DB_TIMETABLE_CLIENT_ID / DB_TIMETABLE_CLIENT_SECRET are still
accepted as a fallback for backward compatibility, but the DB_OPENBOARDS_* names above are the
primary ones.
Add to your MCP client
Replace /absolute/path/to/deutschebahn_mcp with the path where you cloned this repo, and
fill in your own credentials.
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"deutschebahn": {
"command": "node",
"args": ["/absolute/path/to/deutschebahn_mcp/dist/index.js"],
"env": {
"DB_OPENBOARDS_CLIENT_ID": "your-client-id",
"DB_OPENBOARDS_CLIENT_SECRET": "your-client-secret"
}
}
}
}Claude Code (.mcp.json in your project, or claude mcp add):
{
"mcpServers": {
"deutschebahn": {
"command": "node",
"args": ["/absolute/path/to/deutschebahn_mcp/dist/index.js"],
"env": {
"DB_OPENBOARDS_CLIENT_ID": "your-client-id",
"DB_OPENBOARDS_CLIENT_SECRET": "your-client-secret"
}
}
}
}Cursor (.cursor/mcp.json):
{
"mcpServers": {
"deutschebahn": {
"command": "node",
"args": ["/absolute/path/to/deutschebahn_mcp/dist/index.js"],
"env": {
"DB_OPENBOARDS_CLIENT_ID": "your-client-id",
"DB_OPENBOARDS_CLIENT_SECRET": "your-client-secret"
}
}
}
}Generic mcp_servers-style config (e.g. Hermes Agent):
mcp_servers:
db_openboards:
command: node
args: ["/absolute/path/to/deutschebahn_mcp/dist/index.js"]
env:
DB_OPENBOARDS_CLIENT_ID: "your-client-id"
DB_OPENBOARDS_CLIENT_SECRET: "your-client-secret"
DB_OPENBOARDS_DEFAULT_STATION: "your-home-station" # optional, see belowSet
DB_OPENBOARDS_DEFAULT_STATIONto whichever station you personally use most — just be aware that your default station lives only in your own private config, not in this repo. This project ships with a neutral example (Frankfurt Hbf) on purpose.
How it works
Station names → IDs: on first use, the server downloads the full German station directory from OpenStation (NeTEx XML, paginated) and caches it locally for 30 days — this keeps you far under the API's daily rate limit. Matching is typo- and umlaut-tolerant (
Koeln→Köln,Tuebingen→Tübingen, no need to typeHbf).Ambiguity handling: if a name matches multiple stations, the server returns the options unless exactly one of them is clearly the main station of that name (same-city satellite stops like
Frankfurt-NiedorFrankfurt (Main) Süddon't block the automatic pick; a different city that happens to share the name, likeFrankfurt (Oder), does).Known DB quirk: a handful of large hubs (e.g. Hamburg, Frankfurt) have two valid EVA numbers for the same station — OpenStation and OpenBoards don't always agree on which one they report. The server tries both automatically when resolving destination/origin names back to text.
Known limitation: destinations outside Germany are not in the OpenStation directory, so they're shown as a raw EVA number instead of a name.
Development
npx tsc --noEmit
npm run buildThis repository ships without a test suite.
License
MIT
Available Tools
3 toolsfindStationBahnhof finden (OpenStation)A
Loest einen Bahnhofsnamen zu seiner Stationskennung auf (ueber die lokal gecachte OpenStation-Liste, tippfehler-/umlauttolerant). Liefert entweder eine eindeutige Station, eine Liste von Optionen bei Mehrdeutigkeit, oder 'nicht gefunden'.
Inputs: name (required).
getArrivalBoardAnkunftstafel (DB OpenBoards)A
Liefert die Ankunftstafel einer deutschen Bahnstation (Zeit, Linie, Herkunft, Gleis, Verspaetung, Ausfall, Hinweise) ueber die DB OpenBoards API. Bahnhofsname wird automatisch aufgeloest - keine EVA-Nummer noetig. Bei mehreren Treffern kommen stattdessen Auswahl-Optionen zurueck.
Inputs: ziel, linie, zugart, station, +2 more.
getDepartureBoardAbfahrtstafel (DB OpenBoards)A
Liefert die Abfahrtstafel einer deutschen Bahnstation (Zeit, Linie, Ziel, Gleis, Verspaetung, Ausfall, Hinweise) ueber die DB OpenBoards API. Bahnhofsname wird automatisch aufgeloest - keine EVA-Nummer noetig. Bei mehreren Treffern (z. B. 'Frankfurt') kommen stattdessen Auswahl-Optionen zurueck.
Inputs: ziel, linie, zugart, station, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools target clearly separate resources: departures, arrivals, and station-name resolution. There is no plausible confusion between them, and findStation is explicitly positioned as a helper for ambiguous station names that the board tools already handle internally.
All names use camelCase with a verb-first pattern (getDepartureBoard, getArrivalBoard, findStation), which is easy to scan. The only minor deviation is get* vs find*, though the distinction is semantically meaningful here.
Three tools are a tight, well-scoped set for a departure/arrival board API, and each earns its place. It sits at the low end of the range, so the surface feels slightly thin for a general Deutsche Bahn server.
Read-only board coverage (departures, arrivals) plus station resolution is coherent, but there is no journey/connection search, which is the core use case of most rail APIs. An agent can check what is leaving or arriving but cannot plan a trip between two stations.
Maintenance
Related MCP Connectors
Belgian trains for AI agents: live journeys, departures, delays, disruptions. Free, no key.
Journeys, departures, line courses, disruptions in Germany; nearby sharing as currently reported.
Cached UK train departures and qualified platforms, powered by National Rail Enquiries.
Swiss trains and public transport: live connections and departures. Official data, free, no key.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides real-time Belgian rail (SNCB/NMBS) data via the iRail API, enabling AI agents to query train schedules and live information.84 npmMIT
- FlicenseNot gradedqualityBmaintenanceWraps four public railway APIs as 13 tools, 7 prompts and 5 resources, enabling an LLM client to answer live questions about station master data, timetables and timetable changes, elevator and escalator outages, and parking facilities and prognoses.2-
- AlicenseNot gradedqualityCmaintenanceLets an AI assistant plan public transport journeys across Germany and other countries, with legs, platforms, delays and alerts, plus stop departures, full trip details, place search, and live DB station boards. Tickets and prices are not included.AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables read-only public-transport station lookup, journey routing with realtime annotations and generated Deutsche Bahn search links, plus current IRIS departure boards by EVA.MIT