Docs for the live transit MCP.

Transit MCP gives your AI the transit data for New York, Washington DC and the SF Bay Area through MCP tools, resources, and prompts. This page covers setup, endpoints, what each tool does (and doesn’t), and where the data comes from.

Connect an MCP client

The production MCP endpoint is anonymous Streamable HTTP. No login is required. No client credentials, token, or OAuth flow is required; stale Authorization headers are ignored.

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

Codex CLI

Add the same anonymous Streamable HTTP endpoint from a terminal.

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

Generic client

Use name transit-mcp, URL https://transitmcp.com/mcp, and transport streamable-http.

HTTP endpoints

The Worker serves both the public website and anonymous MCP API. MCP traffic, metadata, and static pages are public.

GET/

Landing page.

GET/docs/

This documentation page.

GET/info

JSON server summary: supported cities, station counts, capabilities, and MCP endpoint.

POST/mcp

Primary anonymous MCP Streamable HTTP endpoint.

POST/OPTIONS/sse

Stateless alias for /mcp. GET /sse returns 405; it is not a persistent stream.

MCP tools

Every tool is read-only and returns structured content plus serialized JSON text for older clients. Station-name tools search first, and ambiguous matches can trigger MCP elicitation where the client supports it.

Station discovery

search_stations, get_all_stations, and get_stations_by_line cover both DC and NYC. Results include IDs, names, lines, coordinates, and addresses when available.

Arrivals

get_station_predictions resolves a station name or code and returns line, destination, minutes away, arrival time, status, cars, direction, and track where the feed provides it.

Service state

get_incidents works for DC and NYC. get_elevator_incidents is DC-only and returns unit, station, symptom, outage time, estimated return, and update time.

DC bus and rail operations

get_bus_predictions, get_bus_routes, get_bus_stops, get_bus_positions, and get_train_positions expose WMATA bus arrivals, route catalogs, stop search, live buses, and live train positions.

NYC route detail

get_route_info returns route names and service descriptions. get_station_transfers returns platform and nearby transfers with walk times in seconds and minutes.

Trip planning and departures

All three regions serve the five global tools: find_transit, plan_trip, get_departures, get_service_status, and get_vehicle_status. Trips are planned from each agency's published timetable with live predictions applied, and every itinerary is checked by an independent validator before it is returned.

get_departures takes a station name or a reference. A name for one place covers all its stations: a complex such as Times Sq-42 St, stations a short walk apart, or a well-known place such as Penn Station or SFO. Different places that share a name, like the several 86 St stations, come back as a question to ask the rider; plan_trip instead returns the best trip from each, labelled. NYC departures include rerouted trains and trains missing from the timetable, marked as observed.

Step-free travel: plan_trip with accessibility: "step_free" only boards, alights and changes at platforms reachable without stairs and avoids stations cut off by a current elevator outage. get_service_status lists elevator and escalator outages for a station, line or city, marking which are on the step-free path and which block it. Station access comes from WMATA's GTFS and MTA's station list, including stations accessible in one direction only.

New York also covers the Long Island Rail Road, Metro-North and NYC buses, and Washington covers Metrobus. Journeys use every mode, buses included, and change between lines on foot at stations such as Penn Station, Grand Central and Atlantic Terminal; LIRR and Metro-North departures show the track.

Guided planning: if plan_trip can’t find a journey on its own, it returns routeHints, the lines near each end and the direct lines that serve both. Pick the lines you’d ride and call it again with up to four of them in routes. The server finds the actual trips, stops, transfers and walks on those lines and validates them like any other itinerary. Each itinerary comes with plain steps (walk here, ride this, get off there) for reading out to a rider.

Next train from A to B: get_departures with toStop lists only the trips that go on to that stop, each with its arrival time there.

Station search: find_transit ranks stations ahead of street stops and rail ahead of bus, says what each candidate is (station, platform or street stop, modes, lines), and knows a few reviewed place names such as SFO, Union Square, Penn Station, Grand Central and Dulles.

Names work the way people type them. “King Street” finds King St-Old Town, “42nd Street Times Square” finds Times Sq-42 St, small misspellings still land, and DC stations answer to WMATA’s published names (“Chinatown”, “Convention Center”). Leave out coverage and a name is searched in every region; call find_transit with no arguments to list the regions. When nothing matches, suggestions lists the closest names; they are never treated as a match.

Times a rider sees are in the agency’s local time with its offset, such as 18:32-04:00. A first question after a quiet spell still gets live data: the server fetches the agency’s feed for that stop and answers from it.

get_vehicle_status shows where trains are on a line, on a dated trip, or at a station. Each train reports its train ID, the station it is stopped at or heading to, the station it last served, and its destination; find_transit resolves a train ID to that train's trip. DC trains carry GPS coordinates; MTA reports stations rather than coordinates, so an NYC train between stations has none rather than a guessed position.

Results say whether they are realtime, scheduled_only, or unavailable, with source timestamps and reasons. Never piece a journey together from departure boards; use plan_trip. The Transit Board enhancement covers only the 13 legacy tools.

San Francisco Bay Area

The global tools serve departures, service alerts and vehicle locations for every operator in 511 SF Bay's regional feed (Muni, BART, Caltrain, AC Transit, VTA, SamTrans, the ferries and more), and plan_trip plans journeys across all of them. Data attribution remains with 511 SF Bay and participating operators.

Progress and safety hints

get_all_stations emits progress notifications when clients pass a progress token. Tool annotations mark calls as read-only, idempotent, and open-world because they query live transit systems.

Data sources and cache windows

Transit MCP normalizes official agency data into MCP-friendly JSON. The legacy tools call WMATA APIs and MTA feeds directly. The global tools use each agency's published GTFS timetable, rebuilt automatically when a new one appears, plus GTFS-realtime feeds polled every 30 seconds to a few minutes. SF Bay data comes from 511 SF Bay’s regional feed, which shares one hourly request budget across every operator, so it refreshes more slowly than New York or DC. Anywhere, the first call after a quiet spell can take several seconds longer while the timetable loads.

WMATA: DC Metro and Metrobus

Requires the server-side WMATA API key configured in the Worker environment.

CapabilityOfficial endpointCache
Stations/Rail.svc/json/jStations1 hour
Rail arrivals/StationPrediction.svc/json/GetPrediction/{station}30 sec
Incidents/Incidents.svc/json/Incidents5 min
Elevator outages/Incidents.svc/json/ElevatorIncidents5 min
Bus arrivals/NextBusService.svc/json/jPredictions30 sec
Train positions/TrainPositions/TrainPositions10 sec
Bus routes/Bus.svc/json/jRoutes1 hour
Bus stops/Bus.svc/json/jStops30 min
Bus positions/Bus.svc/json/jBusPositions10 sec
Timetable (global tools)/gtfs/rail-gtfs-static.zipChecked every 6 hours, rebuilt on change
Live trips, trains, alerts (global tools)/gtfs/rail-gtfsrt-*.pb30 sec to 2 min polling
Metrobus trips, buses, alerts (global tools)/gtfs/bus-gtfsrt-*.pb1 to 2 min polling

511 SF Bay: regional transit

Regional schedule and realtime feeds for the global tools: departures, alerts and vehicles, plus guided trip planning. Transit data provided by 511 SF Bay and participating Bay Area operators.

CapabilitySourceFreshness
Stops and routesRegional GTFS static artifactVersioned artifact
ArrivalsGTFS-realtime trip updatesAbout every 2 min
AlertsGTFS-realtime service alertsAbout every 15 min
VehiclesGTFS-realtime vehicle positionsAbout every 5 min

MTA: NYC Subway, LIRR, Metro-North and buses

Public feeds are read without a server-side API key.

CapabilitySourceCache
Arrivalsnyct/gtfs* GTFS-realtime protobuf feeds for ACE, BDFM, G, JZ, NQRW, L, numbered lines, and SIR30 sec in-memory
Alertscamsys/subway-alerts.jsonLive fetch
StationsBundled NYC_STATIONS metadataStatic asset in code
RoutesBundled NYC_ROUTES metadataStatic asset in code
TransfersBundled station transfer recordsStatic asset in code
Timetable (global tools)MTA supplemented subway GTFS, which includes planned service changesChecked every 5 min, rebuilt on change
Live trips (global tools)All eight nyct/gtfs* feeds, read together; if one is missing, departures fall back to the timetable30 sec polling
LIRR and Metro-North (global tools)MTA GTFS timetables plus lirr/gtfs-lirr, mnr/gtfs-mnr and their alert feeds30 sec to 1 min polling
Buses (global tools)MTA borough and MTA Bus Company timetables, with predictions, locations and alerts from MTA Bus Time1 to 2 min polling
Elevators and escalators (global tools)nyct_ene.json outages and equipment lists5 min polling

Resources and prompts

Clients that support more of MCP can read resource URIs directly and invoke prompt templates instead of hand-writing tool instructions.

TypeNameWhat it does
Resourcetransit://stations/{city}/{id}Station metadata with coordinates, lines, address, and transfer records.
Resourcetransit://routes/{city}/{id}Route metadata. NYC has rich route records; DC route detail is not implemented yet.
Resourcetransit://incidents/{city}Live per-city incident feed. Read-only in this release.
Promptservice-briefingAsks the model to summarize current incidents for a whole system or line.
Promptcommute-plannerAsks the model to resolve stations, check arrivals, inspect incidents, and produce a route plan.
Promptaccessibility-checkUses DC elevator outages to flag accessibility impacts along a route.

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."

Cloudflare stack

Transit MCP runs as a small Cloudflare application: the edge handles web pages, anonymous MCP requests, lightweight rate limiting, and logs close to the user.

Workers

The Worker is the front door. It serves the site, accepts anonymous MCP traffic, and routes requests to the right part of the app.

Request-scoped runtime

Each MCP request runs in a request-scoped stateless runtime. It does not support resumability or server push.

Rate limiting and rollback

The Cloudflare Rate Limit binding applies roughly 300 requests per 60-second window per source-IP key per Cloudflare location. Shared egress IPs group clients, and enforcement is eventually consistent. The inactive MetroMcpAgent rollback class and v1 migration remain for rollback.

Assets and logs

Cloudflare serves the landing page and docs as static assets, while Worker logs and source maps make production behavior easier to debug after deploys.