Carris Metropolitana

io.github.ThiagoJacobLannes由 GitHub 帳號 ThiagoJacobLannes 發布v0.1.1更新於 Nov 3, 2026

大里斯本公交車:站點、即時到站資訊、線路、提醒和即時車輛。

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

原文描述

Greater Lisbon buses: stops, real-time arrivals, lines, alerts and live vehicles.

已驗證STDIO僅桌面位置與生活資料與分析

概覽

Carris Metropolitana 的本機 MCP 服務;無需登入;STDIO。

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

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

carris-metropolitana-mcp

[!WARNING] Deprecated — use portugal-mcp instead. This server now lives on as the transportes feature of portugal-mcp, together with IPMA weather, INE, Banco de Portugal, Parliament, public contracts and more. Install with uvx portugal-mcp (add PORTUGAL_MCP_FEATURES=transportes to load only this part). Tool names: find_stops, next_arrivals, line_info, service_alerts, vehicle_positions → bus_find_stops, bus_next_arrivals, bus_line_info, bus_service_alerts, bus_vehicle_positions. This repository gets no further updates.

MCP server for Carris Metropolitana, the bus network of Greater Lisbon (Lisbon Metropolitan Area), so Claude (or any MCP client) can answer "when is the next bus at X?", "where does line 4715 go?" or "is my line disrupted?" in real time.

Read-only, no key, no account. It only reads the official open API. Not affiliated with Carris Metropolitana or TML (Transportes Metropolitanos de Lisboa).

Note: buses inside the city of Lisbon are mostly run by Carris, a different company that this server does not cover. Carris Metropolitana serves the surrounding municipalities and the routes into Lisbon (e.g. from Oriente, Cacilhas, Setúbal).

Tools

find_stops

Find stops by name and/or near a coordinate. Use it first to get a stop_id.

Parameters:

  • query — text in the stop name, accent/case-insensitive (e.g. "Gare do Oriente", "cacilhas terminal"); a 6-digit stop id also works
  • lat / lon — a coordinate; results are sorted by straight-line distance
  • radius_m — only stops within this radius (default 500 m when no query is given)
  • limit — max stops (default 10, max 50)

Each stop has: id, name, locality, municipality, distance, coordinates, the lines serving it, and wheelchair boarding.

next_arrivals

Upcoming buses at a stop, with minutes from now. Each arrival is marked "realtime" (live GPS estimate, with delay vs. timetable) or "scheduled" (timetable only).

Parameters:

  • stop_id — 6-digit stop id (e.g. "060361")
  • line_id — optional, keep only one line (e.g. "2794")
  • limit — max arrivals (default 10, max 50)

line_info

A line's name, municipalities and localities served, and each direction (headsign, first and last stop, number of stops, trips today, first/last departure today). Pass a line number ("4715") or text ("Oriente Setubal"), in which case matching lines are listed. include_stops=True adds the ordered stop list for each direction.

service_alerts

Active (and, by default, upcoming) service alerts: detours, works, strikes, stops not served. Filter by line_id and/or stop_id. Alerts are mostly published in Portuguese.

vehicle_positions

Live positions of the buses currently running on a line: coordinates, heading, speed, headsign, the stop it is at or heading to, and how old the GPS fix is.

All times are Europe/Lisbon. On failure a tool returns {"error": "..."} instead of raising.

Install

Quickest (needs uv): no clone needed, it runs straight from PyPI.

bash
claude mcp add carris-metropolitana -- uvx carris-metropolitana-mcp

For Claude Desktop, use "command": "uvx", "args": ["carris-metropolitana-mcp"].

From source:

Requires Python 3.10+.

bash
git clone https://github.com/ThiagoJacobLannes/carris-metropolitana-mcpcd carris-metropolitana-mcppython -m pip install -e .

On Windows, if you keep code in a cloud-synced folder (Google Drive, OneDrive), create the virtual environment outside it: sync clients drop desktop.ini files into folders, which can crash packages on startup.

Add to Claude Code

bash
claude mcp add carris-metropolitana -- python -m carris_metropolitana_mcp.server

Add to Claude Desktop

Merge claude_desktop_config.snippet.json into your Claude Desktop claude_desktop_config.json, then restart Claude Desktop:

json
{  "mcpServers": {    "carris-metropolitana": {      "command": "python",      "args": ["-m", "carris_metropolitana_mcp.server"]    }  }}

Data source

All data comes from the official Carris Metropolitana open API, https://api.carrismetropolitana.pt/v2 (docs, source). It is public, needs no key, and is the same API the operator's own website and apps use. Carris Metropolitana publishes it as open data; its documentation does not state a specific data licence, so check their terms before redistributing the data itself.

The large, slow-changing lists (all ~12,000 stops, ~700 lines, localities, municipalities) are downloaded once and cached in memory for 12 hours; alerts and vehicle positions are cached for 30 seconds. Set CARRIS_METROPOLITANA_BASE_URL to point at a different API base URL.

Real-time estimates only exist for buses that are already running with live tracking; other arrivals are the published timetable. Arrivals cover the current service day only, so late at night the list can be short.

This project is not affiliated with, endorsed by, or connected to Carris Metropolitana or TML.

License

MIT

來源:README.md,提交 17f0ddc

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.1.1最新Nov 3, 2026
  2. v0.1.0Nov 1, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分