A ready-to-use Python MCP server for AI builders developing travel assistants, commuting agents, and route planners. Includes station search, train departures, platform information, and public transport connections across Germany.

The German Public Transport MCP is a Python-based Model Context Protocol (MCP) server that gives AI agents access to German public transport information.
It allows agents to search for train stations and transit stops, check upcoming departures and platform information, find connections between locations, and explore train routes with intermediate stops.
Built using Python and MOTIS 2, this read-only MCP server is a practical starting point for developers building AI-powered travel assistants, commuting agents, and scheduling applications.
You can integrate this MCP server into different AI agent applications, including:
Travel Planning Agents: Find train connections between German cities and explore available journeys.
Commuting Assistants: Check upcoming departures, expected times, and platform information.
Appointment Planning Agents: Help users identify public transport connections when planning meetings.
Public Transport Chatbots: Answer natural-language questions about stations, departures, routes, and transfers.
For example, an AI agent can answer:
“Find the next train connections from Munich to Augsburg, show the departure platforms, and tell me whether updated departure times are available.”
Need help with integration? Feel free to ask your questions in the comments!
The server provides four tools:
Tool | What It Does |
|---|---|
| Find German train stations and transit stops by name. |
| Retrieve upcoming departures, times, and platform information. |
| Find public transport journeys between two stations, including transfers. |
| Retrieve a service's route and intermediate stops. |
These tools can be called by MCP-compatible AI clients and agents.
The project is intentionally lightweight and easy to explore.
src/german_public_transport_mcp/ : Python source code and MCP server implementation.
server.py : Main MCP server and tool definitions.
pyproject.toml : Project dependencies and package configuration.
README.md : Installation instructions, configuration, and usage examples.
banner.webp : Project banner.
The server requires Python 3.10+, uv, and internet access.
You can run it with an MCP-compatible client and configure it using the provided JSON example in the README.
By default, the server connects to the public Transitous MOTIS API. You can also configure your own MOTIS 2 instance using GERMAN_TRANSIT_BASE_URL.
The public Transitous API is intended for lightweight, noncommercial, open-source use and prototype testing. Review the provider's terms before using it in a commercial or production application.
The server provides read-only public transport information. It does not book or purchase tickets.
Scheduled and expected departure times are provided separately. Live estimates may be unavailable.
Connection and departure information depends on the configured MOTIS provider and its available data.
Returned timestamps use ISO 8601 UTC, and explicit time inputs must include a UTC offset.
Once you've explored the implementation, you can extend it with:
Integration into a travel-planning agent using LangGraph or another agent framework.
Support for additional public transport providers or self-hosted MOTIS instances.
Journey comparison based on transfers, departure times, and travel duration.
A conversational travel assistant combining transport information with other MCP tools.
This project is useful for AI engineers, Python developers, MCP developers, and anyone building AI agents that need German public transport data.
It provides a practical, reusable MCP integration that you can study, customize, and extend without building the transport API integration from scratch.