metro
Metro-MCP connects LLMs and other AI agents to live transit data from NYC Subway and DC Metro. Train positions, arrivals, delays—all in real-time through MCP.
claude mcp add --transport stdio aarekaz-metro-mcp npx -y metro-mcp
How to use
This MCP server provides a unified interface to query real-time transit data and station information for DC Metro (WMATA) and New York City Subway (MTA). It exposes a set of MCP tools that let clients fetch live train predictions, search stations, list stations by line, check service incidents, and obtain complete station inventories with coordinates. Clients connect via the MCP protocol, authenticate using OAuth 2.1 with PKCE, and then issue tool calls such as get_station_predictions, search_stations, get_stations_by_line, get_incidents, and get_all_stations. The server is designed to work with Claude Desktop and any MCP-compatible client, enabling natural-language style queries with structured tool calls behind the scenes.
How to install
Prerequisites:
- Node.js or Bun installed on your machine
- Cloudflare Wrangler (for deployment to Workers) and a Cloudflare account
- A WMATA API key for real-time data access
- A GitHub OAuth App for user authentication
Setup steps:
- Install dependencies (recommended Bun):
bun install
Or with npm:
npm install
- Generate a JWT secret (for token signing):
openssl rand -hex 32
- Create a GitHub OAuth App and capture Client ID/Secret:
- Homepage URL: https://metro-mcp.your-subdomain.workers.dev
- Callback URL: https://metro-mcp.your-subdomain.workers.dev/callback
- Create Cloudflare KV namespaces for OAuth clients and rate limiting:
bunx wrangler kv namespace create "OAUTH_CLIENTS"
bunx wrangler kv namespace create "OAUTH_CLIENTS" --preview
bunx wrangler kv namespace create "RATE_LIMIT_KV"
bunx wrangler kv namespace create "RATE_LIMIT_KV" --preview
- Copy example config files and fill in values:
cp wrangler.toml.example wrangler.toml
# Update the KV namespace IDs in wrangler.toml
cp .dev.vars.example .dev.vars
# Add your actual secrets to .dev.vars
- Set production secrets (Cloudflare stored):
bunx wrangler secret put WMATA_API_KEY
bunx wrangler secret put GITHUB_CLIENT_SECRET
bunx wrangler secret put JWT_SECRET
- Deploy to Cloudflare Workers:
bunx wrangler deploy
If you prefer running locally, you can start the local development server using your chosen runtime (e.g., Bun or Node) with the appropriate entry point for the metro-mcp package.
Additional notes
Environment variables and secrets:
- WMATA_API_KEY: WMATA API key for real-time data
- GITHUB_CLIENT_SECRET: GitHub OAuth client secret
- JWT_SECRET: Secret for signing JWT access tokens
Deployment tips:
- The server is typically deployed to Cloudflare Workers via Wrangler; ensure wrangler is configured with your account and project bindings
- If you upgrade dependencies, re-run docker/npm/bun install accordingly and re-deploy
- For OAuth flows, ensure your Homepage and Callback URLs are publicly reachable when deployed
Common issues:
- Missing WMATA API key leads to failed real-time queries
- Incorrect KV namespace IDs in wrangler.toml will block OAuth persistence
- If OAuth redirects fail, verify your GitHub OAuth App settings and callback URL
Related MCP Servers
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
mcp -arangodb
This is a TypeScript-based MCP server that provides database interaction capabilities through ArangoDB. It implements core database operations and allows seamless integration with ArangoDB through MCP tools. You can use it wih Claude app and also extension for VSCode that works with mcp like Cline!
CodeRAG
Advanced graph-based code analysis for AI-assisted software development
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!