@cyanheads/transitland-mcp-server
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., "@@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.
Tools
Six tools mirroring the Transitland resource hierarchy — operators → feeds → routes → stops → departures:
Tool | Description |
| Find transit operators/agencies by name, point/radius, bounding box, country/region, or Onestop ID. The entry point for "what transit runs here?" |
| Fetch the full operator record by Onestop ID — agencies, places served, published feeds, and source tags (Wikidata QID, US NTD ID, social handles) |
| Discover GTFS, GTFS-Realtime, and GBFS feeds — fetch URLs, license terms, and last-fetch freshness. Where to legally get a place's open transit data, and on what terms |
| Find routes by point/radius, bounding box, operator, Onestop ID, or GTFS mode. Returns name, mode, brand color, and operating agency |
| Find stops/stations by point/radius, bounding box, Onestop ID, or operator network. Returns coordinates, location type, accessibility, and timezone |
| Departures from a stop, each flagged |
Transitland does not geocode place names. Turn a city or address into coordinates with a geocoding MCP server (e.g. openstreetmap-mcp-server's openstreetmap_geocode) first, then pass lat/lon or a bbox. Geocoding is intentionally not built in — this server resolves coordinates to transit, not names to coordinates.
transitland_find_operators
Find operators near a place or by name — the entry point that resolves a location to the agencies serving it.
Filter by
search(operator/agency name),lat+lon+radius,bbox,onestop_id, oradm0_name/adm1_name(country/region)Returns each operator's Onestop ID, name, the places it serves, the feeds it publishes (a
GTFS_RTentry signals real-time departures may be available), and its Wikidata QID for cross-referencingAt least one filter required — an unfiltered query is rejected with a recovery hint rather than returning a global dump
Pagination via the
aftercursor;enrichment.totalCountand a truncation notice report capped results
transitland_get_operator
Fetch the complete operator record when you already hold an ID — no search round-trip.
Accepts an Onestop ID (
o-9q9-bart) or an internal integer IDReturns agencies (each with the places it serves), published feeds, and source tags: Wikidata QID, US NTD ID, and general social handle
Idempotent single-record lookup; mirrored by the
transitland://operator/{onestop_id}resource
transitland_find_feeds
The open-data catalog — where to get a place's transit data and whether you may redistribute it.
Pass
operator_onestop_id(fromtransitland_find_operators) to list exactly the feeds an operator publishes — the reliable path to a specific agency's feedsAlso filter by
spec(gtfs,gtfs-rt,gbfs,mds),search, orfetch_error(data-quality auditing)Each feed returns its fetch URL, real-time endpoints when present, and license terms — redistribution, commercial use, derived products, and attribution as explicit
yes/no/unknown(never inferred from a blank registry field), plus SPDX identifier and attribution text where knownFreshness: last-fetch timestamp, content hash, and the calendar window the current data covers
authorizationRequiredflags feeds whose download needs a separate key/registration
transitland_find_routes
Find scheduled (GTFS static) route definitions by geography, operator, or mode.
Filter by
lat+lon+radius,bbox,operator_onestop_id,onestop_id,route_type(GTFS mode), orsearchReturns short/long name, the route's GTFS
route_typemapped to a human-readable mode (bus, subway, rail, ferry, tram, …), brand color, the operating agency's Onestop ID, and the source feed's Onestop IDThese are route definitions, not live vehicle positions
At least one filter required; pagination via the
aftercursor
transitland_find_stops
Locate stops and stations — the step before departures.
Filter by
lat+lon+radius,bbox,onestop_id, orserved_by_onestop_ids(operator/route network)Returns coordinates, GTFS
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; use its child platformsPass a returned stop Onestop ID to
transitland_get_departures
transitland_get_departures
Departures from a stop, with the live-vs-scheduled distinction made structural.
Resolve a stop to its Onestop ID with
transitland_find_stopsfirstEvery departure carries a
realtimeflag —truefor a live GTFS-Realtime prediction,falsefor a static scheduled time — plus ascheduleRelationship(STATIC,SCHEDULED,ADDED,CANCELED,UNSCHEDULED,DUPLICATED) so a timetable entry is never mistaken for a live arrival and cancellations are visibleReturns scheduled and (when real-time) 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 allWiden
next_seconds(up to 24h) or setuse_service_window: truewhen a stop returns nothing — some feeds only expose times inside their declared service window
Related MCP server: tomsk-transport
Resources and prompts
Type | Name | Description |
Resource |
| Operator record by Onestop ID — agencies, places served, published feeds, and source tags. Mirrors |
Resource |
| Feed record by Onestop ID — spec, fetch URL, license terms, and latest-fetch freshness. The open-data catalog entry for one feed. |
All resource data is also reachable via tools (transitland_get_operator, transitland_find_feeds), so tool-only clients lose nothing. Stops and routes have no resource — they're discovered in bulk by geography, not referenced by a single stable URI. No prompts: the domain is operational data lookup, with workflow guidance carried in the tool descriptions (geocode-first, operator-then-feeds, stop-then-departures).
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool and resource definitions — single file per primitive, framework handles registration and validation
Unified error handling — handlers throw, framework catches, classifies, and formats, with typed per-tool error contracts and agent-facing recovery hints
Pluggable auth:
none,jwt,oauthSwappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Structured logging with optional OpenTelemetry tracing
STDIO and Streamable HTTP transports — runs locally or on Cloudflare Workers from the same codebase
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-version history sliced to the latest version (the raw endpoint returns the entire fetch log — 167 entries for BART), so a feed lookup returns current freshness, not a multi-year history
Coverage polygons and route/stop geometry omitted by default — a compact country/region/city place summary instead
Agent-friendly output:
The real-time distinction is structural — a per-departure
realtimeboolean andscheduleRelationship, plus a top-levelrealtimeAvailable, so an agent branches on data, never on parsing a timestampLicense terms surfaced honestly — blank registry fields normalize to
unknown/null and are never inferred as permissive; the schema descriptions tell agents to confirm against the license URL before redistributingThe pagination
meta.nextURL embeds the API key in plaintext; the service discards it and surfaces only the opaque integeraftercursor, so the key never reaches tool output or logsEmpty results return data plus 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.3.11 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). |
|
| Storage backend: |
|
| Enable OpenTelemetry instrumentation (spans, metrics, completion logs). |
|
See .env.example for the full list of optional overrides.
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)
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
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.
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.Last updated11GPL 2.0
- Flicense-qualityCmaintenanceMCP server providing real-time public transport data for Tomsk, including routes, schedules, stops with lazy OSM enrichment, nearby stop search, and a routing prompt for LLMs.Last updated
- AlicenseCqualityBmaintenanceMCP server for the UK Bus Open Data Service, enabling timetable queries, stop search, route discovery, journey planning, and real-time bus tracking.Last updated16MIT
- Alicense-qualityCmaintenanceLive intercity bus-trip search across Ukraine and Europe — real-time prices, seats, carriers, cheapest-day-of-month calendar, and trip details with passenger discounts. Read-only, no API key; also available as a hosted remote endpoint at https://mcp.soloway.com.ua/mcp.Last updatedMIT
Related MCP Connectors
Transitland MCP — global GTFS aggregator
MBTA MCP — Boston real-time transit via the MBTA v3 API (api-v3.mbta.com)
DataSF MCP — San Francisco open data (data.sfgov.org, Socrata SODA API).
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/cyanheads/transitland-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server