CLI and MCP server for public transport departures, connections, delays and cancellations
258
CLI and MCP server for public transport connections and departures, using the Transitous API (MOTIS 2).
It is built for callers that check fixed daily trips, like a script or an agent asking every few minutes in the morning whether the usual train still runs. For each connection it reports scheduled and actual times, delays, cancellations and alerts, and sums them up in one status: ok, delayed, cancelled, unreachable (a transfer can no longer be made) or no_realtime. A cancelled connection stays in the result, marked as cancelled, instead of silently dropping out.
Source, documentation and releases: github.com/udondan/transitous
Transitous is run by volunteers and asks every client to name a contact in its User-Agent. Pass yours in TRANSITOUS_CONTACT (a URL, mailto: URL or email address). Without it, no request is sent and every answer is contact_missing.
Without a command, the image starts the MCP server on stdio:
docker run --rm -i -e TRANSITOUS_CONTACT=mailto:[email protected] udondan/transitous
In Claude Code:
claude mcp add transitous -- docker run --rm -i \
-e TRANSITOUS_CONTACT=mailto:[email protected] udondan/transitous
In the configuration of another MCP client:
{
"mcpServers": {
"transitous": {
"command": "docker",
"args": ["run", "--rm", "-i", "-e", "TRANSITOUS_CONTACT", "udondan/transitous"],
"env": { "TRANSITOUS_CONTACT": "mailto:[email protected]" }
}
}
}
| Tool | Returns |
|---|---|
transitous_find_stop | Stops by name, with their IDs |
transitous_departures | The next departures or arrivals at a stop |
transitous_trip | Connections between two places, each with its status and reasons |
transitous_journey | A trip with all its stops |
All tools are read-only. Stop names and alert texts from the API are data, not instructions, and the server tells the model so.
With a command, the image runs the CLI. Its output is JSON unless a terminal is attached; -t or -o text gives text:
docker run --rm -t -e TRANSITOUS_CONTACT=mailto:[email protected] \
udondan/transitous departures de-DELFI_de:06412:1_G --count 3
Commands: stops, departures, trip, journey, usage, config and mcp. See the README for their options.
Times without an offset, like 07:50 or 2026-11-30T06:00, are read at the stop, in its time zone, the same one the output uses. The container needs no TZ.
mcp --http serves streamable HTTP at /mcp. It needs a bearer token of at least 16 characters in TRANSITOUS_MCP_TOKEN:
docker run -d --name transitous -p 127.0.0.1:8080:8080 \
-e TRANSITOUS_CONTACT=mailto:[email protected] \
-e TRANSITOUS_MCP_TOKEN="$(openssl rand -hex 32)" \
udondan/transitous mcp --http 0.0.0.0:8080
It serves plain HTTP; put a TLS proxy in front of it to reach it over a network.
The cache and the counter of the usage limits live in /home/transitous. Mount a volume there to keep them across containers:
docker run --rm -i -v transitous:/home/transitous \
-e TRANSITOUS_CONTACT=mailto:[email protected] udondan/transitous
transitous follows the usage rules of Transitous: every request carries a User-Agent with your contact, nothing is retried, answers are cached, at most 20 requests per minute go out, and connection searches are limited to 720 per 24 hours by default.
The image carries the labels of the Docker MCP Toolkit. A server definition is in docker-mcp.yml; set the secret transitous.contact with docker mcp secret set.
latest: the latest release1, 1.0, 1.0.0: the latest release of a major or minor version, or an exact releaseImages are built for linux/amd64 and linux/arm64, run a static binary on Alpine as an unprivileged user (UID 10001), and are signed with cosign:
cosign verify udondan/transitous \
--certificate-identity-regexp '^https://github.com/udondan/transitous/' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
Timetable and realtime data come from the sources listed by Transitous. Map data © OpenStreetMap contributors. Transitous is a community project run by volunteers, without any guarantee; this project is not affiliated with it.
Licensed under Apache-2.0.
Content type
Image
Digest
sha256:9209cbaeb…
Size
10.7 MB
Last updated
about 1 hour ago
docker pull udondan/transitous