open source · 2 hosted servers · 12 tools

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 GitHubTypeScript · MCP · Cloudflare Workers · Zod · BART API · 511 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

BART

5 tools
  • bart_stationsList every BART station with its code.
  • bart_departuresReal-time departures from any station.
  • bart_tripPlan a trip between two stations.
  • bart_advisoriesCurrent service advisories.
  • bart_fareFare lookup between two stations.

Muni

7 tools
  • transit_operatorsList every 511 transit operator.
  • muni_routesList every Muni route.
  • muni_departuresReal-time departures from any stop.
  • muni_lineLine details with stops.
  • muni_alertsCurrent service alerts.
  • muni_vehiclesLive vehicle GPS positions.
  • muni_scheduleTimetable 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 and 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, so trust the platform display before the chatbot.

Questions? [email protected]