Public
Remixed
Public read-only MCP server for Amtrak GTFS-RT realtime data
mcpgtfs-rttransit
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Amtrak GTFS + GTFS-RT MCP server

A public, read-only Model Context Protocol server that lets AI agents query both live and scheduled Amtrak transit data:

  • Realtime (GTFS-RT) — live predictions, train positions, and alerts, fetched on every call from the transitdocs feed.
  • Static (GTFS) — routes, stops, trips, schedules, and service calendars, loaded into this val's SQLite database from Amtrak's GTFS.zip.

Realtime tools

ToolDescription
get_feed_headerFeed metadata: version, timestamp, and counts of trip updates / vehicles / alerts.
get_trip_updatesReal-time arrival/departure predictions. Filters: routeId, tripId.
get_vehicle_positionsLive train positions (lat/long, bearing, speed, current stop). Filters: routeId, tripId, vehicleId.
get_service_alertsActive service alerts / advisories. Filter: routeId.

Static GTFS tools (SQLite)

ToolDescription
get_routesList routes. Filters: routeId, query (name search).
get_stopsList stations. Filters: stopId, query (name search), or lat/lon/radiusKm (nearby).
get_tripsList scheduled trips. Filters: routeId, tripId, headsign, limit.
get_trip_scheduleFull itinerary of a trip: stops in order with scheduled times. Requires tripId.
get_stop_departuresScheduled departures/arrivals at a station. Requires stopId, optional routeId.
get_calendarService days/date range for a tripId or serviceId.
get_agencyTransit agency info. Filter: agencyId.

Realtime times are ISO-8601; static schedule times are HH:MM:SS; delays are in seconds.

Data freshness

  • All realtime tools (get_feed_header, get_trip_updates, get_vehicle_positions, get_service_alerts) share a single 60-second cache of the raw GTFS-RT feed, stored in SQLite. The upstream feed is fetched at most once per minute; every tool reads from the same cached copy.
  • Static GTFS is stored in SQLite and refreshed daily at 4:00 UTC by the refresh-gtfs.ts interval, which re-downloads the GTFS.zip and re-ingests via ingest-gtfs.ts. You can also run ingest-gtfs.ts manually at any time.

Connect an MCP client

Point your MCP client at the server's URL (streamable HTTP transport). For example, in a Claude Code / MCP config:

{ "mcpServers": { "amtrak-gtfs": { "type": "http", "url": "https://<your-subdomain>.val.run" } } }

You can also test it quickly in the Cloudflare MCP playground.

Example

Ask your agent: "Where is Amtrak train 287743 right now, and what are its upcoming stops?" It will call get_vehicle_positions and get_trip_updates (live) and get_trip_schedule (scheduled) to answer.

Notes

  • Read-only: realtime tools only fetch the upstream feed; static tools only read SQLite.
  • Built on the v2 TypeScript SDK (@modelcontextprotocol/server), compatible with MCP 2.0 (2026-07-28 spec) and the legacy spec.