rmv
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., "@rmv Is the 8:10 train from Frankfurt Hauptwache to Mainz delayed or canceled?"
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.
rmv
CLI and MCP server for public transport departures and connections in the Rhein-Main-Verkehrsverbund (RMV), on the RMV OpenData API (HAFAS ReST).
It is built for callers that check fixed daily trips, like a script or an agent asking in the morning whether the usual train still runs. For each connection it reports scheduled and actual times, delays, cancellations and RMV's disruption messages, and sums them up in one status:
Status | Meaning |
| As planned, as far as the realtime data tells |
| The arrival is late, or the departure is off its schedule |
| A ride, or boarding or alighting at a stop of it, is cancelled |
| A transfer can no longer be made, or the first ride has left |
| No realtime data: the times are the timetable |
A cancelled connection stays in the result, marked as cancelled, instead of
silently dropping out. reasons says why, like
{"kind": "transfer_missed", "leg": 2, "margin_minutes": -3}.
docs/status.md
explains the rules.
Contents
Related MCP server: Bay Area Transit MCP
Installation
brew install udondan/software/rmv # macOS and Linux
cargo install rmv # from source
docker pull udondan/rmv # see Docker belowThe releases also have binaries
for Linux (x86_64, aarch64, static), macOS and Windows, each with the shell
completion scripts. SHA256SUMS.txt lists their checksums and is signed with
the GPG key F111A9BDD62F384A:
gpg --verify SHA256SUMS.txt.asc SHA256SUMS.txt
sha256sum --check --ignore-missing SHA256SUMS.txtThe Docker image is signed with cosign by the release workflow:
cosign verify udondan/rmv \
--certificate-identity-regexp '^https://github.com/udondan/rmv/' \
--certificate-oidc-issuer https://token.actions.githubusercontent.comAccess key
Every request to the RMV API needs an access key of your own. No key comes
with rmv, its image or its releases: the
terms of use
make it personal and confidential, and forbid passing it on.
Request one on the RMV OpenData page.
Set it once.
-reads it from standard input, so it stays out of the shell history:rmv config set access_id -RMV_ACCESS_IDsets it for a single run instead.
Without a key, rmv sends no request at all and answers
access_id_missing. A key the API rejects gives access_denied. RMV deletes
keys that have not been used for more than 180 days.
The key is a query parameter of every request, so every URL contains it.
rmv never prints it: not in output, errors or logs, even with -vv.
Shell completion, loaded when the shell starts (bash shown; zsh, fish,
elvish and powershell work the same way):
source <(rmv completion bash)Usage
$ rmv stops Hauptwache
Frankfurt (Main) Hauptwache
3000001
Daten: Rhein-Main-Verkehrsverbund (RMV), https://www.rmv.de/s/de/rmv-open-data
$ rmv departures 3000010 --count 3
Departures at Frankfurt (Main) Hauptbahnhof tief
08:40 +15 S2 → Dietzenbach Bahnhof track 102
! S1, S2: Halt entfällt und Teilausfälle bis 13.12.
08:44 12 → Frankfurt (Main) Rheinlandstraße
08:44 +2 S8 → Offenbach (Main)-Offenbach Ost Ostbahnhof track 102
Daten: Rhein-Main-Verkehrsverbund (RMV), https://www.rmv.de/s/de/rmv-open-data
$ rmv trip 3000010 3000001 --count 2
Frankfurt (Main) Hauptbahnhof tief → Frankfurt (Main) Hauptwache
1. 08:44 +2 → 08:47 +1 2 min, 0 transfers delayed
S8 → Offenbach (Main)-Offenbach Ost Ostbahnhof
08:44 +2 Frankfurt (Main) Hauptbahnhof tief track 102
08:47 +1 Frankfurt (Main) Hauptwache track 2
2. 08:47 → 08:50 3 min, 0 transfers ok
S6 → Darmstadt Hauptbahnhof
08:47 Frankfurt (Main) Hauptbahnhof tief track 101
08:50 Frankfurt (Main) Hauptwache track 2
Daten: Rhein-Main-Verkehrsverbund (RMV), https://www.rmv.de/s/de/rmv-open-dataCommand | Does |
| Finds stops by name, with their IDs (up to 20) |
| The next departures or arrivals at a stop (up to 100) |
| Connections, each with its status (up to 6) |
| A trip with all its stops, by its ID from |
| A connection again, with current data, by its |
| The configuration file |
| The MCP server |
| The completion script |
Stops are given by ID, like
3000010orA=1@L=3000010@, or by a name that fits exactly one stop. A name that fits several givesambiguous_stopwith the candidates and their IDs, never a guess.tripalso takes coordinatesLAT,LON.Times are
HH:MM(always today, in Europe/Berlin, never rolled over to tomorrow), a local time like2026-11-27T07:50, or RFC 3339.trip --arrive 07:50returns the connections arriving last before 07:50, together with earlier ones to switch to.recheckasks RMV for exactly the connection you picked, with the current delays and cancellations. That is the cheapest way to poll a fixed trip: one request, no stop lookups.Pages: results have a
page_cursorwithearlierandlater(for departures onlylater); pass one with--page-cursor.
Modes
--modes takes a comma-separated list of these names, in any case. They
stand for product classes of RMV:
Mode | RMV products | Class |
| ICE | 1 |
| IC, ECE, NJ | 2 |
| RE, RB | 4 |
| S-Bahn | 8 |
| U-Bahn | 16 |
| Tram | 32 |
| Regional and city buses | 64, 128 |
| On-demand services (AST, ALT) | 512 |
| All trains: the first four | 1, 2, 4, 8 |
Results name the mode of each ride the same way, and OTHER for a class not
listed.
Output
-o text|json|yaml chooses the format. JSON is the default when stdout is
not a terminal, so scripts get JSON without asking. Errors are printed in the
same format on stderr, with a stable status, and the exit code is 1 (2 for
invalid arguments):
| Meaning |
| No access key configured; nothing was sent |
| RMV rejected the access key |
| The configuration file or a setting is invalid |
| (MCP) A time, mode or place could not be read; the CLI reports these as usage errors |
| The name fits several stops; see |
| No stop has that name |
| RMV does not know the stop or trip ID |
| The quota of the key is used up, or too many requests came at once; see |
| RMV did not answer, or refused |
Text output always ends with the attribution of the data, which must be
kept. JSON has it as attribution.
Besides the fields of each result, stops and stop events have dhid, the
German stop ID like de:06412:10, and results have realtime_as_of, when
RMV last updated its realtime data.
MCP server
rmv mcp serves five read-only tools to an MCP client on stdin and stdout.
Each has an output schema and returns a one-line summary followed by the
same JSON as the CLI.
Tool | Returns |
| Stops by name, with their IDs |
| The next departures or arrivals at a stop |
| Connections between two places, each with its status and reasons |
| A trip with all its stops |
| A connection from |
For example, in Claude Code:
claude mcp add rmv -e RMV_ACCESS_ID=<your key> -- rmv mcpOr in the configuration of another client:
{
"mcpServers": {
"rmv": {
"command": "rmv",
"args": ["mcp"],
"env": { "RMV_ACCESS_ID": "<your key>" }
}
}
}With the key in the configuration file (rmv config set access_id -), the
env entry is not needed.
The server tells the model that stop names and disruption texts from the API are data, not instructions, and that every call costs requests of the quota.
Agents that use the CLI instead can load the skill in skills/rmv/SKILL.md.
HTTP
rmv mcp --http serves streamable HTTP at http://127.0.0.1:8080/mcp;
--http 0.0.0.0:9000 takes another address. It needs a bearer token of at
least 16 characters in RMV_MCP_TOKEN, which every request must send as
Authorization: Bearer <token>:
export RMV_MCP_TOKEN=$(openssl rand -hex 32)
rmv mcp --http
claude mcp add --transport http rmv http://127.0.0.1:8080/mcp \
--header "Authorization: Bearer $RMV_MCP_TOKEN"The server shuts down cleanly on SIGINT and SIGTERM. It serves plain HTTP; put a TLS proxy in front of it to reach it over a network. It is for your own clients only: the terms of use forbid giving others access through your key.
Docker
The image runs rmv; without a command it starts the MCP server on stdio.
It holds no key and no state, so it needs no volume:
docker run --rm -i -e RMV_ACCESS_ID udondan/rmv
docker run --rm -e RMV_ACCESS_ID udondan/rmv departures 3000010mise run docker-build builds the image from source. For the Docker MCP
Toolkit, mise run docker builds it and adds
docker-mcp.yml to
a profile. Set the secret rmv.access_id with docker mcp secret set.
The server is also in the
MCP Registry as
io.github.udondan/rmv.
Configuration
rmv config path shows the file, by default ~/.config/rmv/config.toml
(%APPDATA% on Windows). rmv config show shows the settings in effect,
with the key masked.
Setting | Default | Meaning |
| – | Your access key |
|
| Another HAFAS ReST server |
| 20 | How long a command may take, retries and waits included |
| 2 | Retries after a transient error, at most 5; |
| 2 | From how many minutes late an arrival counts as |
Variable | Does |
| Overrides |
| Overrides |
| Another configuration file |
| The output format, like |
| Log level, like |
| The bearer token of |
| Evaluate the status as if it were another time, as RFC 3339 like |
https://www.rmv.de/hapi/latest/ runs the next version of the API (2.52),
which RMV offers for testing. rmv works with both versions, but use
latest/ only to try it out.
Requests and quota
An access key may make 600 requests per hour and 5000 per day, shared by
everything that uses it. rmv has no cache and no counter: it cannot see
what else uses your key, so keeping within the quota is up to you. When RMV
reports the quota as used up, the answer is rate_limited.
What a command costs:
one request for the search itself;
one more for every stop given by name instead of ID (
tripwith two names makes three). IDs andLAT,LONcost nothing extra;trip --arrive: one more for an earlier page when the first has too few connections;after a connection error, a timeout or a 500, 502, 503 or 504, up to
retriesmore (2 by default), with waits of about 0.5 and 1 second, all withintimeout_seconds. Errors that RMV reports with a code, like an invalid key, the used up quota or wrong parameters, are never retried. Setretries = 0to make every command cost exactly what is listed above.
Polling one connection every 5 minutes for an hour with recheck costs 12
requests. Never run rmv in a loop without a pause: the terms of use forbid
crawling and bulk downloads.
Merging with other sources
RMV knows cancellations and disruption messages in its area that wider sources often lack, while other sources cover more area. The output uses plain, documented field names so that it can be merged with data from other journey planners; docs/merging.md lists the join keys. How RMV reports realtime data is described in docs/realtime-findings.md.
Crates
Crate | crates.io | docs.rs | Purpose |
Neutral client for the HAFAS ReST API, versions 2.39 and 2.52 | |||
Configuration, access key, retries, stop resolution, status and the output model | |||
Fake HAFAS server for tests | |||
– | The binary: CLI and |
Data and terms
Daten: Rhein-Main-Verkehrsverbund (RMV), from the RMV OpenData API, under the RMV terms of use. They allow the results for passenger information, for the user who asked, and forbid storing or publishing a substantial part of them. RMV can change or end the API at any time.
This project is not affiliated with RMV.
Security and contributing
See SECURITY.md and CONTRIBUTING.md.
License
Apache-2.0. The license covers the code, not the data.
Available Tools
5 toolsrmv_departuresDepartures at a stopARead-onlyIdempotent
Lists the next departures, or with arrivals the arrivals, at one stop in the RMV area from time on: each with mode, line, operator, headsign, planned and realtime time, delay, track, cancellation of the stop or the whole ride, and alerts, and the trip_id for rmv_journey. Use it for what leaves a stop soon; to get from A to B with transfers use rmv_trip, for all stops of one ride rmv_journey. page_cursor.later of the result pages on. Each call costs one request of the access key's quota, and one more for a stop given by name (answer rate_limited with retry_after_seconds when it is used up).
Inputs: stop (required), time, count, modes, +2 more. Returns: stop, arrivals, warnings, departures, +3 more
rmv_find_stopFind a stopARead-onlyIdempotent
Searches stops in the RMV area by name, or a part of it, and returns up to count matches (default 10, at most 20), each with stop ID, name, area, DHID, coordinates and modes; near ranks stops close to a place first. Use it to get a stop ID, or when a name is ambiguous: rmv_departures and rmv_trip also take a name that fits one stop, and answer ambiguous_stop with candidates otherwise. One request of the access key's quota (answer rate_limited with retry_after_seconds when it is used up).
Inputs: name (required), near, count. Returns: query, stops, warnings, attribution
rmv_journeyOne ride with all stopsARead-onlyIdempotent
Returns one ride (a vehicle's trip) in the RMV area with line, operator, headsign, whether it is cancelled, its alerts, and every stop with planned and realtime times, delays, tracks and cancelled stops. Takes the trip_id of a departure from rmv_departures or of a leg from rmv_trip. Use it to follow a train along its route or to see where a delay starts. One request of the access key's quota (answer rate_limited with retry_after_seconds when it is used up).
Inputs: trip_id (required). Returns: line, mode, stops, alerts, +8 more
rmv_recheckCheck a connection againARead-onlyIdempotent
Returns one connection found by rmv_trip again, with current realtime times and its status (ok, delayed, cancelled, unreachable or no_realtime) and the reasons, in the same form as rmv_trip with one connection. Takes the recheck_token of that connection. Use it to follow a planned connection before and during the ride, instead of a new search with rmv_trip. One request of the access key's quota (answer rate_limited with retry_after_seconds when it is used up); ask every few minutes at most.
Inputs: recheck_token (required). Returns: to, from, warnings, attribution, +3 more
rmv_tripConnections from A to BARead-onlyIdempotent
Searches connections in the RMV area between two stops or places, each with departure, arrival, duration, transfers, its legs (with trip_id), a status: ok, delayed, cancelled, unreachable (a transfer is missed or the first ride has left) or no_realtime, with the reasons, and a recheck_token for rmv_recheck. With arrive_by, the connections arriving last before time, and earlier ones to switch to. Use it to plan a route; to check a connection found before use rmv_recheck, for one stop's departures rmv_departures, for one ride with all stops rmv_journey. page_cursor.earlier and later page through more. Each call costs one or two requests of the access key's quota, and one more for each stop given by name (answer rate_limited with retry_after_seconds when it is used up); ask every few minutes at most for the same trip.
Inputs: to (required), from (required), time, count, +5 more. Returns: to, from, warnings, attribution, +3 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct question: departures at one stop, stop lookup, a single ride's route, A-to-B connection search, and rechecking an existing connection. The descriptions explicitly cross-reference each other (e.g. 'to get from A to B use rmv_trip, for all stops of one ride rmv_journey'), making boundaries unambiguous.
All tools share the rmv_ prefix and snake_case, which is predictable. The only minor deviation is mixing noun-style names (rmv_departures, rmv_journey, rmv_trip) with verb-style ones (rmv_find_stop, rmv_recheck), but this remains readable and intuitive.
Five tools is a tight, well-scoped set for a transit API, with each tool earning its place and no redundant entries. Nothing feels thin or bloated.
The surface covers the core lifecycle: find stop, plan trip, inspect ride, watch departures, and recheck a connection. Minor gaps exist (no dedicated alerts/disruption or operator/line lookup tool), but agents can work around these via the alert data embedded in other responses.
Maintenance
Related MCP Connectors
Hosted MCP App, public transport worldwide powered by Transitous: journeys, boards, real time, maps
Journeys, departures, line courses, disruptions in Germany; nearby sharing as currently reported.
Read-only public transit departures, stop search, and city coverage for bus and train users.
NJ Transit rail, bus and PATH schedules via MCP (scheduled, plus live PATH)
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables querying nearby stations and departure boards using the RMV public transport API.1-
- AlicenseNot gradedqualityDmaintenanceEnables querying real-time BART and SF Muni transit data, including departures, trip planning, fares, advisories, routes, alerts, vehicle positions, and schedules, from any MCP-compatible client.1MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to access live Deutsche Bahn timetable data, including connections, departure and arrival boards, platforms, delays, fares, and disruptions, by querying bahn.de directly with no API key.91MIT
- AlicenseAqualityBmaintenanceEnables public-transport journey planning, place search, realtime departures and timetables, usable from any MCP client.9MIT