open source

Bay Area Transit MCP

Real-time BART and SF Muni for Claude, ChatGPT, Cursor, and any MCP client. Twelve tools covering departures, trip planning, fares, advisories, and live vehicle positions.

Two hosted Cloudflare Workers you can point a client at — no deploy, no backend to run. Ask, "when's the next SFO-bound train from Embarcadero?" and get a real answer.

View on GitHub →
TypeScriptMCPCloudflare WorkersZodBART API511 API

why I built this

I work alongside AI tools all day, and I'm fully dependent on Bay Area transit throughout the week. The two never really talked to each other — every trip meant breaking flow to open another app and check a departure board.

This is the small bridge between them. Two servers, twelve tools, and the model I'm already chatting with can answer real questions about departures, advisories, and where the next bus actually is.

hosted endpoints

BART

https://bart-mcp.srivastsh.workers.dev/mcp

No authentication. Point a client at it.

Muni

https://muni-mcp.srivastsh.workers.dev/mcp

Requires a free 511.org key sent as x-api-key-511.

tools

BART5 tools

bart_stations

List every BART station with its code.

bart_departures

Real-time departures from any station.

bart_trip

Plan a trip between two stations.

bart_advisories

Current service advisories.

bart_fare

Fare lookup between two stations.

Muni7 tools

transit_operators

List every 511 transit operator.

muni_routes

List every Muni route.

muni_departures

Real-time departures from any stop.

muni_line

Line details with stops.

muni_alerts

Current service alerts.

muni_vehicles

Live vehicle GPS positions.

muni_schedule

Timetable for a line.

setup

Claude Desktop

Drop this into your claude_desktop_config.json and restart Claude.

{
  "mcpServers": {
    "bart": {
      "url": "https://bart-mcp.srivastsh.workers.dev/mcp"
    },
    "muni": {
      "url": "https://muni-mcp.srivastsh.workers.dev/mcp",
      "headers": {
        "x-api-key-511": "YOUR_511_KEY"
      }
    }
  }
}

Cursor / Windsurf

Bridged with mcp-remote so the client can talk HTTP.

{
  "mcpServers": {
    "bart": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://bart-mcp.srivastsh.workers.dev/mcp"]
    },
    "muni": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://muni-mcp.srivastsh.workers.dev/mcp",
        "--header",
        "x-api-key-511:YOUR_511_KEY"
      ]
    }
  }
}

ChatGPT & other clients

Any client that speaks MCP over HTTP works. Point it at the endpoint above; include the x-api-key-511 header for Muni.

getting a 511 key

Muni data goes through 511.org, which is free but wants a key so rate limits are scoped per user. Request one, paste it into the x-api-key-511 header, and you're done.

Request a 511.org key →

built with

TypeScript on Cloudflare Workers. Zod validates every tool input, CORS is open, and each request is stateless — one V8 isolate, one call. The free tier covers 100k requests a day, which is more than enough for a personal transit co-pilot. Self-host in a few minutes with Wrangler if you'd rather run your own.

links

Not affiliated with BART, SFMTA, or 511.org. Data comes from their public APIs and can drift from reality — trust the platform display before the chatbot.

questions? me@srivastsh.com