@cyanheads/transitland-mcp-server
Provides geocoding capabilities to resolve locations into coordinates for use with geography-filtered transit tools.
Click on "Deploy 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., "@@cyanheads/transitland-mcp-serverfind operators near 37.7749,-122.4194"
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.
Overview
Transit data for thousands of operators worldwide from Transitland, the open aggregator of GTFS, GTFS-Realtime, and GBFS feeds. Find operators and their feeds, and look up routes, stops, and real-time departures.
Tools
Tool | Description |
| Find transit operators/agencies by name, point/radius, bounding box, country/region, or Onestop ID |
| Fetch the full operator record by Onestop ID — agencies, feeds, and source tags |
| Discover GTFS, GTFS-Realtime, and GBFS feeds — fetch URLs, license terms, and freshness |
| Find routes by point/radius, bounding box, operator, Onestop ID, or GTFS mode |
| Find stops/stations by name, point/radius, bounding box, Onestop ID, or operator network |
| Departures from a stop, each flagged |
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.
Resources
Resource | Description |
| Operator record by Onestop ID — agencies, places served, published feeds, and source tags |
| 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).
Related MCP server: mcp-transit-land
Capability reference
Page limits default to 20 and are capped at 100. A larger limit is clamped with a notice, and truncated, shown, and cap appear when a page hits the limit. Use the returned after cursor to continue.
transitland_find_operators tool
Filter by
search(name),lat+lon+radius(max 100,000m, default 1,000m),bbox,onestop_id, oradm0_name/adm1_name(country/region) — at least one required, or the call fails asno_filterlatrequireslonand vice versa, or the call fails asincomplete_pointReturns each operator's Onestop ID, name, places served, published feeds (a
GTFS_RTentry signals real-time departures may be available), and Wikidata QID
transitland_get_operator tool
Accepts an Onestop ID (e.g.
o-9q9-bart) or an internal integer IDReturns agencies (each with places served), published feeds, and source tags: Wikidata QID, US NTD ID, general Twitter/X handle
operator_not_foundwhen the ID doesn't resolve
transitland_find_feeds tool
Filter by
operator_onestop_id(fromtransitland_find_operators),spec(gtfs/gtfs-rt/gbfs/mds; case and underscore/hyphen variants such asGTFS_RTare accepted),search, orfetch_error— at least one requiredEach feed returns its fetch URL, real-time endpoints, freshness (last fetch, content hash, calendar window covered), and license terms — redistribution, commercial use, derived products, and attribution as
yes/no/unknown, never inferred from a blank field — plus SPDX identifier and attribution text where knownauthorizationRequiredflags feeds whose download needs a separate key or registration
transitland_find_routes tool
Filter by
lat+lon+radius(max 50,000m, default 1,000m),bbox,operator_onestop_id,onestop_id,route_type(GTFS mode integer), orsearch— at least one requiredlatrequireslonand vice versa, or the call fails asincomplete_pointReturns short/long name, GTFS mode (bus, subway, rail, ferry, tram, …), brand color, and the operating agency's and source feed's Onestop IDs. A missing route type is
nullwith modeunknownScheduled (GTFS static) route definitions, not live vehicle positions
transitland_find_stops tool
Filter by
lat+lon+radius(max 10,000m, default 500m),bbox,onestop_id,served_by_onestop_ids(comma-separated operator/route Onestop IDs), or stop-namesearch— at least one required. Name searches need no geocodingReturns coordinates (
nullwhen missing upstream),location_typewith a label (stop, station, entrance, node, boarding area), wheelchair accessibility, timezone, and the parent station's Onestop ID for child platformsDepartures attach to platform-level stops (
location_type0) — a station may return none, so use its child platforms
transitland_get_departures tool
Resolve a stop to its Onestop ID with
transitland_find_stopsfirst;stop_not_foundwhen it doesn't resolve.next_secondssets the look-ahead window: 60–86,400 (default 3,600) — widen it or setuse_service_window: truewhen a stop returns nothingEvery departure carries a
realtimeflag (truefor a live GTFS-Realtime prediction,falsefor a scheduled time) and ascheduleRelationship(STATIC,SCHEDULED,ADDED,CANCELED,UNSCHEDULED,DUPLICATED)Also returns scheduled and estimated times with delay in seconds, route, headsign, mode, trip, direction, and accessibility; top-level
realtimeAvailablereports whether the stop's feed publishes GTFS-RT at all
transitland://operator/{onestop_id} resource
Mirrors
transitland_get_operator— agencies, places served, published feeds, and source tagsonestop_idaccepts an Onestop ID (e.g.o-9q9-bart) or internal integer ID;operator_not_foundwhen it doesn't resolve
transitland://feed/{onestop_id} resource
Mirrors a single-feed result from
transitland_find_feeds— spec, fetch URL, real-time endpoints, license terms, and freshnessonestop_idaccepts a feed Onestop ID (e.g.f-9q9-bart) or internal integer ID;feed_not_foundwhen it doesn't resolveBlank license fields come back as
unknown/null, never inferred as permissive
Features
Built 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:
Direct HTTP client for the Transitland v2 REST API — no SDK dependency, a flat query-param contract over a handful of GET endpoints
Onestop IDs (
o-/f-/r-/s-) are the identifier spine — surfaced in every result, accepted on input alongside internal integer IDsFeed lookups return only the latest feed version's freshness, not the full fetch history
Coverage polygons and route/stop geometry are omitted; results carry a compact country/region/city place summary instead
Agent-friendly output:
Real-time status is explicit: per-departure
realtimeandscheduleRelationship, plus a top-levelrealtimeAvailableBlank license fields come back as
unknown/null, never inferred as permissive, and agents are told to confirm against the license URL before redistributingUpstream pagination URLs embed the API key; only the opaque
aftercursor is surfaced, so the key never reaches tool output or logsEmpty results return an actionable notice (geocode first, widen the window, try a child platform) rather than an error
Getting started
Add 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/mcpPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
A Transitland v2 API key — register at the Transitland developer portal. The free tier is rate-limited; the Pro tier raises the quota.
Installation
Clone the repository:
git clone https://github.com/cyanheads/transitland-mcp-server.gitNavigate into the directory:
cd transitland-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env and set TRANSITLAND_API_KEYConfiguration
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 |
| Required. Transitland v2 API key, sent as the | — |
| Transitland REST API base URL. Override to pin a specific deployment or a self-hosted instance. |
|
| Transport: |
|
| Port for the HTTP server. |
|
| HTTP endpoint path where the MCP server is mounted. |
|
| Authentication mode: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Log failed calls' arguments and result, redacted by key name (secrets in free-form values remain). Size capped by |
|
| Storage backend: |
|
| Enable OpenTelemetry instrumentation (spans, metrics, completion logs). |
|
See .env.example for the full list of optional overrides.
HTTP sessions are stateless by default; set MCP_SESSION_MODE to override.
Running the server
Local development
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun 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
docker build -t transitland-mcp-server .
docker run --rm -e TRANSITLAND_API_KEY=your-key -p 3010:3010 transitland-mcp-serverThe 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.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions ( |
| Transitland v2 REST client — HTTP, |
| Unit and integration tests mirroring |
Development guide
See CLAUDE.md / AGENTS.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the barrels in
src/mcp-server/*/definitions/index.tsWrap the Transitland API: validate raw → normalize to domain type → return output schema; never fabricate missing fields (especially license terms — blanks are
unknown, not permissive)
Data & licensing
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.
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Transitland MCP — global GTFS aggregator
MobilityData's open catalogue of public-transport feeds — ~4,500 GTFS schedule feeds and ~1,900…
Read-only public transit departures, stop search, and city coverage for bus and train users.
MBTA MCP — Boston real-time transit via the MBTA v3 API (api-v3.mbta.com)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP 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.8 npmGPL 2.0
- AlicenseNot gradedqualityBmaintenanceEnables querying global transit data including agencies, routes, stops, and departures through a GTFS aggregator.8 npmMIT
- FlicenseNot gradedqualityBmaintenanceMCP server exposing live MBTA V3 transit data, with tools for routes, stops, arrivals, alerts, and vehicle positions.-
- AlicenseNot gradedqualityBmaintenanceEnables searching for buses and trains, and when direct routes are unavailable, it provides the underlying data needed to assemble multi-leg itineraries with transfers.4 npmISC