Transit MCP

com.transitmcp由 transitmcp.com 發布官方發布者v6.1.0更新於 Oct 25, 2026

Trips, departures, alerts and vehicles for NYC, DC and the SF Bay Area.

已驗證Streamable HTTP可網頁執行位置與生活效率與工作流

概覽

AI 產生的概覽

匿名、唯讀的遠端 MCP 伺服器,讓助理取得紐約、華盛頓特區與舊金山灣區的即時交通資訊:行程規劃、發車、告警與車輛位置。

可以做什麼
  • 規劃兩地之間的行程,支援無障礙(無階梯)方案並回傳經驗證的路線
  • 查詢某站點的下班車,包括繼續前往指定目的地的班次
  • 查看服務狀態:中斷、延誤、停駛、電梯與手扶梯故障
  • 定位列車與公車,或依名稱查找車站、站牌、路線與列車編號
  • 查詢 DC 與 NYC 專屬資訊:到站預測、事件、公車路線、站牌、車輛位置與轉乘
適用情境
當助理需要回答乘客問題,例如怎麼去某地、下一班車何時到、某條路線是否中斷、車輛現在在哪裡,且範圍涵蓋紐約、華盛頓特區或舊金山灣區時適用。
執行需求
需要一個遠端 Streamable HTTP 端點;無需登入、用戶端憑證、Bearer 權杖或 OAuth 流程,只需能連上該端點的網路。若自行部署,則需自備 WMATA 與 511 SF Bay 的 API 金鑰以及請求狀態金鑰。
安裝前請注意
服務為唯讀且匿名,不會暴露憑證。回傳內容包含營運單位提供的文字,應視為引用資料而非指令。結果可能是即時、僅時刻表或不可用,部分工具僅限 DC 或僅限 NYC。限流約為每來源 IP 每 60 秒 300 次請求,共用出口 IP 的用戶端會被合併計算。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Transit MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.transitmcp%2Ftransit-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "transit": {
      "type": "http",
      "url": "https://transitmcp.com/mcp"
    }
  }
}

README

Transit MCP

Transit MCP is a free, anonymous, read-only Model Context Protocol server that lets your AI answer transit questions: how do I get there, when's the next train, is anything broken, where's my bus. It's a side project, and general-purpose agents (ChatGPT, Claude, Muse, Instinct and friends) plug straight into it.

It covers:

  • New York: the subway, the Long Island Rail Road, Metro-North and NYC buses.
  • Washington DC: Metrorail and Metrobus.
  • SF Bay Area: every operator in 511 SF Bay's regional feed, including BART, Muni, Caltrain, AC Transit, VTA, SamTrans and the ferries. Departures, alerts and vehicles work there, and so does trip planning.

Metro MCP is now Transit MCP.

Nearly 100,000 requests served in the last 7 days.

[MCP] [Transit MCP] [Cloudflare Workers] [License]

Connect

The production endpoint is https://transitmcp.com/mcp. No login is required. No client credentials, bearer token, or OAuth flow is required; Transit MCP does not collect client credentials. Stale Authorization headers are ignored.

The previous endpoint, https://metro-mcp.anuragd.me/mcp, will continue to be supported and serves the same Worker.

Directories

Claude

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

Codex

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

Generic Streamable HTTP client

json
{  "mcpServers": {    "transit-mcp": {      "type": "http",      "url": "https://transitmcp.com/mcp"    }  }}

Agent skill

skills/transit-mcp/SKILL.md teaches an agent which tool answers which question, how to handle a name that means several places, and how to keep a rider posted by rechecking a planned trip before they leave. Install it with your agent's skills tool (for example npx skills add Aarekaz/transit-mcp) or copy the file into its skills folder.

POST /mcp is the recommended stateless Streamable HTTP endpoint. POST and OPTIONS /sse are a compatibility alias; legacy GET SSE, DELETE, session-message URLs, and slash variants return 405.

What it provides

This checkout registers 18 MCP tools: the 13 compatible DC/NYC tools plus five global capabilities, find_transit, plan_trip, get_departures, get_service_status, and get_vehicle_status. The compatible tools call WMATA and MTA directly for arrivals, service incidents, stations, routes, buses, trains, transfers, and vehicle positions.

All three regions serve the five global tools. Here's what they do:

  • plan_trip plans trips between stations, or from map coordinates with short walks, using the published timetables and live predictions. In New York and DC it searches the rail network on its own. Anywhere, including the SF Bay Area and buses, you can name the lines to ride in routes (up to four) and it finds the real trips, stops, transfers and walks on them. When it can't search on its own it says why and returns routeHints: the lines near each end and the ones that serve both. Every itinerary is checked by an independent validator and comes with plain steps a rider can follow.
  • Place names go in as the rider says them. A name for one place (Penn Station, SFO, two stations across the street) covers all its stations. A name for different places ("Broadway") gets the best trip from each in plan_trip, labelled in reading and explained in notice, and a question to ask in the other tools. No tool shows the user a form.
  • get_departures with toStop answers "next train from A to B": only trips that go on to that stop, each with its arrival time there.
  • get_departures merges the timetable with live trip updates. In NYC that includes rerouted trains and trains missing from the timetable, which are marked as observed rather than dropped. You can pass a station name directly; a station complex such as Times Sq-42 St or 14 St-Union Sq counts as one place and lists departures from every line in it, and genuinely different stations with the same name come back as choices.
  • get_service_status returns the agencies' own alerts for a city, line, station, or trip, plus elevator and escalator outages there: whether each is on the step-free path, whether a backup elevator exists, and MTA's suggested way around.
  • plan_trip with accessibility: "step_free" plans journeys that only board, alight and change where the platform is reachable without stairs, and avoids stations cut off by a current elevator outage. Station access comes from WMATA's GTFS and MTA's station list (including stations accessible in one direction only); if the live elevator report is missing or stale, it says so instead of guessing.
  • find_transit resolves stations, stops, routes and train IDs. Stations rank ahead of street stops and rail ahead of bus, each candidate says what it is (station, platform or street stop, modes, lines), and a few reviewed place names work, 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, and misspellings like "Crystl Cty" still land. DC stations also answer to WMATA's published names ("Chinatown", "Convention Center", "Adams Morgan"). Without a region, a name is searched in every region; find_transit with no arguments lists the regions and what each supports. When nothing matches, you get suggestions, the closest names, which are never treated as a match.
  • Live data is on the first question, not just the second: a quiet coordinator answers a stop's departures from the agency's feed as soon as it arrives. Times a rider sees are in the agency's local time with its offset (18:32-04:00).
  • get_vehicle_status shows where trains and buses are: on a line, on a dated trip from a departure board or planned journey, or at a station (every station of a complex). Each train reports its train ID (MTA's, such as 1A 1023 207/FAR, or WMATA's number), the station it is stopped at or heading to, the station it last served, and its destination. DC trains carry GPS coordinates. MTA publishes stations rather than coordinates, so an NYC train stopped at a station is placed there and one between stations has no coordinates rather than a guessed one.

The NYC coverage also carries the Long Island Rail Road, Metro-North and NYC buses, and DC carries Metrobus. Journeys use every mode, buses included, and change between them on foot at stations such as Penn Station, Grand Central and Atlantic Terminal; LIRR and Metro-North departures show the track. The network planner searches compact timetables a cron builds in R2, then plans and validates the proposed lines exactly (see src/transit/planner/network-plan.ts). NYC bus predictions, locations and alerts come from MTA Bus Time; a self-hosted Worker without its key (MTA_BUS_API_KEY) serves NYC buses from the timetable only.

Timetables are rebuilt at the edge when WMATA or MTA publish tables that actually changed. For the NYC subway, which MTA republishes about hourly, a change to yesterday, today or tomorrow is built once the published timetable is three hours old, and changes further out wait up to six hours. Live trains the timetable doesn't have yet still show up, from the realtime feed. 511 SF Bay timetables are stored automatically and built offline. An update that would remove most of a day's service is rejected, and one that makes live matching worse is rolled back. Under the hood on the docs page has the longer story, with diagrams. DC and NYC global transit is the verification record. SF Bay data comes from 511 SF Bay and participating operators, with their attribution on every result.

Honest limits

  • Late at night, when nothing runs within walking distance, plan_trip finds nothing and hands back routeHints instead.
  • NYC trains between stations have no coordinates; MTA reports stations, not GPS.
  • The first call after a quiet spell can take several seconds while the timetable loads.
  • The 13 original tools are still here and unchanged for older clients.

It also provides four transit:// URI templates (stations, routes, incidents, and versioned entities) and three canned prompts (service-briefing, commute-planner, and accessibility-check). Use plan_trip for journeys; do not assemble routes from departure boards. Global results distinguish realtime, scheduled_only, and unavailable, with source timestamps, versions, reasons, attribution, and a JSON text fallback.

An Apps-capable host can render the Transit Board resource for the 13 DC and NYC tools. See the Apps verification record.

Runtime and safety boundaries

  • Protocol: MCP 2026-07-28 stateless Streamable HTTP. The server does not advertise sessions, resumability, or server push.
  • Request trust: public origin and host/origin allowlists are validated at startup. The signed MRTR request-state codec is bound to the MCP method and expires after five minutes.
  • Cancellation: client disconnects propagate request cancellation to MCP handlers and upstream transit fetches.
  • Caching: discovery and tool metadata are publicly cacheable for 24 hours. Station and route resources are public-cacheable; incident and versioned-entity resources are not. Legacy WMATA and MTA tools retain their provider caches. Global tools read versioned artifacts and snapshots without fetching upstream providers during a request.
  • Rate limiting: roughly 300 requests per 60-second window per source-IP key per Cloudflare location. Shared egress IPs group clients, and enforcement is eventually consistent. This is abuse protection, not a dedicated user quota.
  • Rollback: the inactive MetroMcpAgent class and original v1 Durable Object migration remain for rollback. Do not add a deletion migration during stabilization.

Deploy your own

Client access is anonymous. A self-hosted Worker still needs its own WMATA and 511 SF Bay API keys plus a stable MCP_REQUEST_STATE_KEY of at least 32 bytes for signed MRTR state.

bash
bun install --frozen-lockfilecp .dev.vars.example .dev.varsbun run dev

Use the checked-in loopback origin, hostname allowlists, and ENVIRONMENT=development values together. Keep .dev.vars out of source control. Production and preview use their own origins, allowlists, state keys, WMATA and 511 keys, artifact buckets, and MCP_RATE_LIMITER bindings.

Before an approved deployment, run only dry-runs:

bash
production_out=$(mktemp -d /tmp/transit-mcp-production.XXXXXX)preview_out=$(mktemp -d /tmp/transit-mcp-preview.XXXXXX)node node_modules/wrangler/bin/wrangler.js deploy --dry-run --env "" --outdir "$production_out"node node_modules/wrangler/bin/wrangler.js deploy --env preview --dry-run --outdir "$preview_out"

Verification

Run bun run build && bun run test && bun run test:apps. The conformance runner starts and stops its own isolated local Worker, uses the installed pinned referee, and gates a frozen product profile with mapped real tests. The full official score is reported separately and is not a product-profile pass:

bash
./scripts/run-conformance.sh

See global transit verification for current evidence and unpassed launch gates, SF rollout for activation prerequisites, and security architecture for request boundaries. The older MCP 2026 record is historical evidence, not this branch's acceptance.

Support and legal

License

MIT. See LICENSE.

來源:README.md,提交 a6bb62f

工具

18

get_station_predictions

Train arrival predictions

Get real-time train arrival predictions for a transit station. Supports DC Metro and NYC Subway. Accepts a station name or an exact station ID; if a name matches several stations, the result lists the candidates to choose from.

輸入參數city必填stationName必填

search_stations

Search stations

Search for transit stations by name or code. Supports DC Metro and NYC Subway.

輸入參數city必填query必填

get_stations_by_line

Stations on a line

Get all stations on a specific transit line. Supports DC Metro and NYC Subway.

輸入參數city必填lineCode必填

get_all_stations

All stations

Get the complete list of transit stations with coordinates for one city. Large result; prefer search_stations or get_stations_by_line when looking for specific stations.

輸入參數city必填

get_station_transfers

Station transfers

Get transfer connections and nearby stations from a transit station. NYC Subway only.

輸入參數city必填stationId必填

get_incidents

Service incidents

Get current transit incidents and service advisories for DC Metro or NYC Subway.

輸入參數city必填

get_elevator_incidents

Elevator outages

Get current elevator and escalator outages. DC Metro only.

輸入參數city必填

get_bus_predictions

Bus arrival predictions

Get real-time bus arrival predictions for a DC Metro bus stop.

輸入參數stopId必填

get_bus_routes

All bus routes

Get all DC Metro bus routes with route IDs and descriptions.

無需輸入參數。

get_bus_stops

Bus stops

Get DC Metro bus stops. Returns all stops or filters by lat/lon/radius.

輸入參數radiuslatitudelongitude

get_bus_positions

Live bus positions

Get real-time positions of DC Metro buses, optionally filtered by route.

輸入參數routeId

get_train_positions

Live train positions

Get real-time positions of all trains on the DC Metro system.

無需輸入參數。

get_route_info

Route information

Get detailed information about a transit route including service patterns. NYC Subway only.

輸入參數city必填routeId必填

find_transit

Find transit entities

Call with no arguments (or only `coverage`) to list the regions served and what each supports. Without a coverage, a name is searched in every region. If nothing matches, suggestions lists the closest names (not matches). Resolve a coverage, agency, route, station, stop, or a currently observed train number (where vehicle data exists); inspect an exact reference or nearby coordinates. Context ranks candidates without selecting identity. Candidates come best first (exact names and well-known place names such as SFO, then stations, then rail before bus), and each stop says what it is: stopType (station, platform or street stop), modes and the lines serving it, so you can pick the one the rider means. No general address geocoding. Use plan_trip for journeys.

輸入參數reflimitquerycontextcoveragelatitudelongitude

plan_trip

Plan a transit journey

Plan an origin-to-destination journey. Returns up to three independently validated itineraries (the fastest, then other lines); departure defaults to now. Pass the rider's place names as given: a name for one place (Penn Station, SFO) plans from or to all its stations. A name meaning different places (Broadway) returns the best trip from each, each labelled in reading and explained in notice: use the one the conversation points to, or ask the rider. The search covers every line of the coverage, buses included. When no itinerary is possible (planning unavailable, a search too large, or nothing found) it returns routeHints: lines near each end and direct lines serving both. Call again with routes (the lines you would ride, from routeHints or your own knowledge) to plan along only those lines, which works wherever schedules exist. Present only returned itineraries as confirmed. The whole journey must finish within windowSeconds (default two hours): if none is found for a long trip, retry with a larger window. Each transit leg carries a tripInstanceRef; pass it to get_vehicle_status to see where that train is now. For a wheelchair user or anyone avoiding stairs, set accessibility: "step_free": journeys then board, alight and change only at platforms step-free from the street per the agency (partial stations by direction), avoiding stations cut off by a current elevator outage; in-station changes between such platforms are taken as step-free. It refuses with ACCESSIBILITY_UNAVAILABLE when no current elevator report exists and ENDPOINT_NOT_STEP_FREE when an endpoint has no step-free platform now (get_service_status lists the outages). Never present a journey pieced together from get_departures as confirmed; check it here with routes.

輸入參數origin必填routescoveragedepartAtdestination必填maxTransfersaccessibilitymaxWalkMetreswindowSeconds

get_departures

Departures at a stop

Find what leaves a stop next, the first service or last service in a bounded window. Pass a stopRef from find_transit, or a stop name with its coverage: a name for one place covers all its stations in that network (otherStations lists the same place in other networks, such as the LIRR at Penn Station); a name for different places returns a question to ask, with candidates. A station covers its whole complex, e.g. every line at Times Sq-42 St; a platform ref covers that platform. Pass toStop or toStopRef for the next trips from here that stop at a destination, each with its arrival time there. Returns dated trip references for get_vehicle_status. For a journey with a change use plan_trip (with routes where needed): departures alone cannot prove a connection.

輸入參數atstoplimittoStopstopRefcoveragerouteRefsselectiontoStopRefagencyRefswindowSeconds

get_service_status

Transit service status

Check disruptions, delays, closures, elevator and escalator outages, or revalidate a chosen itinerary without replacing it. Scope by coverage, a station name with its coverage (stop), or an agency, route, stop or dated trip reference; a station covers its complex. Aggregate scopes include canonical service in the next 24 hours. equipment lists elevator/escalator outages: accessiblePath marks the step-free route, blocksStepFree marks stations step-free plan_trip avoids, and alternativeRoute is the agency's way around. Use get_vehicle_status for an observed vehicle location.

輸入參數refstopcoverageitinerary

get_vehicle_status

Where trains are now

Where observed trains are right now. Pass a route ref to list its trains, a dated trip ref (from get_departures or a plan_trip leg) to find that train, or a station (stopRef, or a name with coverage) to see trains stopped at or heading to it; a station covers its whole complex. Each train reports the stop it is at or heading to (stopStatus), the stop it last served, and its destination. Coordinates are the vehicle's own when the agency sends them (DC); otherwise a stopped train is placed at its station and a moving one has none. Never pass a bare train number: use find_transit.

輸入參數refstoplimitcoverage

版本歷史

2
  1. v6.1.0最新Oct 25, 2026
  2. v6.0.0Oct 17, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分