sncf-mcp
This MCP server provides read-only SNCF train schedules, realtime delays, and disruption information.
Find SNCF station IDs by name.
Get next departures from a station, including realtime delay, cancellation, skipped stops, platform, and optional time/count filters.
Plan journeys between two stations with legs, transfers, duration, and realtime leg status.
View current and upcoming disruptions by station, line, or network-wide, with fallback warnings when realtime data is unavailable.
Provides tools for searching SNCF stations and retrieving real-time departures, journeys, delays, cancellations, skipped stops, and service disruptions via the SNCF API and GTFS-RT feeds.
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., "@sncf-mcp show me the next trains from Paris to Lyon and any delays"
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.
sncf-mcp
Serveur MCP pour les horaires, retards en temps réel et perturbations des trains SNCF (TER, TGV, Intercités), utilisable depuis Claude, ChatGPT, Cursor et tout client MCP.
MCP server for SNCF train schedules, delays and disruptions, built on the SNCF API. Read-only, compact answers, times in Europe/Paris. Remote MCP over streamable HTTP at /mcp.
Tools
Tool | Purpose |
| Station ids by name |
| Next departures with realtime delay, cancellation and skipped stop |
| Journeys with legs and realtime delays |
| Current and upcoming disruptions (service alerts) |
Related MCP server: mcp-sncf-navitia
Realtime
Delays, cancellations, skipped stops and disruptions come from the SNCF GTFS-RT feeds (trip updates and service alerts) of the dataset Réseau SNCF TGV, Intercités et TER, published on transport.data.gouv.fr under the Licence Ouverte. Feeds need no token and are cached for 30 s. A train absent from the feed runs as planned; if the feed is down, tools return planned times with realtime_unavailable.
Configuration
Variable | Default | |
| Required, SNCF API key | |
|
| SNCF API coverage |
| Optional. If set, requests need | |
|
| Listen port |
|
| Bind address ( |
API token
Request a free token on the SNCF developer page. It arrives by email.
Copy
.env.exampleto.envat the repo root and setSNCF_API_TOKEN=<your token>.
.env is ignored by git and never baked into the image: Docker Compose reads it from the repo root at startup, and the local run loads it into the shell. On a server, the .env sits next to compose.yaml.
Run locally
uv sync
set -a; . ./.env; set +a
uv run sncf-mcpServes http://127.0.0.1:8830/mcp. For clients that launch the server themselves over stdio:
uv run sncf-mcp --transport stdioRun with Docker
docker compose up -d --buildServes http://127.0.0.1:8830/mcp, bound to localhost only.
Or pull the published image:
docker run -d --env-file .env -p 127.0.0.1:8830:8830 ghcr.io/keized/sncf-mcp:latestConnect
Claude Code (same machine)
claude mcp add --transport http sncf http://127.0.0.1:8830/mcpWith MCP_AUTH_TOKEN set, add --header "Authorization: Bearer <token>".
claude.ai and ChatGPT (public HTTPS on a VPS)
Both clients call the server from the internet, so it needs a public HTTPS URL.
DNS: create an
Arecord (andAAAAfor IPv6) such assncf.example.compointing to the VPS IP. Do not skip it: without it the certificate cannot be issued.Reverse proxy with TLS, for example Caddy on the VPS, which gets the certificate itself:
sncf.example.com { reverse_proxy 127.0.0.1:8830 }If Caddy runs in Docker, put it on the same network as this container and proxy to
sncf-mcp:8830instead.Protect it: set
MCP_AUTH_TOKEN(for exampleopenssl rand -hex 32). Without it anyone who finds the URL uses your SNCF API quota.Check:
curl -i https://sncf.example.com/mcpmust answer 401.Add the connector with the URL
https://sncf.example.com/mcp:claude.ai: Settings, Connectors, Add custom connector, then in Request headers (beta) add
Authorizationwith the valueBearer <token>.ChatGPT: Plugins, +, Add custom MCP server. It only offers OAuth or no authentication, so it cannot send the token. To use it anyway, leave
MCP_AUTH_TOKENempty and hide the server behind a secret path instead:handle_path /<openssl rand -hex 24>/* { reverse_proxy 127.0.0.1:8830 }plusrespond 404, and usehttps://sncf.example.com/<secret>/mcpas the URL.
Other clients
Use http://127.0.0.1:8830/mcp on the same machine, the public URL otherwise. Drop the header when MCP_AUTH_TOKEN is empty.
Cursor,
~/.cursor/mcp.json(or.cursor/mcp.jsonin a project):{ "mcpServers": { "sncf": { "url": "https://sncf.example.com/mcp", "headers": { "Authorization": "Bearer ${env:SNCF_MCP_TOKEN}" } } } }Devin (runs in the cloud, public URL only): Settings, MCP servers, add a custom MCP server, transport HTTP, the URL, and the header
Authorization: Bearer <token>.OpenClaw:
openclaw mcp add sncf --url https://sncf.example.com/mcp --transport streamable-http --header "Authorization=Bearer <token>"Set
--transportexplicitly: OpenClaw defaults to SSE.Hermes Agent,
~/.hermes/config.yaml, then/reload-mcp:mcp_servers: sncf: url: https://sncf.example.com/mcp headers: Authorization: "Bearer ${SNCF_MCP_TOKEN}"SNCF_MCP_TOKENmust be set in the Hermes profile environment, otherwise the request fails with 401.
Development
Tests, lint and types run in Docker without installing anything:
d() { docker compose run --rm --user "$(id -u):$(id -g)" dev "$@"; }
d uv run ruff check . && d uv run ruff format --check . && d uv run mypy && d uv run pytestRelease: set the same version in pyproject.toml, uv.lock and server.json, merge, then push a tag vX.Y.Z. The publish workflow pushes the image to GHCR and the server to the MCP registry.
License
Apache 2.0: free to use, modify and redistribute, provided you keep the copyright and the NOTICE crediting this project.
Available Tools
4 toolsdeparturesARead-only
Next departures from a station (id from find_station). Delay, cancellation and skipped stop come from the SNCF GTFS-RT realtime feed (transport.data.gouv.fr, open licence); a train absent from it runs as planned (realtime false). Platform only when the SNCF API provides it. realtime_unavailable is set when the feed is down (planned times only). from_datetime is ISO 8601, Paris time if no offset; defaults to now.
Inputs: station_id (required), count, from_datetime. Returns: result
disruptionsARead-only
Current and upcoming disruptions for a station (id from find_station) or a line id (station_id wins when both are given); without arguments, network-wide. Built from the SNCF GTFS-RT service alerts feed (transport.data.gouv.fr, open licence), with the SNCF API as fallback when the feed has nothing. Empty list when there are none; if the feed is down and the API has nothing, a single item with a warning.
Inputs: line_id, station_id. Returns: result
find_stationARead-only
Find train stations by name. Returns station ids to use in the other tools.
Inputs: query (required). Returns: result
journeysARead-only
Journeys between two stations (ids from find_station), departing after
from_datetime (ISO 8601, Paris time if no offset; defaults to now). Leg delays,
cancellations and skipped stops come from the SNCF GTFS-RT realtime feed
(transport.data.gouv.fr, open licence); realtime_unavailable is set when it is down.
Inputs: to_station (required), from_station (required), count, from_datetime. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct job: find_station resolves ids, departures gives a station's departure board, journeys plans station-to-station trips, and disruptions reports alerts. Departures and journeys both surface realtime train status, so an agent could occasionally hesitate, but the one-station vs two-station framing and the id dependency make the boundary clear.
find_station follows a verb_noun pattern while departures, disruptions and journeys are bare nouns, so the set mixes conventions. Names are still readable and each maps obviously to its concept, but there is no predictable pattern to infer a new tool's name from.
Four tools is lean for a transit server but every one earns its place in the core workflow (resolve station → departures/disruptions/journeys). It is on the thin side — no arrivals board or station detail tool — but not unjustifiably so.
The core loop of finding stations, checking departures, planning journeys and viewing disruptions is covered, with a sensible id handoff between tools. However, there is no arrivals board, no station/line detail lookup, and no train-level trip inspection, leaving notable gaps for agents needing arrival data or richer line information.
Maintenance
Related MCP Connectors
Plan door-to-door trips across French trains, buses, transit and flights.
SNCF Open Data (ressources.data.sncf.com) — OpenDataSoft MCP.
Belgian trains for AI agents: live journeys, departures, delays, disruptions. Free, no key.
Omio MCP server for ChatGPT, Claude and any AI agent: search trips, find the cheapest day and start booking in your own Omio account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Omio yourself; Cotlet does not store your password and you need no Omio API key. About the official Omio API: Omio has no public API for your own account (checked 24 Oct 2026). Its affiliate programme lists a Search API for partners, and its app in ChatGPT searches trips; Your Bookings, saved travelers and checkout work only on omio.com and in the Omio app. Setup and FAQ: https://cotlet.dev/integrations/omio-api-mcp-server
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables querying SNCF train schedules and stations in France using the official Navitia API, with support for flexible date parsing and real-time journey planning.31-
- FlicenseNot gradedqualityDmaintenanceMCP server for querying French railway services (SNCF) via the Navitia API, enabling station search, journey planning, and departure board retrieval.-
- AlicenseNot gradedqualityCmaintenanceEnables querying SNCF Open Data (train schedules, stations, punctuality, etc.) through natural language or direct tool calls, with dataset search, metadata retrieval, and ODSQL querying.66 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables natural-language queries about live Belgian trains, metro, tram and bus services — departures, arrivals, A-to-B journey planning, disruptions and train composition — from Claude or any MCP client speaking Streamable HTTP. It runs remotely on Cloudflare Workers, needs no accounts, and stores no personal data.MIT