An MCP server for the Swiss Public Transport API. Query stations, connections, and live departure boards through any MCP-compatible client.
Deployed on Vercel at:
https://sbbmcp.vercel.app/mcp
- Station search — Find stations, addresses, and points of interest by name or GPS coordinates
- Connection search — Look up routes between two locations with filters for date, time, transport type, and via stops
- Station board — Get real-time departure and arrival boards with delay information
- LLM-optimized output — Structured, readable text rather than raw JSON
claude mcp add --transport http swiss-transport https://sbbmcp.vercel.app/mcpAdd --scope user for all projects:
claude mcp add --transport http --scope user swiss-transport https://sbbmcp.vercel.app/mcpAdd to claude_desktop_config.json:
{
"mcpServers": {
"swiss-transport": {
"url": "https://sbbmcp.vercel.app/mcp"
}
}
}- Go to Settings > Integrations
- Click Add integration > MCP Server
- Enter URL:
https://sbbmcp.vercel.app/mcp
Add to .cursor/mcp.json:
{
"mcpServers": {
"swiss-transport": {
"url": "https://sbbmcp.vercel.app/mcp"
}
}
}Any client supporting Streamable HTTP transport can connect at https://sbbmcp.vercel.app/mcp.
For local use with Claude Desktop or Claude Code without the remote server:
git clone https://github.com/xadcv/sbbmcp.git
cd sbbmcp
npm install
npm run buildThen register via stdio:
claude mcp add swiss-transport node /absolute/path/to/sbbmcp/dist/index.jsOr for development without building:
npm run devThree tools wrapping the transport.opendata.ch API endpoints.
Find Swiss public transport stations, addresses, and points of interest.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string |
No* | Name of the location |
x |
number |
No* | Latitude (WGS84) |
y |
number |
No* | Longitude (WGS84) |
type |
string |
No | all, station, poi, address (default: all) |
*Either query or both x and y must be provided.
Find connections between two locations.
| Parameter | Type | Required | Description |
|---|---|---|---|
from |
string |
Yes | Departure station name or ID |
to |
string |
Yes | Arrival station name or ID |
via |
string[] |
No | Up to 5 intermediate stops |
date |
string |
No | Travel date (YYYY-MM-DD) |
time |
string |
No | Travel time (HH:mm) |
isArrivalTime |
boolean |
No | Treat time as arrival (default: false) |
transportations |
string[] |
No | train, tram, ship, bus, cableway |
limit |
number |
No | Results 1-6 (default: 4) |
page |
number |
No | Pagination 0-10 (default: 0) |
Get departures or arrivals for a station.
| Parameter | Type | Required | Description |
|---|---|---|---|
station |
string |
No* | Station name |
id |
string |
No* | Station ID (takes precedence) |
limit |
number |
No | Max entries 1-420 (default: 20) |
transportations |
string[] |
No | train, tram, ship, bus, cableway |
datetime |
string |
No | Date and time (YYYY-MM-DD HH:mm) |
type |
string |
No | departure or arrival (default: departure) |
*Either station or id must be provided.
sbbmcp/
├── api/
│ └── mcp.ts # Vercel serverless function (Streamable HTTP)
├── src/
│ ├── index.ts # Local stdio entry point
│ ├── tools.ts # Shared tool registration and formatters
│ ├── api.ts # HTTP client for transport.opendata.ch
│ └── types.ts # TypeScript interfaces for API responses
├── vercel.json # Vercel routing and function config
├── tsconfig.json
└── package.json
Push to GitHub and connect the repo in the Vercel dashboard. The api/mcp.ts serverless function is picked up automatically.
For best performance, enable Fluid compute in your Vercel project settings.
- Rate limit: 3 requests/second/IP on transport.opendata.ch
- No API key required — the upstream API is free and open
- Coverage: SBB/CFF/FFS, PostBus, local transit, boats, and cableways
ISC