Skip to main content
Glama
tpjnorton

swiss-public-transport-mcp

by tpjnorton

swiss-public-transport-mcp

MCP server for Swiss public transport — connections, stationboards, real-time delays, and direct booking links for SBB.

Wraps transport.opendata.chfree, no API key, no signup. Covers the full Swiss network (SBB, Postauto, regional, trams, buses, ships, cableways).

Why this server

  • Zero config. Install and go — no account, no token, no env vars.

  • Booking links. Returns deep links into SBB.ch so the user can buy a ticket in one click.

  • Disambiguation built in. Ambiguous station names return candidates instead of failing silently.

  • Compact, model-friendly output. Formatted text designed for LLM context windows, not raw JSON dumps.

Related MCP server: swiss-rail-mcp

Tools

Tool

Purpose

search_locations

Resolve a station/stop/POI by name or coordinates

plan_journey

Plan A → B with via, transport-type filters, arrival-time mode

get_stationboard

Live departures or arrivals from any stop

get_booking_link

Build an SBB.ch URL for a journey so the user can buy a ticket

Install

No install needed — run directly with uvx:

uvx swiss-public-transport-mcp

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "swiss-public-transport": {
      "command": "uvx",
      "args": ["swiss-public-transport-mcp"]
    }
  }
}

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Development

git clone https://github.com/tpjnorton/swiss-public-transport-mcp.git
cd swiss-public-transport-mcp
uv sync
uv run swiss-public-transport-mcp

If you need official opentransportdata.swiss data — SIRI-SX disruption alerts, occupancy forecasts, OJP Fare ticket prices, train formation — see malkreide/swiss-transport-mcp. It exposes ~11 tools across the official OJP 2.0 / SIRI / CKAN APIs and requires a (free) API key from the opentransportdata.swiss API Manager.

this server

malkreide/swiss-transport-mcp

Data source

transport.opendata.ch

opentransportdata.swiss (official)

API key

none

required (free signup)

Tools

4 (journey planning + booking links)

11 (planning + disruptions + occupancy + fares + formation)

Setup

one command

per-API key configuration

Best for

quick journey planning, fast LLM responses, ticket purchase flow

rich operational data, official feeds

The two servers cover overlapping but distinct use cases — you can install both side by side.

Available Tools

4 tools
get_stationboardA

Check what's departing or arriving at a Swiss station right now.

Use this to:

  • See upcoming departures ("what trains leave from Bern soon?")

  • Check if a specific service is delayed or cancelled

  • Browse arrivals at a station

  • Filter by transport type (trains only, buses only, etc.)

Returns a live board with times, platforms, destinations, and delay status.

ParametersJSON Schema
NameRequiredDescriptionDefault
stationYes
modeNodeparture
limitNo
datetimeNo
transport_typesNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses that the tool returns live data with times, platforms, destinations, and delays. However, it does not mention any potential rate limits, authentication needs, or side effects, though the tool is read-only and safe.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: a brief intro, bullet-pointed use cases, and a summary sentence. It is well-structured, front-loaded, and contains no extraneous text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the 5 parameters and existence of an output schema, the description covers the main functionality and return format. It lacks details on error handling or constraints (e.g., valid stations), but is adequate for the tool's purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It explains transport_types filtering and implies mode via 'departures/arrivals', but does not explicitly describe station, limit, or datetime parameters, leaving significant gaps in parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool checks departures/arrivals at Swiss stations with specific use cases. It uses a strong verb ('Check') and resource ('stationboard'), and the sibling tools (plan_journey, search_locations, get_booking_link) are distinct, so differentiation is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit use cases in bullet points, making it clear when to use this tool. However, it does not explicitly state when not to use it or directly name alternatives like plan_journey for journey planning, leaving a slight gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

plan_journeyA

Plan a journey through Switzerland by train, bus, tram, boat, or cableway.

Use this whenever someone wants to:

  • Travel from A to B (e.g., "how do I get from Zürich to Zermatt?")

  • Plan a multi-stop trip (use via for intermediate stops)

  • Find the best connection for a specific date/time

  • Arrive somewhere by a deadline (set is_arrival_time=True)

  • Compare route options across different transport types

Returns real-time schedules with platform numbers, delays, transfers, and occupancy levels. Call multiple times with different legs to plan a full day itinerary visiting several places.

ParametersJSON Schema
NameRequiredDescriptionDefault
from_stationYes
to_stationYes
viaNo
dateNo
timeNo
is_arrival_timeNo
transport_typesNo
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so description carries full burden. It discloses that the tool returns real-time schedules with platform numbers, delays, transfers, and occupancy levels. It also mentions calling multiple times for full day itinerary. Does not mention destructive actions or authentication needs, but overall adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with three sentences plus bullet-like usage list. Information is front-loaded with purpose, then usage scenarios, then return details. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is an output schema, description does not need to explain returns. It covers usage, key parameters, and behavior. However, with 8 parameters and only partial description, it could be more thorough. Still adequate for most use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so description must compensate. It explains only some parameters: 'from_station', 'to_station', 'via', and 'is_arrival_time'. It does not explain 'date', 'time', 'transport_types', or 'limit'. This partial coverage provides some value but leaves gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it plans a journey through Switzerland by specific transport types. It lists explicit use cases (from A to B, multi-stop, etc.) and the verb 'plan' with resource 'journey' is specific. Distinguishes from siblings like get_booking_link, get_stationboard, search_locations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this whenever someone wants to:' and lists four scenarios. It gives clear context but does not mention when not to use it or compare with alternatives. Parenthetical examples like 'use `via` for intermediate stops' provide guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_locationsA

Find Swiss train stations, bus stops, and other transport locations.

Use this to:

  • Look up a station name (e.g., "Bern", "Zürich HB", "Interlaken")

  • Find stations near GPS coordinates (e.g., near your hotel)

  • Resolve ambiguous names before planning a journey

Returns station IDs, coordinates, and relevance scores.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNo
latitudeNo
longitudeNo
typeNostation

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must bear the full burden. It does not declare whether the tool is read-only or describe any side effects, though it implies a query-like operation. The mention of 'returns station IDs, coordinates, and relevance scores' is helpful, but lacks explicit behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured, using a short paragraph with bullet points. Every sentence adds value, and the purpose is front-loaded. No redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists, return values are covered. The description addresses key aspects: search by name or coordinates, and resolving ambiguity. However, it omits explanation of the 'type' parameter and does not mention any result limits or pagination, leaving minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description adds some meaning by mapping use cases to parameters: 'query' for name, 'latitude'/'longitude' for GPS. However, the 'type' parameter is not described, leaving a gap. The description provides partial compensation, but not full coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Find Swiss train stations, bus stops, and other transport locations.' It distinguishes from siblings like get_booking_link, get_stationboard, and plan_journey, which handle different tasks. The verb 'search' and resource 'locations' are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit use cases: look up station name, find near GPS, resolve ambiguous names. It implies usage before planning a journey, but does not explicitly state when not to use or mention alternatives. However, it gives sufficient context for appropriate use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.2/5.0
Disambiguation5/5

All four tools serve clearly distinct purposes: searching locations, planning journeys, checking station boards, and generating booking links. There is no overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (get_booking_link, get_stationboard, plan_journey, search_locations) with underscores and no mixing of conventions.

Tool Count5/5

Four tools is exactly right for a public transport MCP server—core functionalities (search, plan, live board, booking) are each covered by a single tool without unnecessary fragmentation or overlap.

Completeness4/5

The server covers the essential user journeys: finding stations, planning trips, checking real-time departures, and purchasing tickets. Minor gaps like disruptions alerts or fare details are absent but do not severely hinder common use cases.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    Independent MCP client by swsistrip for Swiss Federal Railways (SBB/CFF/FFS) — all schedules, prices, ticket links via SBB's official SMAPI.
    9
    23
    3
    Unlicense - libtelnet variant
  • A
    license
    A
    quality
    D
    maintenance
    A zero-authentication MCP server for Swiss public transport, enabling users to query train connections, disruptions, station facilities, and plan journeys using natural language.
    12
    MIT

Latest Blog Posts

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/tpjnorton/swiss-public-transport-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server