SL – Stockholm public transport
Stockholm public transport (SL): live departures, trips to addresses with exits, disruptions.
ماذا يمكنك أن تفعل مع SL – Stockholm public transport؟
find_stop: search for a stop by name, typos are fine, and get its idget_departures: live departures from a stop with platform or bus stop letter, delays and cancellations.get_disruptions: announced disruptions such as track work, broken lifts and replacement buses, by line,plan_trip: up to 3 trips between stops or street addresses, leaving or arriving at a given time. Each ride
التثبيت
أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: .cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).
claude mcp add --transport http sl-stockholm-public-transport 'https://sl-mcp.miltonlindblad.workers.dev/mcp'
{
"mcpServers": {
"sl-stockholm-public-transport": {
"type": "http",
"url": "https://sl-mcp.miltonlindblad.workers.dev/mcp"
}
}
}
التوثيق
مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.
sl-mcp
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.
- 08:31 Tunnelbana 10 mot Kungsträdgården från spår 2. Åk 7 stationer till T-Centralen.
- 08:47 Byt till tunnelbana 17 mot Skarpnäck från spår 4. Åk 3 stationer till Medborgarplatsen.
- 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 idget_departures: live departures from a stop with platform or bus stop letter, delays and cancellations. Filter by mode, line or destinationget_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 timedepartures: the next departures from a stop
Install
Requires Node.js 20 or later.
git clone https://github.com/Hashtagsmile/sl-mcp.git
cd sl-mcp
npm install
npm 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:
{
"mcpServers": {
"sl": {
"command": "node",
"args": ["/path/to/sl-mcp/dist/index.js"]
}
}
}
Development
npm run dev # compile on save
npm test # run the tests
npm 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/mcp
npx 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_tripwith a time.
Data
Data from SL via Trafiklab.
License
MIT
الأسئلة الشائعة
ما هو SL – Stockholm public transport؟
Stockholm public transport (SL): live departures, trips to addresses with exits, disruptions.
كيف أثبّت SL – Stockholm public transport؟
يعمل كخادم بعيد. في Claude Code: claude mcp add --transport http sl-stockholm-public-transport 'https://sl-mcp.miltonlindblad.workers.dev/mcp'. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.
هل يحتاج SL – Stockholm public transport إلى مفتاح API؟
لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.
هل SL – Stockholm public transport مفتوح المصدر؟
نعم. شيفرته متاحة على GitHub بترخيص MIT.
من يصون SL – Stockholm public transport؟
ينشره Hashtagsmile. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.
من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.