Navitia MCP Server
Summary: Navitia MCP Server exposes the Navitia public-transport API so an MCP client (Claude Desktop, Claude Code, etc.) can plan journeys, find stops/lines, and read realtime departure and timetable boards for a single coverage region (default Île-de-France, fr-idf).
Search places (
search_places) — geocode/autocomplete stations, addresses, POIs and cities; returns ids for use in other tools.Find places nearby (
places_nearby) — stops and POIs within a radius (default 500 m, max 10 km) of a coordinate.Search public-transport objects (
search_pt_objects) — resolve networks, lines, routes, stop areas and modes by name (e.g. "metro 14" → aline:id).Plan a journey (
plan_journey) — multi-modal door-to-door itineraries with legs, transfers, disruptions, wheelchair filtering, max transfers and up to 10 options.Steer line preferences —
prefer_lines/avoid_linesnudge ranking (experimental), whileforbidden_urisexcludes a line, network or mode outright.Check next departures/arrivals (
next_departures/next_arrivals) — realtime boards for a stop or platform, optionally filtered to one line.Read timetables —
stop_schedules(grouped by line/direction),terminus_schedules(station-display board for one line by destination),route_schedules(full grid along a line/route).Get realtime awareness — time-sensitive responses carry a top-level
now, and journey sections flagrealtime: trueplus line badge colours.Render journey results as a widget — in MCP Apps hosts,
plan_journeyshows an interactive itinerary list; other hosts get plain text.
Provides access to French national railway (SNCF) public transport data, including journey planning, real-time departures, and schedules, when configured with the SNCF coverage region.
Navitia MCP Server
An MCP server exposing the Navitia public-transport API: journey planning, place search, realtime departures and timetables, usable from Claude Desktop, Claude Code, or any MCP client.
→ Full usage guide — install, client setup, worked examples, tool reference, response shapes and troubleshooting.
Tools
Tool | What it does |
| Geocode / autocomplete stations, addresses, POIs, cities — returns the object ids the other tools need |
| Find networks, lines, routes and stops by name (e.g. "metro 14" → a |
| Stops and POIs within a radius of a coordinate |
| Door-to-door multi-modal itineraries (with disruptions), with optional per-line preferences |
| Realtime departure/arrival boards for a stop |
| Timetable at a stop, grouped by line and direction |
| Station-display board for one line at a stop, grouped by destination (needs a |
| Full timetable grid for a line or route |
The server is scoped to a single coverage region (default Île-de-France, fr-idf) set via the NAVITIA_REGION env var — tools take no region parameter. Set NAVITIA_REGION=fr-se for the southeast (Lyon), sncf for national rail, etc.
Related MCP server: BVG MCP Server
Configuration
Env var | Required | Default | Purpose |
| yes | — | Your Navitia token |
| no |
| Coverage region id the server is scoped to |
| no |
| API root (override for a self-hosted Navitia) |
Setup
You need a Navitia API token (request one via navitia.io / Hove). The server reads it from NAVITIA_API_KEY only — never commit it. For local runs, copy .env.example to .env (gitignored) or export the variable in your shell.
npm install
npm run buildClaude Code
claude mcp add navitia --env NAVITIA_API_KEY=your-token --env NAVITIA_REGION=fr-idf -- node /absolute/path/to/dist/index.jsClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"navitia": {
"command": "node",
"args": ["/absolute/path/to/dist/index.js"],
"env": {
"NAVITIA_API_KEY": "your-token",
"NAVITIA_REGION": "fr-idf"
}
}
}
}Line preferences (experimental)
plan_journey can express a taste for or against a line instead of a hard rule:
Parameter | Effect | Typical phrasing |
| Favours the line — itineraries using it rank higher | "I'd rather take metro 14" |
| Proposes the line less, without removing it | "I'd like to avoid metro 14, but not rule it out" |
| Excludes the line outright | "never put me on metro 14" |
All three take ids from search_pt_objects; prefer_lines / avoid_lines reject anything that is not a line: id rather than sending it on.
Preferences map to Navitia's experimental flag, one per line:
_features_flags[]=boost_line({line_id},{boost_factor})with boost_factor = 3 for a preferred line and 0.4 for an avoided one.
Because boosting changes what the default ordering means, a response that used line preferences is re-ordered by the reliability rank in each journey's criteria_ranker — rank 1 first — and carries ordered_by: "reliability" so the client can explain the order it is showing. Without preferences, the API's own order is left untouched and ordered_by is absent.
The flag is experimental and depends on server-side support: an instance that does not implement it may ignore it or return an error, which the tool relays unchanged.
Usage notes
Datetimes are ISO 8601 in the region's local time (e.g.
2026-06-11T17:30); responses use the same format.Ids: find stops/addresses with
search_places(stop_area:…), and lines/networks withsearch_pt_objects(line:…), then feed them to the journey/departure/schedule tools.terminus_schedulesrequires aline_id— resolve it withsearch_pt_objectsfirst (e.g. "metro 14").plan_journeycalls always carry the technical parameter_frontend=gormun, which identifies this caller to Navitia. It is a constant, not a tool input.Line preferences (
prefer_lines/avoid_linesonplan_journey) nudge the ranking;forbidden_urisremoves a line entirely. See Line preferences.All tools are scoped to the
NAVITIA_REGIONcoverage; no per-callregionparameter. To serve several regions, run one instance per region.Responses are deliberately slimmed (no geojson/links) to stay LLM-friendly; large results are truncated at 50 kB.
Output format
Tools return slimmed JSON — Navitia's HATEOAS links, geojson geometries and deep fare/co2 trees are dropped so the payload stays inside a model's context. Presentation is the client's job, not the server's.
Time-sensitive responses (plan_journey, next_departures, next_arrivals, stop_schedules, terminus_schedules, route_schedules) carry a top-level now — the API's own context.current_datetime, in the region's local timezone. Compute countdowns ("dans 3 min") against that field, never against the reader's clock, which may sit in another timezone.
Each journey also carries Navitia's criteria_ranker when the API supplies it — that journey's 1-based rank for asap, less_transfers, less_walking and reliability, 1 being the best on that criterion. It is what the line-preference re-ordering sorts on, and a client can reuse it to tag itineraries.
Journey sections carry the line's badge colours (color, text_color, as #RRGGBB) and realtime: true when timed from live data. Journey disruptions are deduplicated — Navitia repeats each one per impacted object — and their messages flattened to plain text.
Journeys widget (MCP Apps)
In hosts that support MCP Apps — Claude on the web and Desktop among them — plan_journey results render as an interactive itinerary list in the conversation. The tool points at the ui://navitia/journeys.html resource through _meta.ui.resourceUri and returns its payload as structuredContent next to the usual text, so hosts without MCP Apps (Claude Code in a terminal, for one) keep getting text only.
The widget shows one row per itinerary — duration, times, the lines taken, transfers and walking — and the steps of the row you click; disruptions shrink to one expandable line. It leaves out itineraries with an incoherent leg (one that ends before it starts) and walk-only options more than twice as long as the quickest public-transport one. The model still receives every journey.
Its source is in ui/journeys/; npm run build bundles it into the single file dist/ui/journeys.html the server serves.
prompts/agent-system-prompt.md is a ready-to-use strict system prompt for an agent driving this server: it specifies the board layouts (departure boards, journey chains, timetables), the anti-fabrication rules, and the id-resolution protocol.
Development
NAVITIA_API_KEY=your-token npm run dev # run from source
npx @modelcontextprotocol/inspector node dist/index.js # interactive testing
npm run preview:ui # build .preview/ to work on the widget
python3 -m http.server 4173 -d .preview # …then open http://localhost:4173
npm run typecheck:ui # type-check the widget sourcesThe preview is a minimal MCP Apps host: it mounts the widget in a sandboxed iframe, as Claude does, and replays the scenarios in ui/preview/fixtures/ (a real response, no result, an error, still loading), in light or dark theme and at chat or phone width.
See docs/USAGE.md for the full guide, and docs/USAGE.md#12-troubleshooting when something returns nothing.
Available Tools
9 toolsnext_arrivalsNext arrivalsA
List the next arrivals at a stop (station or platform), with realtime delays when available.
Inputs: stop_id (required), count, line_id, from_datetime, +1 more.
next_departuresNext departuresB
List the next departures from a stop (station or platform), with realtime delays when available.
Inputs: stop_id (required), count, line_id, from_datetime, +1 more.
places_nearbyFind places nearbyA
List public-transport stops and POIs within a radius of a coordinate. Useful to find the nearest station to a location.
Inputs: lat (required), lon (required), count, types, +1 more.
plan_journeyPlan a journeyA
Compute public-transport journeys between two points (multi-modal door-to-door routing). Returns up to 'max_nb_journeys' itineraries with legs, times, transfers and any disruptions. To express a taste for or against a line without ruling it out, pass 'prefer_lines' / 'avoid_lines'; use 'forbidden_uris' to exclude something outright.
Inputs: to (required), from (required), datetime, wheelchair, +6 more.
route_schedulesRoute schedulesA
Full timetable grid for a line or route: every stop along the way with the times of upcoming vehicles. Heavier output — prefer stop_schedules when you only care about one stop.
Inputs: id (required), from_datetime, data_freshness, items_per_schedule.
search_placesSearch places (autocomplete)A
Geocode / autocomplete stations, addresses, POIs and cities by free-text query. Returns object ids usable as from/to in plan_journey or as stop_id in departure/schedule tools.
Inputs: query (required), count, types.
search_pt_objectsSearch public-transport objectsA
Find public-transport objects (networks, lines, routes, stop_areas, transportation modes) by name and return their ids. Use this to resolve a line to its id — e.g. 'metro 14' -> a 'line:...' id — to pass as line_id in next_departures/stop_schedules, or to forbid a line, transportation mode or network in plan_journey.
Inputs: query (required), count, types.
stop_schedulesStop schedulesB
Timetable at a stop, grouped by line and route: for each line/direction serving the stop, the next departure times.
Inputs: stop_id (required), line_id, from_datetime, data_freshness, +1 more.
terminus_schedulesTerminus schedulesA
Departure board for one line at a stop, grouped by final destination (terminus) — what you would see on a station display. Both a stop and a line are required: resolve the line id with search_pt_objects first.
Inputs: line_id (required), stop_id (required), from_datetime, data_freshness, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools have clearly distinct purposes: search_places handles geocoding, search_pt_objects resolves PT identifiers, and plan_journey covers routing. The schedule/departure tools overlap somewhat, but their descriptions differentiate granularity well enough for an agent to choose correctly.
Naming is readable and grouped by domain (search_*, *_schedules, next_*), but it does not follow a single consistent verb_noun pattern. places_nearby and plan_journey deviate from the otherwise mostly noun-based tool names.
The 9 tools are well-scoped for a public-transport MCP server. Each tool covers a distinct part of the workflow—place search, PT-object resolution, journey planning, and multiple schedule/departure queries—without unnecessary redundancy.
The set covers the full read-only workflow: resolve places and PT objects to IDs, plan journeys, and query departures, arrivals, or timetables at stop, line, and route granularity. There are no obvious dead ends because the search tools explicitly feed the routing and schedule tools.
Related MCP Connectors
Hosted MCP App, public transport worldwide powered by Transitous: journeys, boards, real time, maps
Read-only public transit departures, stop search, and city coverage for bus and train users.
Swiss Transport MCP — wraps Transport Open Data API (free, no auth)
Transitland MCP — global GTFS aggregator
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP service for interacting with Transport NSW's API that enables users to find transport stops around locations and retrieve information about transport alerts and disruptions.3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with the Berlin Public Transport (BVG) API to search for locations and plan journeys. It provides real-time access to departures, arrivals, trip details, and vehicle tracking within Berlin's transit network.MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying Swiss public transport data (stations, departures, connections) from the Transport Open Data API via natural language through an MCP gateway.74 npmMIT
- AlicenseAqualityDmaintenanceAn MCP server exposing Greater Helsinki public transport data from Digitransit, enabling LLM hosts to answer live transit queries, plan journeys, and fetch stop departures via natural language.310 npmMIT