SL – Stockholm public transport

io.github.Hashtagsmile由 GitHub 帳號 Hashtagsmile 發布v0.2.0更新於 Nov 4, 2026

斯德哥爾摩公共交通(SL):即時發車資訊、前往地址的行程及出口指引、營運中斷資訊。

AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。

原文描述

Stockholm public transport (SL): live departures, trips to addresses with exits, disruptions.

已驗證Streamable HTTP可網頁執行

概覽

SL – Stockholm public transport 的託管 MCP 服務(sl-mcp.miltonlindblad.workers.dev);無需登入;Streamable HTTP;4 個工具。

暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。

端點
sl-mcp.miltonlindblad.workers.dev
最近檢查

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 SL – Stockholm public transport,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.Hashtagsmile%2Fsl-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "sl-stockholm-public-transport": {
      "type": "http",
      "url": "https://sl-mcp.miltonlindblad.workers.dev/mcp"
    }
  }
}

README

sl-mcp

[CI] [Release] [License: MIT] [sl-mcp MCP server score]

An MCP server for Stockholm public transport (SL). Connect it to Claude or another MCP client and ask about departures, disruptions and trips in plain Swedish or English.

När går nästa tunnelbana från Slussen mot Ropsten?Är det några störningar på röda linjen?How do I get from Odenplan to Arlanda?Hur tar jag mig från Sundbyberg till Götgatan 76?

It uses SL's open APIs, which don't need an API key.

An answer looks like this:

Gå 08:31 från Sundbybergs centrum, så är du framme på Götgatan 76 kl 08:58.

  1. 08:31 Tunnelbana 10 mot Kungsträdgården från spår 2. Åk 7 stationer till T-Centralen.
  2. 08:47 Byt till tunnelbana 17 mot Skarpnäck från spår 4. Åk 3 stationer till Medborgarplatsen.
  3. 08:52–08:58 Gå ut via uppgång Folkungagatan Götgatan och gå 6 min till Götgatan 76.

Use it without installing

A hosted server runs on Cloudflare Workers. No API key or login is needed:

https://sl-mcp.miltonlindblad.workers.dev/mcp

Add it as a custom connector in claude.ai or ChatGPT, or in any MCP client that supports Streamable HTTP. In Claude Code:

claude mcp add --transport http sl https://sl-mcp.miltonlindblad.workers.dev/mcp

Tools

  • find_stop: search for a stop by name, typos are fine, and get its id
  • get_departures: live departures from a stop with platform or bus stop letter, delays and cancellations. Filter by mode, line or destination
  • get_disruptions: announced disruptions such as track work, broken lifts and replacement buses, by line, mode or metro colour ("grön linje")
  • plan_trip: up to 3 trips between stops or street addresses, leaving or arriving at a given time. Each ride shows platform, stops, crowding and delay, and each walk shows minutes and which station exit to use. You can ask for only some modes (e.g. boat) and for fewest changes or least walking

Prompts

Ready-made questions to pick in your client, e.g. as slash commands:

  • trip: how to get from one place to another, optionally arriving by a given time
  • departures: the next departures from a stop

Install

Requires Node.js 20 or later.

git clone https://github.com/Hashtagsmile/sl-mcp.gitcd sl-mcpnpm installnpm run build

Claude Code

claude mcp add sl -- node /path/to/sl-mcp/dist/index.js

Claude Desktop

Add this to claude_desktop_config.json and restart Claude Desktop:

json
{  "mcpServers": {    "sl": {      "command": "node",      "args": ["/path/to/sl-mcp/dist/index.js"]    }  }}

Development

npm run dev       # compile on savenpm test          # run the testsnpm run inspect   # try the tools in the MCP Inspector

The tests use recorded API responses in test/fixtures/, so they don't call SL.

Deploy to Cloudflare Workers

src/worker.ts serves the same tools over HTTP at /mcp.

npx wrangler dev      # run it locally on http://localhost:8787/mcpnpx wrangler deploy   # deploy to your Cloudflare account

Limitations

  • SL returns at most 3 departures per line and direction.
  • Disruption messages are in Swedish only.
  • There is no "nearest stop" search, since SL has no keyless API for it.
  • SL can't plan step-free trips. For a wheelchair, the tools suggest least walking and checking for broken lifts.
  • Addresses work, business names don't: "Götgatan 76" works, "Sellpy" doesn't.
  • Departures reach at most 3 hours ahead. For later, use plan_trip with a time.

Data

Data from SL via Trafiklab.

License

MIT

來源:README.md,提交 9e695dc

工具

4

find_stop

Find stop

Find Stockholm public transport (SL) stops by name and return their ids, names and transport modes. Use it to get the siteId for get_departures, or a stop id for plan_trip. Not for street addresses: pass those to plan_trip as text instead. A name can match several stops ('Arlanda' gives the train station and bus stops): pick by name and modes, or ask the user. Typos are fine, abbreviations are not: write 'Tekniska högskolan', not 'KTH'. Returns one line per stop: '<id>: <town>, <name> (<modes>)'.

輸入參數limitquery必填

get_departures

Get departures

List live departures from one SL stop, soonest first: line, mode, final destination, direction (1 or 2), platform or bus stop letter, minutes or clock time, delay, cancellation and SL's notes. Use it for 'when does the next X leave from Y'. To get from A to B, use plan_trip; for announced track work or broken lifts, use get_disruptions. Real-time data from SL: at most 3 departures per line and direction, up to 3 hours ahead. `towards` matches the final destination only: for a station on the way (e.g. 'mot T-Centralen' from Slussen), leave it out and pick the direction from the results. An unknown siteId gives no departures, not an error.

輸入參數linelimitsiteId必填minutestowardstransportMode

get_disruptions

Get disruptions

List disruptions SL has announced: track work, closed entrances, broken lifts and replacement buses, with the lines affected and until when. Use it to check a line or the stops of a trip before travelling, e.g. lifts for a wheelchair. For live delays and cancelled departures, use get_departures instead. The text is in Swedish, so translate it if needed, and is cut at 800 characters. Results are cached for 1 minute, as SL asks. Leave both filters out to list everything.

輸入參數linestransportMode

plan_trip

Plan trip

Plan trips by SL public transport between two stops or street addresses, leaving or arriving at a given time. Returns up to 3 trips, plus walking all the way when that takes at most 30 min. Each ride lists line, direction, platform, stops, crowding and delay; each walk lists minutes and the station exit (uppgång). Use it for 'how do I get to X' and 'when must I leave'; for departures from one stop, use get_departures. Addresses are fuzzy matched, so the result starts with what each one matched. Times are Stockholm time. Unknown stops, the same stop twice and times outside the timetable give a clear error. SL cannot plan step-free trips: for a wheelchair or pram, use prefer 'least walking' and check get_disruptions for broken lifts at the stops.

輸入參數to必填from必填timemodespreferarriveBy

版本歷史

1
  1. v0.2.0最新Nov 4, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分