Skip to main content
Glama
db-timetables-mcp
by kukshaus

db-timetables-mcp

MCP server for live Deutsche Bahn station boards. Ask Claude (or any MCP client) things like:

  • "When does the next train leave Dresden Hbf?"

  • "Is the ICE to Berlin from Leipzig delayed?"

  • "Any platform changes or cancellations at Köln Hbf in the next 2 hours?"

It uses the official DB Timetables API and merges the planned timetable with the live changes feed. It is read-only.

Tools

Tool

What it returns

find_station

Station name → EVA number and DS100 code

departures

Departure board: planned and expected time, delay, platform (and if it changed), cancellations, disruption messages, route

arrivals

Same data for arrivals, with the origin of each train

departures and arrivals accept a station name or an EVA number, an optional start time (local Berlin time in ISO format, default now), hours (1–6) and limit.

Related MCP server: irail-mcp

Setup

  1. Create a free account at developers.deutschebahn.com, create an application and subscribe it to the Timetables API (the free plan allows 60 calls/min).

  2. Copy your Client ID and Client Secret (API Key).

  3. Add the server to your MCP client.

Claude Code

git clone https://github.com/kukshaus/db-timetables-mcp.git
claude mcp add db-timetables -s user \
  -e DB_CLIENT_ID=your-client-id -e DB_API_KEY=your-api-key \
  -- uv --directory /path/to/db-timetables-mcp run db-timetables-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "db-timetables": {
      "command": "uv",
      "args": ["--directory", "/path/to/db-timetables-mcp", "run", "db-timetables-mcp"],
      "env": { "DB_CLIENT_ID": "your-client-id", "DB_API_KEY": "your-api-key" }
    }
  }
}

On macOS you can keep the keys out of config files and store them in the Keychain instead. The server reads them when the env vars are missing:

security add-generic-password -s db-api-client-id -a "$USER" -w 'your-client-id'
security add-generic-password -s db-api-key -a "$USER" -w 'your-api-key'

Example output

22:12  RE 50     → Leipzig Hbf        platform 9
22:18  S 2       → Dresden Flughafen  platform 14
22:22  TLX 76537 → Görlitz            platform 14

Development

uv sync
uv run pytest

Limits

  • Covers stations operated by DB Station&Service (all major German stations).

  • No journey planning (A → B with transfers). The Timetables API is per station.

  • The free plan allows 60 requests/min. One board for 1 hour costs 2 requests.

License

MIT. Not affiliated with Deutsche Bahn AG. Data © DB Station&Service AG via the DB API Marketplace.

Available Tools

3 tools
arrivalsArrivalsB
Read-only

Arrival board with live delays, platform changes, cancellations and messages.

Inputs: station (required), hours, limit, start. Returns: object

departuresDeparturesA
Read-only

Departure board with live delays, platform changes, cancellations and messages.

Inputs: station (required), hours, limit, start. Returns: object

find_stationFind StationB
Read-only

Find German railway stations by name. Returns name, EVA number and DS100 code.

Inputs: query (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: one resolves station names to identifiers, one returns outbound departures, one returns inbound arrivals. There is no plausible way an agent would misselect among them.

    Naming Consistency3/5

    find_station follows a verb_noun pattern while departures and arrivals are bare plural nouns, so the convention is mixed. The names are still unambiguous and readable, but there is no single predictable pattern an agent can rely on.

    Tool Count4/5

    Three tools is on the thin side, but for a narrow live-board service each tool earns its place, and the station lookup is a necessary prerequisite for the two board tools. It is slightly minimal rather than bloated.

    Completeness3/5

    Station lookup plus live departure and arrival boards cover the core lookup flow, but the surface has notable gaps for a 'timetables' domain: no journey/connection planning, no scheduled timetable for a specific train, and no way to query a board by station ID without re-searching. Agents needing trip planning will hit a dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers