Metro-MCP β€” Live transit data for AI agents

3 min read Original article β†—

Give your AI agent
live transit vision

Metro-MCP connects LLMs and AI agents to current transit data from NYC Subway and DC Metro. Train positions, arrivals, delaysβ€”all streaming through MCP with instant updates.

1. Open Your Client's MCP/Connector settings

2. Add this URL: https://metro-mcp.anuragd.me/mcp

3. Click "Connect" and authorize via GitHub

4. Start asking questions about the Metro!

$ git clone https://github.com/Aarekaz/metro-mcp.git

$ cd metro-mcp && bun install

$ bunx wrangler kv namespace create "OAUTH_CLIENTS"

$ bunx wrangler secret put WMATA_API_KEY

$ bunx wrangler deploy

Powering transit-aware AI applications

From commuter assistants to analytics platforms, Metro-MCP provides the foundation for intelligent transit applications with up-to-date data and comprehensive coverage.

πŸš‡

Live Arrival Predictions

Get current arrival times for any station. AI agents can answer "when's the next train?" with actual data, not guesses.

  • Smart commute planning
  • Travel assistants
  • Delay notifications

πŸ“

Train Position Tracking

Track every train in the system. See exactly where trains are, which direction they're heading, and train composition.

  • System monitoring
  • Crowding insights
  • Route optimization

🚌

Multimodal Integration

Complete DC Metro bus support with instant positions, predictions, routes, and stops. Build comprehensive transit assistants.

  • Bus + rail coordination
  • Transfer planning
  • Last-mile solutions

⚠️

Service Disruption Alerts

Stay ahead of disruptions. Get instant incident reports, elevator outages, and service advisories as they happen.

  • Proactive route changes
  • Accessibility updates
  • Emergency notifications

πŸ—ΊοΈ

Rich Station Metadata

Complete station info with coordinates, transfer connections, and line information. Build spatial reasoning into your AI.

  • Geographic queries
  • Transfer optimization
  • Accessibility info

πŸ”„

Auto-Refresh Data Streams

Data updates every 7-10 seconds. Your AI always has the freshest information without manual polling.

  • SSE event streams
  • Efficient bandwidth
  • Always up-to-date

Two major transit systems, one unified API

Comprehensive coverage of NYC Subway and DC Metro with different strengths and capabilities

Feature DC Metro (WMATA) NYC Subway (MTA)
Train Arrivals βœ“ Live predictions βœ“ Live predictions
Train Positions βœ“ GPS tracking βœ“ GPS tracking
Service Alerts βœ“ Incidents & advisories βœ“ System-wide alerts
Bus Integration βœ“ Full support – Rail only
Stations 98 stations 496 stations
Lines 6 lines (Red, Orange, Silver, Blue, Yellow, Green) 29 lines (A, C, E, 1, 2, 3, etc.)
Geographic Coverage DC, MD, VA metro area NYC 5 boroughs
Update Frequency 7-10 seconds 7-10 seconds

Core MCP Tools

Essential tools that enable AI agents to access and query transit data effectively

Example queries

See how AI agents can answer transit questions naturally using Metro-MCP

The next Red Line train to Shady Grove arrives in 4 minutes at Metro Center. After that:

  • 8 minutes β€” Second train
  • 14 minutes β€” Third train
  • Trains running on normal schedule, no reported delays

Current alerts affecting your route:

  • Orange Line: Single tracking between Stadium-Armory and Minnesota Ave, expect 10-15 min delays
  • Metro Center: Elevator to Red Line platform out of service, use escalator
  • Consider: Blue Line alternative with 8-min transfer at L'Enfant Plaza

Fastest route (38 minutes total):

  • Red Line to Metro Center (3 stops, 6 min)
  • Transfer to Orange/Silver Line (2 min walk)
  • Silver Line to Reagan National (6 stops, 28 min)
  • Next departure in 5 minutes, arrive by 3:45 PM

Start building transit-aware AI

Deploy in minutes, scale infinitely. Metro-MCP runs on Cloudflare Workers with enterprise-grade reliability.

Built with modern technologies

TypeScript

Cloudflare Workers

MCP Protocol

WMATA API

MTA API