Docs for the live transit MCP.

Transit MCP lets an AI answer transit questions in New York, Washington DC and the SF Bay Area from the agencies' own timetables and live train data. You point your client at one URL. There's no key and no account. This page covers setup, the tools, how the thing works underneath, and where the data comes from.

Connect an MCP client

The endpoint is anonymous Streamable HTTP. No login is required, and no token or OAuth flow is required either. If your client sends an old Authorization header, it's ignored.

Claude Desktop / Cursor config
{
  "mcpServers": {
    "transit-mcp": {
      "url": "https://transitmcp.com/mcp"
    }
  }
}

Claude Code

claude mcp add --transport http transit-mcp https://transitmcp.com/mcp

Codex CLI

codex mcp add transit-mcp https://transitmcp.com/mcp

Anything else

Name transit-mcp, URL https://transitmcp.com/mcp, transport streamable-http. It's also listed in the ChatGPT and Claude directories, and in the official MCP Registry as com.transitmcp/transit-mcp.

Agent skill

SKILL.md tells an agent which tool answers which question, what to do when a name means two places, and how to recheck a trip before the rider leaves.

Your first answer

One question from start to finish. The response is what the server actually returned on Saturday, October 24, trimmed to the fields that matter.

A rider asks:

"When's the next train from 14 St on the 1 to Times Square?"

The agent calls get_departures with the rider's own words, without looking anything up first. toStop keeps only trains that go on to Times Square, so the 1, 2 and 3 all count.

tools/call
{
  "name": "get_departures",
  "arguments": {
    "coverage": "nyc",
    "stop": "14 St on the 1",
    "toStop": "Times Sq-42 St",
    "limit": 2
  }
}

The server answers:

structuredContent, trimmed
{
  "status": "realtime",
  "asOf": "2026-10-24T16:45:47.520Z",
  "departures": [
    {
      "routeName": "2",
      "headsign": "Wakefield-241 St",
      "stopName": "14 St",
      "scheduledTime": "2026-10-24T12:45:30-04:00",
      "predictedTime": "2026-10-24T12:50:15-04:00",
      "status": "realtime",
      "arrival": {
        "stopName": "Times Sq-42 St",
        "scheduledTime": "2026-10-24T12:49:00-04:00",
        "predictedTime": "2026-10-24T12:53:45-04:00"
      },
      "stepFree": "accessible",
      "tripInstanceRef": "tr:nyc:mta_subway:trip:TDBTMi0y…:20261024:MTI6MDk6MzA"
    }
  ],
  "sources": [
    { "feedId": "mta_subway", "kind": "trip_updates", "ageSeconds": 22.5 }
  ]
}
status
realtime means live predictions were applied. The other values are scheduled_only (timetable only) and unavailable. Each departure has its own status too, because one train can be tracked live while the next one isn't.
scheduledTime, predictedTime
Local time with the agency's offset. This 2 train was due at 12:45 and is predicted at 12:50. predictedTime is null when there's no live prediction for that train.
arrival
When the train gets to toStop.
asOf, sources
When the answer was read (in UTC), and how old each feed was. The live feed here was 22 seconds old.
tripInstanceRef
This exact run of this train. Pass it to get_vehicle_status later to ask whether it's on time.
stepFree
accessible, not_accessible or unknown for the station you board at.

The agent replies:

"A 2 train leaves 14 St at 12:50, about five minutes late, and gets to Times Sq-42 St at 12:54. That's live from the MTA as of 12:45."

Timetable store (R2)built ahead: 9 days in 3-hour bandsFeed coordinatorpolls MTA every 30 sname index · 16 MB3 bands · 4.8 MBsnapshot · 0.6 sRider's words“14 St on the 1”Resolve the name14 St (1, 2, 3)Read timetabletrips due around 13:20Apply live datamatched trip by tripAnswerstatus: realtime, asOf
What the server did to answer the call above, from its own timing log. The timetable is built ahead of time and the live feed is polled all the time, so the call only reads. On a server that hadn't answered for New York recently, it read 25 MB in 14 reads and took 4 to 5 seconds, most of it loading the name index. A server that has answered recently keeps that in memory.

Tools

There are 18 Model Context Protocol tools. All of them are read-only and return structured content, plus the same thing as JSON text for older clients. These five handle nearly everything, in all three regions. coverage is nyc, dc or sfbay, and you can leave it out whenever a name or ref already says the region.

plan_trip

"Penn Station to JFK"

Real itineraries from the timetable, with live times where there are some. A separate validator checks every leg before anything comes back. Each itinerary also has plain steps (walk here, ride this, get off there) for reading out to a rider.

ArgumentTypeWhat it does
originobject, required{"query": "Penn Station"}, {"ref": …} or {"latitude": …, "longitude": …}
destinationobject, requiredSame shapes as origin.
departAtstringISO time to leave. Defaults to now.
accessibilitystringstep_free: only platforms reachable without stairs, avoiding elevators that are out right now.
maxWalkMetresnumberWalking at each end and between rides. Capped at 800.
maxTransfersintegerThe most changes you'll accept.
routesarrayRoute refs from find_transit, up to four, to plan along only those lines. Use it after a routeHints answer.

get_departures

"Next train from 14 St to Times Square"

The next trains or buses at a place. A name covers the whole place: all four stations at Times Sq-42 St, or stations a short walk apart. In New York, rerouted trains and trains missing from the timetable show up too, marked as observed.

ArgumentTypeWhat it does
stopstringA station name. Or give stopRef.
toStopstringOnly trips that go on to this stop, each with its arrival time there. Or give toStopRef.
atstringISO time to look from. Defaults to now.
windowSecondsintegerHow far ahead to look, up to 604800 (seven days).
routeRefsarrayOnly these lines, as refs from find_transit.
selectionstringfirst (the default) or last, for the last train of the night.
limitinteger1 to 100, default 20.

find_transit

"Which Union Station?"

Finds stations, lines, agencies and train numbers, and says what each one is (a station, a platform or a street stop, with its modes and lines). Called with no arguments, it lists the regions and what each one supports. You rarely need it first, since the other tools all take names.

ArgumentTypeWhat it does
querystringA name: station, stop, line, agency or train number. Leave out coverage to search every region.
refstringInspect one thing exactly: a stop's lines, a line's stops, a trip's calls.
latitude, longitudenumberStops near a point.
limitintegerHow many candidates to return.

get_service_status

"Is the Red Line OK?"

Alerts, plus elevator and escalator outages, for a station, a line or a whole region. It also rechecks a planned trip before the rider leaves.

ArgumentTypeWhat it does
refstringA line's name ("L", "Red Line") with coverage, or a stop, route, agency or dated trip ref.
stopstringA station name. A station covers its whole complex.
itineraryobjectAn itinerary exactly as plan_trip returned it. The answer says whether the journey still holds, and which change would be missed if not.

get_vehicle_status

"Where's my train?"

Where trains are on a line, on one trip, or at a station. Each train reports the station it's at or heading to, the one it last served, and where it's going. DC trains report GPS. MTA reports stations instead, so an NYC train between stations has no position rather than a made-up one.

ArgumentTypeWhat it does
refstringA route ref, a tripInstanceRef from a departure or itinerary, or a stop ref.
stopstringA station name. Or give ref.
limitintegerHow many trains to return.

Using the results

Say where the answer came from

Every result says whether it's realtime, scheduled_only or unavailable, and when it was read (asOf). Pass that on to the rider. "Scheduled for 12:45" and "arriving at 12:50" are different promises, and someone standing on a platform should know which one they're getting. When there's no live data, the server says scheduled_only. It never passes a timetable off as live.

13:2013:2513:3013:3513:40asOf 13:201238 St−0:412Wakefield-241 St+2:033Harlem-148 St+0:321238 St+0:082Wakefield-241 St−1:153Harlem-148 St+0:16scheduledTimepredictedTime
The real board at 14 St, read at 13:20 on October 24 (times in New York). Each tick is the timetable and each dot is the live prediction, between 41 s early and 2 min 3 s late. Every train here had a prediction, so each is realtime. A train without one keeps only its tick: predictedTime is null and its status is scheduled_only.

Use the rider's words, not IDs

Every tool takes names, and the server does the matching. "Street" and "St" are the same, "42nd Street Times Square" finds Times Sq-42 St, small typos still land, and DC stations answer to WMATA's own names ("Chinatown", "Convention Center"). A city or a line after the name narrows it down: "Powell St, SF", "14 St on the 1", "Metro Center DC". Refs like tr:nyc:mta_subway:stop:NjI2 are for follow-up calls. They're opaque, so don't try to build one yourself.

When a name is two places

New York has five different 86 St stations. Ask for "86 St" and the server won't guess. It returns ENTITY_AMBIGUOUS with the candidates, described so a rider can choose:

200 mN Q R W1 2 37STimes Sq-42 St: 4 stations, 152 m apartone place → one answer50 m1 2 · A B C D · 4 5 6Manhattan, 0.7 to 2 km apartN WRBrooklyn5 km86 St: 5 stations, 0.7 to 22 km apartfive places → ask the rider which
Same name, different answers, on the real station positions. Stations with the same name count as one place when they're within 200 m of each other or linked by published transfers. Otherwise the server asks.
get_departures · stop: 86 St · isError: true
{
  "code": "ENTITY_AMBIGUOUS",
  "message": "\"86 St\" is 5 different places: 86 St (4, 5, 6, 6X subway); 86 St (A, B, C, D subway); 86 St (1, 2 subway); 86 St (N, W subway); 86 St (R subway). Pick one from the conversation, or ask the rider which; then retry with that candidate's ref or a more specific name.",
  "candidates": [
    { "ref": "tr:nyc:mta_subway:stop:NjI2", "name": "86 St", "stopType": "station", "routeNames": ["4", "5", "6", "6X"] },
    { "ref": "tr:nyc:mta_subway:stop:QTIw", "name": "86 St", "stopType": "station", "routeNames": ["A", "B", "C", "D"] },
    …
  ]
}

Pick one from the conversation (the rider mentioned the 1 earlier, say), or ask them: "the 1, the 4/5/6, or the A/B/C/D?". Then call again with that candidate's ref or a more specific name. A name that covers one place, like Times Sq-42 St's four stations or SFO, never comes back as a question. plan_trip doesn't return this error at all; it plans the best trip from each candidate and labels them.

When nothing matches

A name that matches nothing comes back with an empty candidates list, and the closest names in suggestions. Here's "Galery Plaza" in DC:

find_transit · coverage: dc · query: Galery Plaza
{
  "candidates": [],
  "suggestions": [
    { "ref": "tr:dc:wmata:stop:U1ROX0IwMV9GMDE", "name": "Gallery Place", "modes": ["subway"], "routeNames": ["Green", "Red", "Yellow"] },
    { "ref": "tr:dc:wmata_bus:stop:MTgxMjU", "name": "Galway Dr+Galway Pl", "modes": ["bus"], "routeNames": ["M52"] },
    …
  ]
}

Suggestions are never treated as a match. Check with the rider ("Gallery Place?") before using one. If nothing fits, try the official station name, a nearby landmark, or coordinates.

When plan_trip finds nothing

It returns routeHints: the lines near each end, and any direct lines that serve both. Pick the lines you'd ride (your own knowledge of the network helps here) and call again with up to four of them in routes. The server then finds the real trips, stops, transfers and walks on those lines, and validates them like any other itinerary. This is also how bus trips get planned.

Before the rider leaves

Plans go stale. Call get_service_status with the itinerary exactly as plan_trip returned it, and plan again if it no longer holds. For "is my train on time?", call get_vehicle_status with the ride's tripInstanceRef.

Limits worth knowing

  • Live data covers trains that are running. Ask about tomorrow and you get the timetable, labelled as such.
  • Timetables cover yesterday, today and the next seven days, and departures look at most seven days ahead.
  • In the older tools, a null minutesAway means unknown, not zero.
  • Bay Area live data refreshes every couple of minutes rather than every 30 seconds, because 511 SF Bay gives one hourly request budget to cover every operator.
  • The first question after a quiet spell can take a few seconds longer while a timetable loads. It's slowest in the Bay Area.
  • The Cloudflare Rate Limit binding allows roughly 300 requests per 60-second window per source-IP key per Cloudflare location. Clients behind shared egress IPs share one count, and enforcement is eventually consistent.
  • Each MCP request runs in a request-scoped stateless runtime. It does not support resumability or server push, so if a call drops, make it again.
  • Fares, platform numbers (other than LIRR and Metro-North tracks) and turn-by-turn walking directions aren't in the data. Itineraries say where to walk, not how. Don't make the rest up.

Under the hood

The short version: the server reads timetables it built ahead of time and corrects them with live data. The diagram under Your first answer shows one call doing exactly that.

Two clocks

Every agency publishes two things. A timetable (GTFS) says what's supposed to run. A live feed (GTFS-realtime) says what's actually running. One changes a few times a day and the other every few seconds, so the server handles them separately.

The timetable is built ahead. When an agency publishes a new one, a background job turns it into small pieces: one set per service day, nine days of them, cut into three-hour bands. Nine days covers yesterday (for trains still running after midnight), today and the week ahead. A question about trains around 13:20 reads the bands around that time (three bands, 4.8 MB, in the call above), not the whole week.

The live feed is read all the time. One coordinator per feed polls it (every 30 seconds for the subway) and keeps the latest snapshot in memory. When a question comes in, the live predictions are matched onto timetable trips, one trip at a time.

Fresh timetables on a $5 plan

This runs on Cloudflare's $5 Workers plan, and building timetables is the expensive part: rebuilding the NYC subway takes a couple of minutes of CPU. MTA republishes that timetable roughly every hour, mostly to add planned work for the coming week. Rebuilding every time would use up the whole plan on its own. So the server does four things:

  • If an upload's tables haven't changed, it's skipped. The server compares each table's checksum from the zip's directory, without unzipping anything. MTA does sometimes upload the same tables again.
  • Nothing is rebuilt until the published timetable is three hours old. MTA's hourly uploads nearly always touch the next day or two, so without this the subway would still rebuild every hour.
  • After that, a change that touches yesterday, today or tomorrow is built on the next check. Live trains are matched to today's trips by ID, so those can't wait long. A train added in the meantime still shows up, from the live feed, as one the timetable doesn't have.
  • A change that only touches later days waits up to six hours and goes in with the next batch.

To tell which days a change touches, the server diffs the 6 MB trips file against the published one. That takes about a tenth of a second, once per upload. If it can't tell (a change to stops or calendars, say), it rebuilds straight away.

MTA uploadsabout hourlyTables changed?checksums, no unzipTouches today?± 1 day · diff, 0.1 sBuild9 days, ~140 s CPUValidate, publishSkipsame tables, new zipif noWait up to 6 hthen buildif noRoll backif live matching dropswatchChecked every 5 minutes. A change that touches yesterday, today or tomorrow waits only for the 3-hour minimum.
How a new NYC subway timetable goes live. The two dashed boxes are the cheap checks that save the expensive build: in the last day sampled, one upload in three was the same tables in a new zip, and every change was to planned work two or more days out.

Checking its own work

  • Every itinerary goes through a separate validator before it's returned: real trips, real stops, transfers you can actually make.
  • A new timetable is checked before it goes live. One that would remove most of a day's service is refused. If live trains match it worse than the one it replaced, it's rolled back.
  • Every other day the server calls its own tools the way an agent would. If anything fails, it checks again every hour until it passes. The latest result is at GET /health/deep.
  • From outside Cloudflare, a GitHub Action calls the endpoint every five minutes and opens an issue if it stays down.

What runs where

PieceJob
WorkerThe front door. Serves the site and the MCP endpoint, and runs the tools.
Durable ObjectsOne coordinator per live feed. Each polls its agency and keeps the latest snapshot in memory, so a question never waits on the agency.
R2The timetable pieces. Each one is named after its own checksum and checked on every read.
WorkflowsTimetable builds, one step per service day, so a big feed never has to fit in a single request.
Analytics EngineUsage counts, described below.
RollbackThe inactive MetroMcpAgent rollback class and v1 migration stay deployed, so the previous server can be brought back quickly.

What gets recorded

One record per tool call: the tool, a rough category for the client software, how long it took, whether it worked, and which regions and feeds the answer drew on (nyc, mta_subway). Never what you asked, and never your IP. The privacy page has the full list.

Data sources

Everything comes from the agencies' official feeds. The five main tools use each agency's GTFS timetable, built as described under the hood, plus GTFS-realtime feeds polled every 30 seconds to a few minutes. The 511 SF Bay feed shares one hourly request budget across every operator, so the Bay Area refreshes more slowly than New York or DC. The first question after a quiet spell can take a few seconds longer while a timetable loads, longest in the Bay Area.

WMATA: DC Metro and Metrobus

Read with the server's own WMATA API key.

WhatOfficial endpointFreshness
Timetable (main tools)/gtfs/rail-gtfs-static.zip, /gtfs/bus-gtfs-static.zipChecked every 6 hours, rebuilt when the tables change
Live trips, trains, alerts (main tools)/gtfs/rail-gtfsrt-*.pb30 sec to 2 min
Metrobus trips, buses, alerts (main tools)/gtfs/bus-gtfsrt-*.pb1 to 2 min
Stations (older tools)/Rail.svc/json/jStationsCached 1 hour
Rail arrivals (older tools)/StationPrediction.svc/json/GetPrediction/{station}Cached 30 sec
Incidents (older tools)/Incidents.svc/json/IncidentsCached 5 min
Elevator outages (older tools)/Incidents.svc/json/ElevatorIncidentsCached 5 min
Bus arrivals (older tools)/NextBusService.svc/json/jPredictionsCached 30 sec
Train and bus positions (older tools)/TrainPositions/TrainPositions, /Bus.svc/json/jBusPositionsCached 10 sec
Bus routes and stops (older tools)/Bus.svc/json/jRoutes, /Bus.svc/json/jStopsCached 30 min to 1 hour

MTA: subway, LIRR, Metro-North and buses

Public feeds, no key needed. MTA Bus Time uses the server's bus key.

WhatSourceFreshness
Subway timetable (main tools)MTA's supplemented GTFS, which includes planned service changesChecked every 5 min. Changes to yesterday, today or tomorrow are built once the timetable is 3 hours old; later days wait up to 6 hours
Live subway trips (main tools)All eight nyct/gtfs* feeds, read together. If one is missing, departures fall back to the timetable30 sec
LIRR and Metro-North (main tools)MTA GTFS timetables, lirr/gtfs-lirr, mnr/gtfs-mnr and their alert feedsTimetables checked every 30 min; live 30 sec to 1 min
Buses (main tools)Borough and MTA Bus Company timetables; predictions, locations and alerts from MTA Bus TimeTimetables checked hourly; live 1 to 2 min
Elevators and escalators (main tools)nyct_ene.json outages and equipment lists5 min
Arrivals (older tools)nyct/gtfs* GTFS-realtime feedsCached 30 sec
Alerts (older tools)camsys/subway-alerts.jsonRead live
Stations, routes, transfers (older tools)Bundled MTA station, route and transfer recordsShipped with the code

511 SF Bay: regional transit

Transit data provided by 511 SF Bay and participating Bay Area operators.

WhatSourceFreshness
TimetableRegional GTFS (operator RG)Checked every 12 hours; built and reviewed offline before it goes live
ArrivalsGTFS-realtime trip updatesAbout every 2 min
AlertsGTFS-realtime service alertsAbout every 15 min
VehiclesGTFS-realtime vehicle positionsAbout every 5 min

Older tools and endpoints

The 13 older tools came first and cover only DC and NYC. They call WMATA's and MTA's APIs directly, and they're still here for clients that use them. New agents should use the five tools above. The Transit Board app view only covers these older tools.

RegionTools
DC and NYCsearch_stations, get_all_stations, get_stations_by_line, get_station_predictions, get_incidents
DC onlyget_elevator_incidents, get_bus_predictions, get_bus_routes, get_bus_stops, get_bus_positions, get_train_positions
NYC onlyget_route_info, get_station_transfers

Ambiguous station names in these tools can trigger MCP elicitation where the client supports it, and get_all_stations sends progress notifications if you pass a progress token. Every tool is annotated read-only, idempotent and open-world.

Resources and prompts

TypeNameWhat it does
Resourcetransit://stations/{city}/{id}Station metadata with coordinates, lines, address and transfers.
Resourcetransit://routes/{city}/{id}Route metadata. NYC has rich route records; DC route detail isn't there yet.
Resourcetransit://incidents/{city}The city's current incidents.
Promptservice-briefingSummarizes current incidents for a whole system or one line.
Promptcommute-plannerResolves stations, checks arrivals and incidents, and plans the route.
Promptaccessibility-checkUses DC elevator outages to flag problems along a route.

HTTP endpoints

POST/mcp

The MCP endpoint, anonymous Streamable HTTP.

POST/OPTIONS/sse

Stateless alias for /mcp. GET /sse returns 405; it isn't a persistent stream.

GET/info

A JSON summary: regions, station counts, capabilities and the MCP endpoint.

GET/health/deep

The latest self-check: each tool call it made, how long it took, and what failed. 200 when it passed recently, 503 otherwise.

GET/llms.txt

A plain-text summary for agents.

GET/, /docs/

The landing page and this page.

Pairs well with

When the commute planner shows delays, your agent can handle the fallout too. call4me is an MCP server that makes real phone calls for you. It can call ahead to tell a restaurant you're running late, reschedule a doctor's appointment, or wait on hold for you. Add it next to Transit MCP in the same client and try something like "trains are delayed, call the restaurant and push my reservation 30 minutes."