DB Timetable MCP Server
This server provides access to Deutsche Bahn (German Railway) real-time and planned timetable data, translating the DB API's XML into structured, LLM-friendly JSON.
Get a live station board (
getStationBoard): Merges the planned timetable with all real-time changes into a single, reliable departure/arrival board — the recommended tool for displaying current train information.Get the full current timetable with changes (
getCurrentTimetable): Retrieve real-time arrivals, departures, platform assignments, delays, and cancellations for a station.Get recent changes (
getRecentChanges): Fetch only the latest timetable changes from the last two minutes — ideal for incremental live updates.Retrieve the planned timetable (
getPlannedTimetable): Access static scheduled timetable data for a specific station, date, and hour — useful for future trip planning.Find stations (
findStations): Search for stations by name, EVA number, or DS100 code to look up identifiers needed by other tools.
All tools return structured event data with planned, changed, and effective fields (time, platform, etc.), delay in minutes, cancellation status, and platform-change flags. An optional includeRawXml: true parameter exposes the underlying DB API response.
Handles content licensed under Creative Commons Attribution 4.0 International License (CC BY 4.0), ensuring proper attribution for Deutsche Bahn timetable data.
Provides access to Deutsche Bahn timetable data, including current schedules, planned timetables, schedule changes, and station search functionality through the Deutsche Bahn API.
Supports configuration through .env files for storing API credentials and server settings.
Supports source code management through Git, enabling cloning of the repository.
Runs on Node.js platform (version 18 or higher) for server-side execution.
Uses npm for package management and running server scripts.
Utilizes TypeScript for type-safe development of the MCP server components.
Handles XML data from the Deutsche Bahn API, converting it to more accessible formats.
Click on "Install 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., "@DB Timetable MCP Servershow me current departures from Berlin Hauptbahnhof"
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.
DB Timetable MCP Server
A Model Context Protocol (MCP) server for the Deutsche Bahn Timetable API. The server provides MCP tools and resources for accessing timetable data, station information, and train changes.
Obligation to name:
This project provides Deutsche Bahn timetable data, which is publicly available under the Creative Commons Attribution 4.0 International License (CC BY 4.0) .
Further information about the API and license terms can be found at developers.deutschebahn.com . API requests are subject to the license terms.
Functions
Current timetables : Retrieve current timetable data for a station
Timetable changes : Tracking the latest changes
Planned timetables : Access to planned timetable data for a specific time
Station search : Search for train stations by name or code
Related MCP server: db-mcp
Requirements
Node.js 18 or higher
API credentials for the DB Timetable API (client ID and client secret)
installation
Clone repository:
git clone <repository-url> cd db-mcpInstall dependencies:
npm installCompile TypeScript code:
npm run build
configuration
Create an .env file in the root directory of the project with the following environment variables:
DB_TIMETABLE_CLIENT_ID=deine-client-id
DB_TIMETABLE_CLIENT_SECRET=dein-client-secret
TRANSPORT_TYPE=stdio
PORT=8080
SSE_ENDPOINT=/sse
LOG_LEVEL=infoConfiguration options
DB_TIMETABLE_CLIENT_ID: Client ID for the DB API (required)DB_TIMETABLE_CLIENT_SECRET: Client secret for the DB API (required)TRANSPORT_TYPE: Transport type for the MCP server (stdioorsse, default:stdio)PORT: Port for the SSE server (default:8080)SSE_ENDPOINT: Endpoint for SSE connections (default:/sse)LOG_LEVEL: Logging level (debug,info,warn,error, default:info)
use
Start server
In stdio mode (for CLI testing and debugging):
npm startIn SSE mode (for web clients):
TRANSPORT_TYPE=sse npm startTest with Inspect mode
The server can be tested with the FastMCP Inspector:
npx fastmcp inspect path/to/index.jsMCP tools
The server provides the following tools:
getCurrentTimetable : Retrieves current timetable data for a station
Parameter:
evaNo- EVA number of the station (e.g. 8000105 for Frankfurt Hbf)
getRecentChanges : Retrieves recent changes for a station
Parameter:
evaNo- EVA number of the station (e.g. 8000105 for Frankfurt Hbf)
getPlannedTimetable : Retrieves planned timetable data for a station
Parameter:
evaNo- EVA number of the station (e.g. 8000105 for Frankfurt Hbf)date- Date in YYMMDD format (e.g. 230401 for 01.04.2023)hour- hour in HH format (e.g. 14 for 2 p.m.)
findStations : Searches for stations using a search pattern
Parameter:
pattern- search pattern (e.g. "Frankfurt" or "BLS")
MCP resources
The server provides the following resources:
Current timetable data :
db-api:timetable/current/{evaNo}Current timetable changes :
db-api:timetable/changes/{evaNo}Planned timetable data :
db-api:timetable/planned/{evaNo}/{date}/{hour}Station search :
db-api:station/{pattern}
Development
Project structure
db-mcp/
├── src/
│ ├── api/ # API-Client und Typen
│ ├── tools/ # MCP-Tools
│ ├── resources/ # MCP-Ressourcen
│ ├── utils/ # Hilfsfunktionen
│ ├── config.ts # Konfiguration
│ └── index.ts # Haupteinstiegspunkt
├── dist/ # Kompilierte Dateien
├── .env # Umgebungsvariablen
├── package.json
├── tsconfig.json
└── README.mdNPM scripts
npm run build: Compiles the TypeScript codenpm start: Starts the servernpm run dev: Starts the server in development mode with automatic reloadingnpm test: Runs tests
Extensibility
Potential extensions
Data processing and enrichment
Semantic timetable data processing: XML to structured JSON with semantic enrichment
Historical data analysis for delays and disruptions
Integration of multimodal transport connections
Advanced MCP tools
Route planning between stations
AI-based delay and capacity forecasts
Travel disruption analysis
Accessibility check for stations and connections
License
MCP Server: MIT License
DB Timetable API: Creative Commons Attribution 4.0 International License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceProvides unified access to Deutsche Bahn APIs for real-time railway data, station information, timetables, disruptions, parking, and accessibility services.18
- AlicenseAqualityBmaintenanceAn MCP server that exposes the Deutsche Bahn public transport API to any MCP-compatible client (Claude Desktop, Cursor, Cline, Continue, etc.). Five tools cover station search, departures, journey planning, trip details, and nearby stations.6MIT
- FlicenseAqualityDmaintenanceMCP server for querying German public transport information, including station search, live departures/arrivals, and journey planning.5
- AlicenseAqualityDmaintenanceProvides access to Deutsche Bahn's timetable data through MCP, enabling real-time train schedules, station search, and change tracking for German railway stations.485MIT
Related MCP Connectors
BGG MCP provides access to the BoardGameGeek API through the Model Context Protocol, enabling retr…
Swiss Transport MCP — wraps Transport Open Data API (free, no auth)
iRail MCP — Belgian rail (SNCB/NMBS) real-time via the community iRail API
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jorekai/db-timetable-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server