Global transit via Transitland v2 — operators, GTFS/GTFS-RT/GBFS feeds, routes, stops, departures.
Global transit data via the Transitland v2 registry — operators, GTFS/GTFS-RT/GBFS feeds with license terms, routes, stops, and real-time-aware departures via MCP. STDIO or Streamable HTTP.
Transit data from the Transitland v2 registry — the open aggregator of GTFS, GTFS-Realtime, and GBFS feeds from thousands of transit operators worldwide. Find operators, discover feeds and their license terms, and look up routes, stops, and real-time-aware departures from any MCP client. Runs as a stdio process or a local Streamable HTTP server.
| Tool | Description |
|---|---|
transitland_find_operators | Find transit operators/agencies by name, point/radius, bounding box, country/region, or Onestop ID |
transitland_get_operator | Fetch the full operator record by Onestop ID — agencies, feeds, and source tags |
transitland_find_feeds | Discover GTFS, GTFS-Realtime, and GBFS feeds — fetch URLs, license terms, and freshness |
transitland_find_routes | Find routes by point/radius, bounding box, operator, Onestop ID, or GTFS mode |
transitland_find_stops | Find stops/stations by point/radius, bounding box, Onestop ID, or operator network |
transitland_get_departures | Departures from a stop, each flagged realtime true/false |
Transitland does not geocode place names — resolve a location to coordinates with a geocoding MCP server (e.g. openstreetmap-mcp-server's openstreetmap_geocode) before calling a geography-filtered tool.
| Resource | Description |
|---|---|
transitland://operator/{onestop_id} | Operator record by Onestop ID — agencies, places served, published feeds, and source tags |
transitland://feed/{onestop_id} | Feed record by Onestop ID — spec, fetch URL, license terms, and freshness |
All resource data is also reachable via tools (transitland_get_operator, transitland_find_feeds).
transitland_find_operators toolsearch (name), lat+lon+radius (max 100,000m, default 1,000m), bbox, onestop_id, or adm0_name/adm1_name (country/region) — at least one required, or the call fails as no_filterGTFS_RT entry signals real-time departures may be available), and Wikidata QIDlat requires lon and vice versa, or the call fails as incomplete_pointlimit caps at 100 (default 20), paginated via the after cursortransitland_get_operator toolo-9q9-bart) or an internal integer IDtransitland://operator/{onestop_id} resourceoperator_not_found when the ID doesn't resolvetransitland_find_feeds tooloperator_onestop_id (from transitland_find_operators — the reliable path to one agency's feeds), spec (gtfs/gtfs-rt/gbfs/mds), search, or fetch_error — at least one requiredyes/no/unknown (never inferred from a blank field), plus SPDX identifier and attribution text where knownauthorizationRequired flags feeds whose download needs a separate key/registrationlimit caps at 100 (default 20), paginated via aftertransitland_find_routes toollat+lon+radius (max 50,000m, default 1,000m), bbox, operator_onestop_id, onestop_id, route_type (GTFS mode integer), or search — at least one requiredroute_type mapped to a human-readable mode (bus, subway, rail, ferry, tram, …), brand color, operating agency's Onestop ID, and source feed's Onestop IDlat requires lon and vice versa, or the call fails as incomplete_pointlimit caps at 100 (default 20), paginated via aftertransitland_find_stops toollat+lon+radius (max 10,000m, default 500m), bbox, onestop_id, or served_by_onestop_ids (comma-separated operator/route Onestop IDs) — at least one requiredlocation_type with a label (stop, station, entrance, node, boarding area), wheelchair accessibility, timezone, and the parent station's Onestop ID for child platformslocation_type 0) — a station may return none; use its child platformslimit caps at 100 (default 20), paginated via aftertransitland_get_departures tooltransitland_find_stops firstrealtime flag — true for a live GTFS-Realtime prediction, false for a static scheduled time — plus a scheduleRelationship (STATIC, SCHEDULED, ADDED, CANCELED, UNSCHEDULED, DUPLICATED)realtimeAvailable reports whether the stop's feed publishes GTFS-RT at allnext_seconds look-ahead window: 60–86,400 (default 3,600); widen it or set use_service_window: true when a stop returns nothingstop_not_found when the stop doesn't resolve — detected from an empty upstream array, not an HTTP 404transitland://operator/{onestop_id} resourcetransitland_get_operator — agencies, places served, published feeds, and source tags (Wikidata QID, US NTD ID, Twitter/X handle)onestop_id param accepts an Onestop ID (e.g. o-9q9-bart) or internal integer IDoperator_not_found when the ID doesn't resolvetransitland://feed/{onestop_id} resourcetransitland_find_feeds — spec, fetch URL, real-time endpoints, license terms, and latest-fetch freshnessonestop_id param accepts a feed Onestop ID (e.g. f-9q9-bart) or internal integer IDunknown/null — never inferred as permissivefeed_not_found when the ID doesn't resolveBuilt on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Transitland-specific:
o-/f-/r-/s-) are the identifier spine — surfaced in every result, accepted on input alongside internal integer IDsAgent-friendly output:
realtime boolean and scheduleRelationship, plus a top-level realtimeAvailable, so an agent branches on data, never on parsing a timestampunknown/null and are never inferred as permissive; the schema descriptions tell agents to confirm against the license URL before redistributingmeta.next URL embeds the API key in plaintext; the service discards it and surfaces only the opaque integer after cursor, so the key never reaches tool output or logsAdd the following to your MCP client configuration file. A Transitland API key is required — see Prerequisites for how to get one.
{
"mcpServers": {
"transitland-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/transitland-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"TRANSITLAND_API_KEY": "your-api-key"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"transitland-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/transitland-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"TRANSITLAND_API_KEY": "your-api-key"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"transitland-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "TRANSITLAND_API_KEY=your-api-key",
"ghcr.io/cyanheads/transitland-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 TRANSITLAND_API_KEY=your-api-key bun run start:http
# Server listens at http://localhost:3010/mcp
git clone https://github.com/cyanheads/transitland-mcp-server.git
cd transitland-mcp-server
bun install
cp .env.example .env
# edit .env and set TRANSITLAND_API_KEY
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. A missing TRANSITLAND_API_KEY fails at startup with a banner naming the variable, not at the first tool call.
| Variable | Description | Default |
|---|---|---|
TRANSITLAND_API_KEY | Required. Transitland v2 API key, sent as the apikey query parameter. | — |
TRANSITLAND_BASE_URL | Transitland REST API base URL. Override to pin a specific deployment or a self-hosted instance. | https://transit.land/api/v2/rest |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | Port for the HTTP server. | 3010 |
MCP_HTTP_ENDPOINT_PATH | HTTP endpoint path where the MCP server is mounted. | /mcp |
MCP_AUTH_MODE | Authentication mode: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, notice, warning, error). | info |
LOGS_DIR | Directory for log files (Node.js only). | <project-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry instrumentation (spans, metrics, completion logs). | false |
See .env.example for the full list of optional overrides.
Build and run:
# One-time build
bun run rebuild
# Run the built server
bun run start:stdio
# or
bun run start:http
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security, changelog sync
bun run test # Vitest test suite
bun run lint:mcp # Validate MCP definitions against spec
docker build -t transitland-mcp-server .
docker run --rm -e TRANSITLAND_API_KEY=your-key -p 3010:3010 transitland-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/transitland-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools and resources, inits the Transitland service. |
src/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts). Six tools across operators, feeds, routes, stops, and departures. |
src/mcp-server/resources | Resource definitions (*.resource.ts). Operator and feed records. |
src/services/transitland | Transitland v2 REST client — HTTP, apikey injection, cursor normalization, error classification, and per-endpoint typed methods. |
tests/ | Unit and integration tests mirroring src/. |
See CLAUDE.md / AGENTS.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for request-scoped logging, ctx.state for tenant-scoped storagesrc/mcp-server/*/definitions/index.tsunknown, not permissive)Transit data is provided by Transitland — an open registry aggregating GTFS, GTFS-Realtime, and GBFS feeds from thousands of operators worldwide. Products built on Transitland data must display the name "Transitland" with a link to transit.land/terms, clearly visible to end users.
Transitland aggregates feeds from thousands of operators, each of which may carry its own license and attribution requirements. Review the per-feed license terms at transit.land/terms and comply with each source feed's requirements before redistributing or publishing data obtained through this server.
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
Apache-2.0 — see LICENSE for details.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @cyanheads/transitland-mcp-serverMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-cyanheads-transitland-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/transitland-mcp-server"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.cyanheads/transitland-mcp-server works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.