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.
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.
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
}
}
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."
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.
Argument
Type
What it does
origin
object, required
{"query": "Penn Station"}, {"ref": …} or {"latitude": …, "longitude": …}
destination
object, required
Same shapes as origin.
departAt
string
ISO time to leave. Defaults to now.
accessibility
string
step_free: only platforms reachable without stairs, avoiding elevators that are out right now.
maxWalkMetres
number
Walking at each end and between rides. Capped at 800.
maxTransfers
integer
The most changes you'll accept.
routes
array
Route 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.
Argument
Type
What it does
stop
string
A station name. Or give stopRef.
toStop
string
Only trips that go on to this stop, each with its arrival time there. Or give toStopRef.
at
string
ISO time to look from. Defaults to now.
windowSeconds
integer
How far ahead to look, up to 604800 (seven days).
routeRefs
array
Only these lines, as refs from find_transit.
selection
string
first (the default) or last, for the last train of the night.
limit
integer
1 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.
Argument
Type
What it does
query
string
A name: station, stop, line, agency or train number. Leave out coverage to search every region.
ref
string
Inspect one thing exactly: a stop's lines, a line's stops, a trip's calls.
latitude, longitude
number
Stops near a point.
limit
integer
How 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.
Argument
Type
What it does
ref
string
A line's name ("L", "Red Line") with coverage, or a stop, route, agency or dated trip ref.
stop
string
A station name. A station covers its whole complex.
itinerary
object
An 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.
Argument
Type
What it does
ref
string
A route ref, a tripInstanceRef from a departure or itinerary, or a stop ref.
stop
string
A station name. Or give ref.
limit
integer
How 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.
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:
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:
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 nullminutesAway 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.
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
Piece
Job
Worker
The front door. Serves the site and the MCP endpoint, and runs the tools.
Durable Objects
One coordinator per live feed. Each polls its agency and keeps the latest snapshot in memory, so a question never waits on the agency.
R2
The timetable pieces. Each one is named after its own checksum and checked on every read.
Workflows
Timetable builds, one step per service day, so a big feed never has to fit in a single request.
Analytics Engine
Usage counts, described below.
Rollback
The 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.
Public feeds, no key needed. MTA Bus Time uses the server's bus key.
What
Source
Freshness
Subway timetable (main tools)
MTA's supplemented GTFS, which includes planned service changes
Checked 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 timetable
30 sec
LIRR and Metro-North (main tools)
MTA GTFS timetables, lirr/gtfs-lirr, mnr/gtfs-mnr and their alert feeds
Timetables 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 Time
Timetables checked hourly; live 1 to 2 min
Elevators and escalators (main tools)
nyct_ene.json outages and equipment lists
5 min
Arrivals (older tools)
nyct/gtfs* GTFS-realtime feeds
Cached 30 sec
Alerts (older tools)
camsys/subway-alerts.json
Read live
Stations, routes, transfers (older tools)
Bundled MTA station, route and transfer records
Shipped with the code
511 SF Bay: regional transit
Transit data provided by 511 SF Bay and participating Bay Area operators.
What
Source
Freshness
Timetable
Regional GTFS (operator RG)
Checked every 12 hours; built and reviewed offline before it goes live
Arrivals
GTFS-realtime trip updates
About every 2 min
Alerts
GTFS-realtime service alerts
About every 15 min
Vehicles
GTFS-realtime vehicle positions
About 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.
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
Type
Name
What it does
Resource
transit://stations/{city}/{id}
Station metadata with coordinates, lines, address and transfers.
Resource
transit://routes/{city}/{id}
Route metadata. NYC has rich route records; DC route detail isn't there yet.
Resource
transit://incidents/{city}
The city's current incidents.
Prompt
service-briefing
Summarizes current incidents for a whole system or one line.
Prompt
commute-planner
Resolves stations, checks arrivals and incidents, and plans the route.
Prompt
accessibility-check
Uses 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."