transport-gzm
transport_gzm
MCP server wrapping the GTFS-RT live transit feed for GZM (Górnośląsko-Zagłębiowska Metropolia) — the Silesian Metropolis public transport operator in Poland.
Provides a small, focused set of tools so AI agents can answer questions like:
"What buses/trams are currently running on route X?"
"Is vehicle Y delayed? Where is it right now?"
"What alerts are currently active (delays, disruptions, works)?"
"When does the next departure of line 6 arrive at stop Z?"
How it works
GZM publishes a public GTFS-RT feed at
https://gtfsrt.transportgzm.pl:5443/gtfsrt/gzm (no auth, CC-BY licensed).
It exposes three logical sub-feeds:
Path | Content |
| full bundle (all three sub-feeds) |
| live GPS positions of every vehicle |
| arrival-time deltas and stop-skips |
| service alerts (works, delays, etc.) |
This server fetches the protobuf, decodes it, and exposes it as 9 tools that return JSON-friendly structures sized for LLM context windows.
Static GTFS join (why it matters)
The GZM GTFS-RT feed is minimal: trip descriptors carry only a trip_id
(no route_id), and stop-time updates carry only relative delays — no
absolute times and no stop_id. To answer "which line is this bus" or
"when does the next tram leave stop X", the server additionally loads:
Static GTFS — daily mirror at
github.com/TransportGZM-GTFS-mirror/TransportGZM-GTFS-extended-ver(same id space as the RT feed; verified). Downloaded once and cached forGZM_STATIC_TTL_HOURS(default 24 h).SDIP live departures — GZM's own passenger-information system behind
rj.transportgzm.pl, which powers the real departure boards. The stop directory (/api/v2/stops/data/, ~7 150 poles) is coordinate-matched to GTFS stops at load time.
Quick start
Run with Docker (recommended)
docker run -i --rm ghcr.io/wiktor102/transport-gzm:latestWire it into your MCP client (Claude Desktop, opencode, …):
{
"mcpServers": {
"transport-gzm": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/wiktor102/transport-gzm:latest"]
}
}
}Run from source
pip install -e .
transport-gzm…or with uv:
uv run --with mcp[cli] --with gtfs-realtime-bindings --with httpx \
python -m transport_gzm.serverTools
Tool | Purpose |
| Check feed availability + report feed age |
| Counts of vehicles, trips, alerts currently in the feed |
| Search/filter live vehicle positions (by route, stop) |
| Get a single vehicle's current position |
| Arrival predictions; filter by route, stop, or trip |
| Live departure board per stop (GZM SDIP, minutes) |
| Find stops by name → |
| Active service alerts (works, delays, detours) |
| One alert by id |
See docs/tools.md for full parameter documentation and
output schemas.
Configuration
Env var | Default | Purpose |
|
| Override the base URL |
|
| HTTP timeout in seconds |
|
| In-process feed cache TTL in seconds |
|
| Default cap for |
|
| Default cap for |
|
| Default cap for |
|
| Outgoing UA |
| GitHub mirror ZIP of the extended GTFS | Static schedule source (must share the RT trip-id space) |
|
| SDIP stop directory |
|
| Live departures board base URL |
|
| How long to cache the static GTFS index |
|
| Max distance for rj→GTFS stop matching |
|
|
|
License
MIT. GTFS-RT data © Górnośląsko-Zagłębiowska Metropolia, CC-BY 4.0.