sbb-mcp
Swiss Federal Railways (SBB/CFF/FFS) MCP server — real-time train schedules, ticket prices with Half-Fare/GA support, and direct purchase links via official SBB SMAPI
sbb-mcp
MCP server for Swiss Federal Railways (SBB/CFF/FFS) -- real-time train schedules, prices, and ticket purchase links for any AI assistant.
Works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, ChatGPT, and any MCP-compatible AI client.
Features
- Search stations -- find any Swiss train station by name
- Train connections -- real-time schedules with departure/arrival times, platforms, transfers
- Ticket prices -- 1st/2nd class with Half-Fare (Halbtax) and GA travelcard support
- Purchase links -- direct deep links to buy tickets on SBB.ch
- Pagination -- browse earlier/later connections
- Trip details -- intermediate stops, occupancy, platform changes
- Journey planning -- built-in prompt for end-to-end trip planning
- Mock mode -- works without credentials for testing and demos
Quick Start
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"sbb": {
"command": "npx",
"args": ["-y", "sbb-mcp"],
"env": {
"SMAPI_CLIENT_ID": "your-client-id",
"SMAPI_CLIENT_SECRET": "your-secret",
"SMAPI_SCOPE": "your-scope",
"SMAPI_CONTRACT_ID": "your-contract-id"
}
}
}
}
Claude Code
claude mcp add sbb -- npx -y sbb-mcp
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"sbb": {
"command": "npx",
"args": ["-y", "sbb-mcp"],
"env": {
"SMAPI_CLIENT_ID": "your-client-id",
"SMAPI_CLIENT_SECRET": "your-secret",
"SMAPI_SCOPE": "your-scope",
"SMAPI_CONTRACT_ID": "your-contract-id"
}
}
}
}
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"sbb": {
"command": "npx",
"args": ["-y", "sbb-mcp"],
"env": {
"SMAPI_CLIENT_ID": "your-client-id",
"SMAPI_CLIENT_SECRET": "your-secret",
"SMAPI_SCOPE": "your-scope",
"SMAPI_CONTRACT_ID": "your-contract-id"
}
}
}
}
VS Code Copilot
Add to .vscode/mcp.json:
{
"servers": {
"sbb": {
"command": "npx",
"args": ["-y", "sbb-mcp"],
"env": {
"SMAPI_CLIENT_ID": "your-client-id",
"SMAPI_CLIENT_SECRET": "your-secret",
"SMAPI_SCOPE": "your-scope",
"SMAPI_CONTRACT_ID": "your-contract-id"
}
}
}
}
ChatGPT
ChatGPT supports custom MCP servers via Developer Mode. No approval needed — works on Plus, Pro, Team, Enterprise, and Edu plans.
- Go to Settings → Apps & Connectors → Advanced
- Enable Developer Mode
- Click Create under Connectors
- Enter:
- Name: SBB Swiss Railways
- URL:
https://sbb-mcp-production.up.railway.app/mcp
- Save — SBB tools now appear in your conversations
Then just ask ChatGPT: "Find me trains from Zurich to Bern tomorrow at 9am"
Smithery
Install via Smithery:
npx @smithery/cli mcp add fabsforward2-zhoi/sbb-mcp
Demo Mode (No Credentials)
Run without any environment variables to use mock data:
npx sbb-mcp
This lets you test the MCP server with realistic Swiss station data without SBB API credentials.
Tools
search_stations
Search for Swiss train stations by name. Returns station IDs needed for other tools.
Input:
query(string, required) -- Station name, e.g. "Zurich", "Bern", "Interlaken"limit(number, optional) -- Max results (default: 10)
Example: "Find stations matching Luzern"
search_connections
Find train connections between two stations. Automatically resolves station names to IDs.
Input:
from(string, required) -- Origin station name or ID (e.g. "Zurich HB" or "8503000")to(string, required) -- Destination station name or IDdate(string, optional) -- Travel date YYYY-MM-DDtime(string, optional) -- Departure time HH:MMarrival_time(boolean, optional) -- Treat time as arrival time
Example: "Show me trains from Zurich to Bern tomorrow at 9am"
get_trip_details
Get detailed stop-by-stop information for a connection including intermediate stops, platforms, and occupancy forecasts.
Input:
trip_id(string, required) -- Trip ID from search_connections
get_more_connections
Load earlier or later trains for a previous search.
Input:
collection_id(string, required) -- Collection ID from search_connectionsdirection("next" | "previous") -- Later or earlier trains
get_prices
Get ticket prices with Swiss reduction card support.
Input:
trip_ids(string[], required) -- Trip IDs from search_connectionstraveler_type("ADULT" | "CHILD", default: "ADULT")reduction_card("HALF_FARE" | "GA" | "NONE", default: "HALF_FARE")
Example: "How much is a ticket from Zurich to Zermatt with Half-Fare card?"
get_ticket_link
Get a direct purchase link to buy the ticket on SBB.ch. On mobile with the SBB app installed, opens directly in the app with Halbtax/GA applied automatically.
Input:
trip_id(string, required) -- Trip ID to purchasefrom_name(string, required) -- Origin station namefrom_id(string, required) -- Origin station IDto_name(string, required) -- Destination station nameto_id(string, required) -- Destination station IDdate(string, required) -- Travel date YYYY-MM-DDtime(string, required) -- Departure time HH:MMtraveler_type("ADULT" | "CHILD", default: "ADULT")reduction_card("HALF_FARE" | "GA" | "NONE", default: "HALF_FARE")
Prompts
plan_journey
End-to-end journey planning prompt. Searches connections, compares prices, and provides ticket links.
Input:
from(string, required) -- Origin stationto(string, required) -- Destination stationdate(string, optional) -- Travel date
Environment Variables
| Variable | Required | Description |
|---|---|---|
SMAPI_CLIENT_ID | Yes* | OAuth 2.0 client ID from SBB Developer Portal |
SMAPI_CLIENT_SECRET | Yes* | OAuth 2.0 client secret |
SMAPI_SCOPE | Yes* | OAuth scope |
SMAPI_CONTRACT_ID | Yes* | SBB business contract ID |
SMAPI_ENV | No | int (default) or prod |
SMAPI_TENANT_ID | No | Azure AD tenant (defaults to SBB tenant) |
*Without credentials, the server runs in mock mode with realistic demo data.
Available on
Also available as: sbb-mcp-official | swiss-rail-mcp | sbb-cff-ffs-mcp | swiss-train-mcp | swiss-railways-mcp
About
Built on the official SBB Swiss Mobility API (SMAPI) with OSDM-compliant journey planning and pricing. Covers the entire Swiss public transport network including SBB, BLS, SOB, and regional operators.
SBB (Schweizerische Bundesbahnen) / CFF (Chemins de fer federaux suisses) / FFS (Ferrovie federali svizzere) -- Swiss Federal Railways operates one of the densest rail networks in the world with over 10,000 daily connections.
License
FSL-1.1-MIT -- Functional Source License. Free to use for any non-competing purpose. Converts to MIT after 2 years. See LICENSE for details.
Похожие серверы
通胜 MCP 服务
Provides Chinese Tung Shing (almanac) data, including calendar conversions, auspicious activities, and traditional metaphysical elements.
Poof
Background removal API - remove backgrounds from images with a simple API call. Supports PNG, JPEG, WebP output with transparency or custom backgrounds.
GuanXing (观星) — Chinese Metaphysics AI Tools
MCP server for AI-powered Chinese metaphysics — BaZi (八字), Tarot, I-Ching, Feng Shui, fortune telling, dream interpretation, and more. 12 tools for spiritual exploration.
SpeedOf.Me Speed Test MCP
Official SpeedOf.Me server for AI agents - accurate speed tests via 129 global edge servers with analytics dashboard.
strava mcp
A Model Context Protocol (MCP) server that integrates Strava with Claude for Desktop, enabling AI-powered analysis of your fitness activities.
LLM Router
Multi-LLM routing MCP server — route text, image, video, and audio tasks to 20+ providers (OpenAI, Gemini, Perplexity, Anthropic, fal, ElevenLabs, Runway) with automatic complexity-based model selection, budget control, and provider failover.
402 Index
MCP server for 402 Index: discover 15,000+ paid API endpoints across L402, x402, and MPP
RateAPI MCP Server
Real interest rates from 1,400+ US credit unions across 50 states. Covers mortgages, auto loans, HELOCs, personal loans, and credit cards. Rates ranked by APR with zero affiliate bias. Works with Claude Desktop and ChatGPT. Free tier available.
Kalshi MCP
Self-hosted MCP server for Kalshi prediction market trading via DFlow on Solana. 40 tools for market discovery, order management, position tracking, and Jupiter swaps.
Weather
Provides real-time weather data, forecasts, and alerts using the OpenWeatherMap API.