Bay Area Transit MCP
湾区公共交通 MCP 服务器
两个 Cloudflare Workers 为 BART 和 SF Muni 的实时公共交通数据提供 MCP(Model Context Protocol)访问。适用于 Claude、ChatGPT、Poke、Cursor 以及任何兼容 MCP 的客户端。
你无需部署任何东西。 只需将你的 MCP 客户端指向下面托管的端点即可。
在线端点
BART:
https://bart-mcp.srivastsh.workers.dev/mcp——无需认证,直接连接Muni:
https://muni-mcp.srivastsh.workers.dev/mcp——通过x-api-key-511请求头传入你的免费 511.org API 密钥
这些服务运行在 Cloudflare Workers 的免费套餐上(每天 10 万次请求)。由于 Muni 服务器使用 BYOK(自带密钥)认证,每个用户的 511 速率限制都只与各自密钥绑定。
Related MCP server: marta-mcp
快速开始
BART(无需认证)
只需将 URL 添加到你的 MCP 客户端。无需 API 密钥。
Muni(BYOK)
在 https://511.org/open-data/token 获取免费的 511.org API 密钥
在 MCP 配置中通过
x-api-key-511请求头传入该密钥
客户端配置
Claude Desktop / Claude Code
{
"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_API_KEY"
}
}
}
}Poke
或者手动将其添加为远程 MCP 服务器:
URL:
https://bart-mcp.srivastsh.workers.dev/mcp或https://muni-mcp.srivastsh.workers.dev/mcp对于 Muni,将自定义请求头
x-api-key-511设置为你的 511 密钥
Cursor / Windsurf / 仅支持 stdio 的客户端
使用 mcp-remote 作为桥梁:
{
"mcpServers": {
"bart": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-remote", "https://bart-mcp.srivastsh.workers.dev/mcp"]
},
"muni": {
"command": "npx",
"args": [
"-y", "@anthropic-ai/mcp-remote",
"https://muni-mcp.srivastsh.workers.dev/mcp",
"--header", "x-api-key-511:YOUR_511_API_KEY"
]
}
}
}可用工具
BART(5 个工具)
工具 | 描述 |
| 列出所有 BART 车站及其代码 |
| 某个车站的实时发车信息 |
| 规划两个车站之间的行程 |
| 当前服务公告 |
| 查询两个车站之间的票价 |
Muni(7 个工具)
工具 | 描述 |
| 列出所有 511 公共交通运营商 |
| 列出所有 Muni 线路 |
| 某个站点的实时发车信息 |
| 线路详情及站点 |
| 当前服务警报 |
| 车辆的实时 GPS 位置 |
| 某条线路的时刻表 |
自行部署
大多数用户无需部署——直接使用上面的托管端点即可。但如果你想要自己的实例:
前提条件
Node.js 18+
Cloudflare 账户(免费套餐即可)
wranglerCLI:npm install -g wrangler
BART Worker
cd bart-mcp
npm install
wrangler login
wrangler deploy公共 BART 演示密钥(MW9S-E7SL-26DU-VV8V)已内置在 wrangler.toml 中。无需配置任何机密。
Muni Worker
cd muni-mcp
npm install
wrangler deploy(可选)设置一个备用 511 密钥(当未提供请求头密钥时使用):
wrangler secret put API_511_KEY架构
运行时:Cloudflare Workers(V8 隔离)
传输:
WebStandardStreamableHTTPServerTransport(无状态,每个请求一个服务器实例)认证:通过请求头进行 BYOK 认证,可选回退到环境变量机密
校验:所有工具输入均使用 Zod schemas
CORS:已为所有来源启用
API 数据源:api.bart.gov(BART)、api.511.org(Muni/511)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server that provides tools for querying live transit data (stops, departures, routes, vehicles, alerts) from any WP GTFS Pro site, enabling AI assistants to answer rider questions.14GPL 2.0
- AlicenseAqualityAmaintenanceMCP server for Atlanta MARTA real-time transit data, enabling queries about train arrivals and bus positions via natural language.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying Swiss public transport data (stations, departures, connections) from the Transport Open Data API via natural language through an MCP gateway.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying global transit data including agencies, routes, stops, and departures through a GTFS aggregator.2MIT
Related MCP Connectors
Transitland MCP — global GTFS aggregator
MBTA MCP — Boston real-time transit via the MBTA v3 API (api-v3.mbta.com)
BART MCP — San Francisco Bay Area Rapid Transit real-time data (api.bart.gov)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/srivastsh/bay-area-transit-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server