transit-mcp
Integrates with the DB Timetables API to provide live station board data for German railway stations, including platform changes and delay information via the db_station_board tool.
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., "@transit-mcpHow do I get from Berlin to Munich tomorrow morning?"
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.
transit-mcp
An MCP server that lets an AI assistant plan public transport journeys the way a journey planner app does. Ask it how to get from A to B, where to change, which platform a train leaves from, whether it is late, or what leaves from a stop next.
It covers Germany and many other countries through Transitous, a free routing service built on open timetables with live updates. For German railway stations, the DB Timetables API adds live platform changes.
Tools
plan_journey: journeys from A to B with every leg, platform, delay and alert. Start and destination can be stop names, addresses, places or coordinates.departures: the next departures or arrivals at a stop.trip_details: every stop of one train or bus run.find_place: search stops, addresses and places when a name is ambiguous.db_station_board: the live DB board of a German railway station with platform changes.
Tickets and prices are not included.
Related MCP server: Zügli MCP Server
Connect an assistant
Add the server as a custom connector with the address https://<your domain>/mcp. The
server has no login, so anyone who knows the address can use it.
Deploy
Every push to main runs the tests, builds the image ghcr.io/zahraabouzeid/transit-mcp and
deploys it over SSH with Docker Compose. The container joins the Docker network web, where
the shared Caddy from the infra repository serves it over HTTPS.
The deploy needs these repository settings:
Variables:
SSH_TARGET(for exampleuser@host),DEPLOY_FOLDERandDOMAIN.Secrets:
SSH_KEY,SSH_KNOWN_HOSTS,DB_CLIENT_IDandDB_API_KEY.
Without SSH_TARGET the deploy step is skipped. Without the DB values the server still runs,
and db_station_board explains that it is not configured.
To get the DB values, register at the DB API Marketplace, create an application and subscribe it to the Timetables API. The portal shows a Client ID and an API key.
Development
python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
ruff format --check . && ruff check . && python -m pytestRun the server locally with transit-mcp. It listens on port 8000 and serves the MCP
endpoint at /mcp and a health check at /health. Settings come from environment
variables, see .env.example.
Data and attribution
Journey data comes from Transitous and its sources, including OpenStreetMap. Transitous may be used free of charge by open source, non-commercial projects and asks clients to identify themselves, which this server does with its User-Agent. Station board data comes from the Deutsche Bahn Timetables API under CC BY 4.0.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Journeys, departures, line courses, disruptions in Germany; nearby sharing as currently reported.
Belgian trains for AI agents: live journeys, departures, delays, disruptions. Free, no key.
Plan journeys by train, bus, tram, metro and ferry across 42 European countries.
Swiss trains and public transport: live connections and departures. Official data, free, no key.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceProvides unified access to Deutsche Bahn APIs for real-time railway data, station information, timetables, disruptions, parking, and accessibility services.22-
- AlicenseNot gradedqualityDmaintenanceProvides real-time Swiss railway information including departures, connections, train composition, occupancy forecasts, disruptions, and pricing, accessible via natural language in over 100 languages.MIT
- FlicenseAqualityDmaintenanceConnects AI assistants to Swiss Federal Railways (SBB/CFF/FFS) data: train schedules, station search, ticket prices, and direct ticket purchase links.625 npm-
- AlicenseAqualityAmaintenanceEnables AI assistants to access Swiss public transport data including journey planning, real-time departures, disruptions, occupancy forecasts, ticket prices, and train formations via a standardized MCP interface.1138 PyPI8MIT