Skip to main content
Glama

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 example user@host), DEPLOY_FOLDER and DOMAIN.

  • Secrets: SSH_KEY, SSH_KNOWN_HOSTS, DB_CLIENT_ID and DB_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 pytest

Run 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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time Swiss railway information including departures, connections, train composition, occupancy forecasts, disruptions, and pricing, accessible via natural language in over 100 languages.
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Connects AI assistants to Swiss Federal Railways (SBB/CFF/FFS) data: train schedules, station search, ticket prices, and direct ticket purchase links.
    6
    25 npm
    -
  • A
    license
    A
    quality
    A
    maintenance
    Enables 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.
    11
    38 PyPI
    8
    MIT