swiss-transport-mcp — Claude Code MCP server: how to install
Connects AI assistants to Swiss transit data for route planning, delays, fares, and coach layouts. Useful for building multi-leg itineraries directly in chat.
claude mcp add swiss-transport-mcp -- uvx swiss-transport-mcpWhat swiss-transport-mcp does
The server acts as an interpreter between LLMs and opentransportdata.swiss. It queries various transport endpoints using OJP 2.0 over XML/SOAP or SIRI-SX feeds and translates responses into clean JSON. Your assistant inspects departures, track assignments, disruptions, and train configurations without parsing raw XML.
Minimal setup requires a single token in TRANSPORT_API_KEY subscribed to OJP 2.0 via api-manager.opentransportdata.swiss. Omitting optional credentials for passenger load, fare calculation, or formations will not stop the server; it omits those specific endpoints and exposes the six core tools.
Outbound HTTP traffic is strictly pinned to *.opentransportdata.swiss domains to prevent SSRF vulnerabilities. Running the server locally requires Python 3.11 or newer.
What it helps with
- plan Swiss transit connections with exact transfer windows
- retrieve live track alerts and train cancellations via SIRI-SX
- check passenger occupancy levels across Swiss rail operators
- inspect coach formations, accessibility options, and fare estimates
Example prompts for the agent
- Find the next departures from Zurich Stadelhofen with platforms and live delay status
- Check if there are any service alerts between Bern and Geneva today
- Show ticket prices and train formations for the direct connection to Basel
How to install swiss-transport-mcp
Platform CLI
claude mcp add swiss-transport-mcp -- uvx swiss-transport-mcpuvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>
Platform CLI
codex mcp add swiss-transport-mcp -- uvx swiss-transport-mcpuvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>
Config file
{
"mcpServers": {
"swiss-transport-mcp": {
"command": "uvx",
"args": [
"swiss-transport-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>
Config file
{
"servers": {
"swiss-transport-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"swiss-transport-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>
Platform CLI
gemini mcp add swiss-transport-mcp uvx swiss-transport-mcpuvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about swiss-transport-mcp
How do I install swiss-transport-mcp in Claude Code?
Run claude mcp add swiss-transport-mcp -- uvx swiss-transport-mcp in your terminal. Ensure your TRANSPORT_API_KEY environment variable is exported beforehand.
What does swiss-transport-mcp do?
It exposes Swiss transit datasets to AI assistants by converting OJP 2.0 and SIRI-SX responses into structured JSON. It supports timetable queries, live delays, platform updates, and coach layouts.
Do I need separate API keys for every transit feature?
Only the OJP 2.0 key is mandatory. Without extra keys for passenger occupancy, train formations, or ticket pricing, the server starts normally with its core feature set.