Skip to main content
Glama
malkreide

swiss-transport-mcp

by malkreide

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_ENVNoProcess environment. Must be 'dev', 'development', 'local', or 'test' to allow disabling TLS verification.
LOG_FORMATNo'json' for structured logs, anything else for text
MCP_STATELESSNoSet to '1' to run Streamable HTTP transport statelessly
SIRI_SX_API_KEYNoOptional key for disruption alerts (SIRI-SX)
MCP_CORS_ORIGINSNoComma-separated list of allowed browser origins for HTTP transport
OJP_FARE_API_KEYNoOptional key for ticket prices (OJP Fare)
FORMATION_API_KEYNoOptional key for train formation
OCCUPANCY_API_KEYNoOptional key for occupancy forecast
TRANSPORT_API_KEYYesUnified API key for OJP 2.0 and CKAN (required for core tools)
TRANSPORT_CKAN_URLNoOverride CKAN base URL (must stay on opentransportdata.swiss allow-list)
OTEL_TRACES_ENABLEDNoSet to '1' to enable OpenTelemetry tracing (requires otel extra)
TRANSPORT_SSL_VERIFYNoSet to 'false' to disable TLS certificate verification (only honoured when MCP_ENV marks a dev environment)
TRANSPORT_OJP_API_KEYNoOptional override for OJP API key
TRANSPORT_CKAN_API_KEYNoOptional CKAN API key

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
transport_search_stopA

Search for Swiss public transport stops and stations by name.

Searches across all Swiss public transport stops (train stations, tram/bus stops, boat stations). Returns stop IDs needed for transport_departures and transport_trip_plan.

Returns: Matching stops with id, name, coordinates, and transport modes.

transport_nearby_stopsA

Find public transport stops near a geographic location.

Useful for finding stops near a school, address, or point of interest. Swiss coordinates only (lat 45–48.5, lon 5.5–10.8).

Returns: Nearby stops with id, name, coordinates, and distance info.

transport_departuresA

Get upcoming departures or arrivals at a Swiss public transport stop.

Shows real-time information including delays when available. Like a digital departure board at a train station.

Use transport_search_stop first to get the stop_id.

Returns: Departures with line, destination, scheduled time, real-time time, delay, and platform.

transport_trip_planA

Plan a journey between two locations in Switzerland.

Works like the SBB app: enter origin and destination (stop IDs or place names), get multiple trip options with transfers, durations, and transport modes.

For best results, use stop IDs from transport_search_stop. Place names (addresses) also work but may be slower.

Returns: Trip options, each with legs (individual journey segments), total duration, number of transfers, and transport modes used.

transport_search_datasetsA

Search the Swiss transport open data catalog (~90 datasets).

Find datasets about timetables, real-time data, GTFS feeds, accessibility info, traffic counters, and more from opentransportdata.swiss.

Returns: Matching datasets with name, description, formats, and download URLs.

transport_get_datasetA

Get full details of a specific transport dataset.

Returns metadata, description, all available resources (files/APIs) with download URLs and formats.

Use transport_search_datasets first to find the dataset ID.

Returns: Full dataset metadata, resources with URLs, and format info.

get_transport_disruptionsA

Aktuelle Störungsmeldungen im Schweizer öffentlichen Verkehr abrufen.

Liefert Informationen zu Zugausfällen, Verspätungen, Gleisänderungen, Streckensperrungen und anderen Betriebsstörungen.

Args: filter_text: Suchbegriff zum Filtern (z.B. "Zürich", "S-Bahn", "IC 1", "Bern-Thun"). Leer = alle Störungen. language: Sprache der Meldungen. DE (Deutsch), FR (Französisch), IT (Italienisch), EN (Englisch). max_results: Maximale Anzahl Ergebnisse (1-50). Standard: 15.

Beispiele: - Alle aktuellen Störungen: get_transport_disruptions() - Störungen in Zürich: get_transport_disruptions(filter_text="Zürich") - S-Bahn Störungen: get_transport_disruptions(filter_text="S-Bahn") - Strecke prüfen: get_transport_disruptions(filter_text="Bern")

get_train_occupancyA

Auslastungsprognose für Schweizer Züge abrufen.

Zeigt, wie voll ein bestimmter Zug voraussichtlich sein wird, aufgeteilt nach 1. und 2. Klasse pro Streckenabschnitt. Auslastungsstufen: wenig belegt, mässig belegt, nur Stehplätze.

Zwei Abfragemodi:

  1. Nach Zugnummer: train_number + operator angeben

  2. Nach Strecke: departure_station + arrival_station angeben

Args: train_number: Zugnummer (z.B. "1009", "IC 708"). Zugtyp-Präfixe werden automatisch entfernt. departure_station: Abfahrtsort für Streckensuche (z.B. "Zürich HB") arrival_station: Ankunftsort für Streckensuche (z.B. "Bern") operation_date: Betriebstag YYYY-MM-DD (Standard: heute). Prognosen sind bis 3 Monate voraus verfügbar. operator: Betreiber-Code. "11"=SBB, "33"=BLS, "65"=Thurbo, "82"=SOB.

Beispiele: - Bestimmter Zug: get_train_occupancy(train_number="1009") - BLS-Zug: get_train_occupancy(train_number="2806", operator="33") - Strecke: get_train_occupancy(departure_station="Zürich HB", arrival_station="Bern")

get_ticket_priceA

Ticketpreise für eine ÖV-Verbindung in der Schweiz abfragen.

Berechnet den Fahrpreis für eine Verbindung inklusive Routeninformation. Zeigt reguläre Tarife an. Rabatte (Halbtax, GA) sind möglicherweise nicht vollständig berücksichtigt.

Args: origin: Abfahrtsort (z.B. "Zürich HB", "Wädenswil", "Bern") destination: Ankunftsort (z.B. "Bern", "Luzern", "Basel SBB") departure_time: Abfahrtszeit im Format YYYY-MM-DDTHH:MM (z.B. "2026-03-01T08:00"). Standard: jetzt. travel_class: Reiseklasse. "first" = 1. Klasse, "second" = 2. Klasse.

Beispiele: - Einfache Preisabfrage: get_ticket_price(origin="Zürich HB", destination="Bern") - Mit Zeitangabe: get_ticket_price(origin="Wädenswil", destination="Luzern", departure_time="2026-03-01T08:00") - 1. Klasse: get_ticket_price(origin="Basel SBB", destination="Genf", travel_class="first")

Hinweis: Für verbindliche Preise immer sbb.ch oder den Schalter konsultieren.

get_train_compositionA

Zugzusammensetzung und Wagenreihung für einen Schweizer Zug abrufen.

Zeigt die Wagenreihung, Klassen, Sektoren, Ausstattung (Rollstuhlplatz, Velohaken, Speisewagen, Familienzone) und Gleisbelegung an.

Args: train_number: Zugnummer (z.B. "2806", "1009", "708"). Nur die Nummer, ohne Zugtyp-Präfix. railway_company: Eisenbahnunternehmen (EVU). Erlaubt: SBBP (SBB), BLSP (BLS), RhB (Rhätische Bahn), SOB (Südostbahn), THURBO, TPF, TRN, MBC, OeBB, VDBB, ZB. operation_date: Betriebstag YYYY-MM-DD. Standard: heute. Wichtig: Stop-based nur für HEUTE verfügbar. show_details: Detailgrad. "stop_based" = kompakt (empfohlen), "vehicle_based" = pro Fahrzeug, "full" = alles.

Beispiele: - SBB-Zug: get_train_composition(train_number="1009") - BLS-Zug: get_train_composition(train_number="2806", railway_company="BLSP") - Detailliert: get_train_composition(train_number="708", show_details="vehicle_based")

Typische Fragen, die damit beantwortet werden können: - "Hat der IC nach Bern einen Speisewagen?" - "Wo kann ich mit dem Rollstuhl einsteigen?" - "In welchem Sektor hält die 1. Klasse?" - "Gibt es Veloplätze im Zug?"

check_transport_api_statusA

Prüft den Verbindungsstatus aller konfigurierten Transport-APIs.

Zeigt an, welche APIs verfügbar sind, ob die API-Keys gültig sind und ob die Dienste erreichbar sind.

Prompts

Interactive templates invoked by user choice

NameDescription
plan_group_tripGuided prompt for planning a Swiss public-transport group outing. Produces an instruction that steers the model through the right tools: resolve stops, check disruptions, plan the journey, and consider occupancy.

Resources

Contextual data attached and managed by the client

NameDescription
list_datasetsList all available transport datasets in the catalog.
server_infoInformation about this MCP server and available APIs.

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

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