MBTA MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MBTA MCPWhat are the next Red Line trains arriving at Park Street?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MBTA MCP
Model Context Protocol (MCP) server that exposes live MBTA V3 transit data over Streamable HTTP.
Public production endpoint (after Cloud Run deploy):
https://mbta.metaverseprofessional.tech/mcp
Architecture
MCP Client
→ Streamable HTTP (/mcp)
→ Python MCP server (MCP Python SDK v2)
→ MBTA V3 API (https://api-v3.mbta.com)Related MCP server: marta-mcp
Tools
Tool | When to use |
| List routes; optional |
| Stops for a known |
| Resolve a station/stop name to stop IDs (client-side name match) |
| Predicted arrivals at a |
| Service alerts; optional route/stop filters |
| Live vehicle positions; optional |
Also exposes GET /health for load balancers and Cloud Run probes.
Requirements
Python 3.12+
MBTA API key from api-v3.mbta.com
Quick start (local)
cd MBTA-MCP
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -e ".[dev]"
copy .env.example .env
# Edit .env and set MBTA_API_KEY=...
python -m mbta_mcpServer listens on:
MCP:
http://127.0.0.1:8080/mcpHealth:
http://127.0.0.1:8080/health
Or with uvicorn:
uvicorn mbta_mcp.server:create_app --factory --host 0.0.0.0 --port 8080Configuration
All secrets come from the environment (never hardcode keys).
Variable | Required | Default | Description |
| recommended | — | MBTA V3 API key (optional for light anonymous testing) |
| no |
| Bind address |
| no |
| Bind port (Cloud Run sets this) |
| no |
| API base URL |
| no |
| Logging level |
| no | localhost + production host | Streamable HTTP Host allowlist |
See .env.example.
Tests
pytest
pytest -m integration # live MBTA calls when MBTA_API_KEY is setSmoke-test tools against a running server:
python scripts/smoke_tools.py --url http://127.0.0.1:8080/mcpDocker
docker build -t mbta-mcp .
docker run --rm -p 8080:8080 -e MBTA_API_KEY=your_key mbta-mcpThen:
curl http://127.0.0.1:8080/health
python scripts/smoke_tools.py --url http://127.0.0.1:8080/mcpConnect an MCP client
Point a Streamable HTTP MCP client at:
Local:
http://127.0.0.1:8080/mcpProduction:
https://mbta.metaverseprofessional.tech/mcp
Cloud Run (later — do not deploy until local + Docker work)
Store the key in Secret Manager as
MBTA_API_KEY.Build/push the image to Artifact Registry.
Deploy to Cloud Run with:
secret mapped to env var
MBTA_API_KEYcontainer port
8080health check path
/health
Map custom domain
mbta.metaverseprofessional.tech.Ensure
MCP_ALLOWED_HOSTSincludesmbta.metaverseprofessional.techandmbta.metaverseprofessional.tech:*.
App code only reads MBTA_API_KEY from the environment; Secret Manager wiring is a Cloud Run concern.
Project layout
src/mbta_mcp/
server.py # MCPServer, tools, /health
config.py # env settings
mbta/client.py # MBTA V3 httpx client
tools/ # tool handlers
tests/
DockerfileLicense
Use at your own risk. MBTA data is subject to MBTA API terms of use.
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
- Alicense-qualityBmaintenanceMCP 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.7GPL 2.0
- AlicenseAqualityAmaintenanceMCP server for Atlanta MARTA real-time transit data, enabling queries about train arrivals and bus positions via natural language.4MIT
- AlicenseCqualityBmaintenanceMCP server for the UK Bus Open Data Service, enabling timetable queries, stop search, route discovery, journey planning, and real-time bus tracking.16MIT
- Alicense-qualityDmaintenanceMCP server exposing Pittsburgh Regional Transit (PRT) TrueTime operations as typed tools for agent clients.MIT
Related MCP Connectors
MBTA MCP — Boston real-time transit via the MBTA v3 API (api-v3.mbta.com)
SEPTA MCP — Philadelphia SEPTA real-time transit (www3.septa.org/api, keyless)
MCP server for live, sourced Brazilian public data from the official IBGE APIs.
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/jegamboafuentes/MBTA-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server