metronorth-mcp
v2.1.0
Published
MCP server for Metro-North schedules, stations, service alerts, and real-time departures
Maintainers
Readme
Metro-North MCP Server
MCP server for Metro-North schedules, stations, service alerts, and real-time departures.
Uses public MTA GTFS and GTFS-Realtime feeds. No MTA API key required.
Install with an Agent
Paste this into your MCP-capable coding agent:
Install the Metro-North MCP server in this client as "metronorth".
Use command "npx" with args ["-y", "metronorth-mcp"].
After installing, reload MCP servers and test it by calling search_stations with query "Grand Central".Install
npx -y metronorth-mcpGitHub install:
npx -y --package github:NelsonSpencer/metronorth-mcp metronorth-mcpUse metronorth as the MCP server name.
MCP Client Setup
Cursor
Copy and open this deeplink:
cursor://anysphere.cursor-deeplink/mcp/install?name=metronorth&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1ldHJvbm9ydGgtbWNwIl19Manual .cursor/mcp.json config:
{
"mcpServers": {
"metronorth": {
"command": "npx",
"args": ["-y", "metronorth-mcp"]
}
}
}Codex
codex mcp add metronorth -- npx -y metronorth-mcp
codex mcp listClaude Code
claude mcp add metronorth -- npx -y metronorth-mcp
claude mcp listRun /mcp in Claude Code to confirm the server is connected.
VS Code
code --add-mcp '{"name":"metronorth","command":"npx","args":["-y","metronorth-mcp"]}'Open Copilot Chat in Agent mode and enable the server from the tools picker.
OpenClaw
openclaw mcp set metronorth '{"command":"npx","args":["-y","metronorth-mcp"]}'
openclaw mcp listHermes
hermes mcp add metronorth --command npx --args -y metronorth-mcp
hermes mcp test metronorthRestart or reload MCP servers after installing.
Other MCP Clients
Use this server entry:
{
"command": "npx",
"args": ["-y", "metronorth-mcp"]
}Full MCP config:
{
"mcpServers": {
"metronorth": {
"command": "npx",
"args": ["-y", "metronorth-mcp"]
}
}
}Agent Usage
This server exposes usage guidance through MCP:
- Read
metronorth://usagefor the recommended station, trip-planning, alert, and freshness workflow. - Read
metronorth://examplesfor common tool-call examples. - Use the
use-metro-north-mcpprompt when an agent needs a quick operating guide.
Recommended flow:
- Search stations first when names may be partial or ambiguous.
- Use
plan_metro_north_tripfor station-to-station questions. - Use
get_station_pair_schedulefor direct train options between two stations. - Use
get_first_last_trainsfor first/last train questions. - Read
metronorth://system/statuswhen data freshness matters. - Treat realtime departures and alerts as best-effort public feed data.
Tools
Tool results include readable text and MCP structuredContent. Invalid inputs and unknown stations return structured errors.
| Tool | Use |
| --- | --- |
| search_stations | Search stations by name |
| get_departures | Get upcoming departures from a station |
| get_trip_details | Get stop-level details for a trip |
| get_route_schedule | Get a route schedule by date and direction |
| get_service_alerts | Get current service alerts |
| get_station_info | Get station metadata and served routes |
| get_system_status | Check feed availability and local data freshness |
| get_station_pair_schedule | Find direct trains between two stations |
| get_first_last_trains | Get first and last direct trains for a service date |
| plan_metro_north_trip | Plan a direct trip with options, alerts, and freshness |
Example:
{
"origin_station": "Grand Central",
"destination_station": "White Plains",
"limit": 3,
"include_alerts": true
}Resources and Prompts
Resources:
metronorth://usagemetronorth://examplesmetronorth://system/statusmetronorth://routesmetronorth://stationsmetronorth://station/{station_name}
Prompts:
use-metro-north-mcpplan-metro-north-tripsummarize-service-status
Local Development
git clone https://github.com/NelsonSpencer/metronorth-mcp.git
cd metronorth-mcp
npm install
cp .env.example .env
npm run build
npm startFirst run downloads the public Metro-North GTFS ZIP and imports it into SQLite.
Configuration
Create .env from .env.example.
NODE_ENV=development
LOG_LEVEL=info
REDIS_URL=
DB_PATH=
GTFS_UPDATE_INTERVAL_HOURS=24
CACHE_TTL_SECONDS=300If DB_PATH is empty, schedule data is stored in ~/.cache/metronorth-mcp/metronorth.db.
Redis is optional. If REDIS_URL is empty, the server uses in-memory caching.
Development Checks
npm run typecheck
npm test
npm run lint
npm run build
npm run smoke:mcpDocker
docker build -t metronorth-mcp .MCP client config:
{
"mcpServers": {
"metronorth": {
"command": "docker",
"args": ["run", "--rm", "-i", "metronorth-mcp"]
}
}
}Docker Compose starts the MCP server with Redis and persistent storage.
docker-compose up -d
docker-compose logs -f metronorth-mcpAdditional Notes
- Static schedules are cached locally from public MTA GTFS feeds.
- Real-time departures and alerts use public GTFS-Realtime feeds and are best-effort.
- Tools handle dynamic lookups; resources expose reference data; prompts provide reusable workflows.
- Unofficial project. Not affiliated with or endorsed by the MTA.
License
MIT. See LICENSE.
