Skip to content
Back to search

sbb-twin-mcp

Read-only MCP server for the LauzHack 2026 Swiss rail digital twin (ChatGPT, Claude, Codex)

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lauztakt--sbb-twin-mcp/badge.svg)](/listings/lauztakt--sbb-twin-mcp)

HTML

<a href="/listings/lauztakt--sbb-twin-mcp"><img src="/api/listings/lauztakt--sbb-twin-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 68 lines
  1. # sbb-twin-mcp
  2. A **read-only MCP server** for the LauzHack 2026 Swiss rail digital twin ([sbb-twin](https://github.com/LauzTakt/sbb-twin)):
  3. live trains following SBB realtime data, control-centre disruptions with their bulletins, real SBB service alerts, station
  4. boards and the twin's journey planner. It lets ChatGPT, Claude, Codex or any MCP client answer questions such as *"what is
  5. happening on the network now?"*, *"is the IC 1 735 late?"* or *"what is the fastest way from Bern to Zürich HB right now?"*.
  6. Design by Astra (Codex advisor), implemented and tested against the deployed twin. Agents: read [AGENTS.md](AGENTS.md) and
  7. [skills/read-sbb-twin/SKILL.md](skills/read-sbb-twin/SKILL.md).
  8. ## Tools
  9. | Tool | What it answers |
  10. |---|---|
  11. | `twin_status` | Twin clock, trains in service, freshness of the realtime and SBB-alert feeds (`live` or `degraded`) |
  12. | `search` | Ids for station names, train numbers (`IC1 735`), lines, issue keywords, `network` |
  13. | `fetch` | The full text document for one id (`network:now`, `station:<id>`, `train:<id>`, `disruption:<id>`, `alert:<id>`, `incident:<id>`, `journey:<id>`) with a citation URL |
  14. | `list_issues` | Control disruptions, real SBB alerts and incidents, most important first |
  15. | `get_disruption` | One control disruption: cause, section, effect, expected end, measures, bulletin, affected trains |
  16. | `get_train` | One train: delay, position, effective destination, disruption, calls with planned and live times |
  17. | `station_board` | Next departures, or the trains on their way (`view: "arrivals"`) |
  18. | `rail_brief` | Everything at a station or on a route: disruptions, alerts, departures, best journeys |
  19. | `plan_journeys` | A to B on the effective timetable, earliest arrival first; `recommendedJourneyId` = fastest certain option |
  20. | `journey_stops` | Stop-by-stop itinerary of a planned journey, with stops no longer served |
  21. All tools carry `readOnlyHint: true`. Times are `{ ms, hm }` (epoch ms and Swiss local `HH:MM`). `search` and `fetch` follow
  22. the shape ChatGPT deep research and company knowledge expect.
  23. **Safety model.** The server only sends `GET` requests to the two configured origins, on fixed routes; identifiers are
  24. validated as single path segments, redirects are refused, bodies are capped, and nothing writes, calls the paid assistant or
  25. takes a URL from the caller. Host and Origin headers are checked, and requests are rate limited (60/min per client).
  26. ## Run
  27. ```sh
  28. npm ci && npm run build
  29. export TWIN_ORIGIN=https://<twin-host> KTOR_ORIGIN=https://<backend-host> # ask the team for the hosts
  30. node dist/cli.js --stdio # for local clients
  31. PORT=3333 node dist/cli.js --http # Streamable HTTP at http://127.0.0.1:3333/mcp
  32. ```
  33. Docker / Coolify: build the `Dockerfile`, set `TWIN_ORIGIN`, `KTOR_ORIGIN` and `PUBLIC_ORIGIN` (the public https URL of the
  34. app), expose port 3333 behind HTTPS. `GET /healthz` is the health check. See [.env.example](.env.example).
  35. ## Connect a client
  36. - **ChatGPT (web)**: Plugins → **+** → *Add custom MCP server* → `https://<mcp-host>/mcp`, authentication **None**, create it as
  37. a plugin, then `@`-mention it in a new chat. Older workspaces: Settings → Apps → Create. Business/Enterprise may need an admin.
  38. Paste the instructions from [AGENTS.md](AGENTS.md) in the project or GPT.
  39. - **Claude (claude.ai / Desktop)**: Customize → Connectors → *Add custom connector* → `https://<mcp-host>/mcp`, no sign-in.
  40. - **Claude Code**: `claude mcp add --transport http sbb-twin https://<mcp-host>/mcp`, or locally
  41. `claude mcp add --transport stdio sbb-twin -- node /path/dist/cli.js --stdio` (with `TWIN_ORIGIN` set). Copy
  42. `skills/read-sbb-twin` into `.claude/skills/` for the skill.
  43. - **Codex**: `codex mcp add sbb-twin --url https://<mcp-host>/mcp`.
  44. Try: *"Check the twin's feed age, then give me the next departures from Bern"* and *"What is the fastest way from Bern to
  45. Zürich HB, where do I change, and does it depend on a reopening?"*.
  46. ## Tests
  47. ```sh
  48. npm test # unit tests, mocked upstream
  49. npm run smoke -- --http http://127.0.0.1:3333/mcp # every tool over HTTP against the configured twin (GET only)
  50. npm run smoke -- --stdio # the same over stdio
  51. ```
  52. Verified on 22 Nov 2026 against the deployed twin: 6/6 unit tests, 25/25 HTTP and 24/24 stdio smoke checks, and a real
  53. Codex CLI agent answering with five MCP calls (`twin_status`, `search` ×2, `station_board`, `plan_journeys`).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.