# swiss-transport-mcp

Connects AI assistants to Swiss transit data for route planning, delays, fares, and coach layouts. Useful for building multi-leg itineraries directly in chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8
- Author: malkreide
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/malkreide/swiss-transport-mcp
- Updated: 2026-10-15
- HTML: https://affpapa.org/en/nevibecode/mcp/swiss-transport-mcp

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add swiss-transport-mcp -- uvx swiss-transport-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add swiss-transport-mcp -- uvx swiss-transport-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add swiss-transport-mcp uvx swiss-transport-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from swiss-transport-mcp <command>

## When to use it
- 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
- 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

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
