
MQTT
io.github.nagarjunr由 GitHub 帳號 nagarjunr 發布v0.1.0更新於 Oct 24, 2026
MCP server for MQTT 5.0 brokers (publish, subscribe, topic discovery).
概覽
本機 MCP 伺服器,讓助理連線 MQTT 5.0 代理,發布訊息、執行訂閱工作階段並探索主題。
- 可以做什麼
- 查看連接器與代理的連線狀態,列出並停止進行中的訂閱工作階段。對指定主題發布訊息,支援 MQTT 5 屬性,並可在 QoS 1/2 下等待代理確認。依支援萬用字元的主題篩選器啟動訂閱並取得工作階段 ID,再分批取出緩衝的訊息,可短暫等待新訊息。透過收集符合篩選器的保留訊息來近似列出主題。
- 適用情境
- 適合需要操作物聯網或訊息代理的情境:向裝置送出指令或測試負載、跨多次工具呼叫持續觀察某個主題的訊息流,或了解哪些主題帶有保留訊息。適用於任何標準 MQTT 5.0 代理,而不依賴特定廠商的管理介面。
- 執行需求
- 以 Python 套件形式透過 uvx 在本機執行(stdio)。需要 MQTT_HOST;選用 MQTT_PORT(預設 1883,TLS 用 8883)、MQTT_USERNAME 與 MQTT_PASSWORD、MQTT_USE_TLS,以及選用的用戶端 ID、keepalive、傳輸方式、TLS 憑證與遺囑訊息設定。需要能連線到該代理的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 MQTT,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
MQTT MCP Server
A Model Context Protocol (MCP) server for MQTT — the standard IoT publish/subscribe messaging protocol. Works against any MQTT broker (Eclipse Mosquitto, EMQX, HiveMQ, AWS IoT Core, Azure IoT Hub's MQTT endpoint, etc): only the standard MQTT 5.0 wire protocol is used, no broker-specific admin APIs.
Built with FastMCP and paho-mqtt.
Tools
Why subscriptions are session-based
MQTT is a continuous publish/subscribe stream, not a request/response API. A single MCP tool call can't "wait forever" for messages, so subscribing works in two steps: start_subscription registers interest and buffers messages in the background (one shared broker connection, dispatched in-process by topic filter), then get_messages drains that buffer on however many tool calls you want, optionally waiting a bounded amount of time for new data. Call stop_subscription when done.
Configuration
Running locally
See mcp.json for ready-to-use client configs (stdio and Docker).
Testing against a real broker
This repo's design principles call for testing against a real instance rather than mocks. docker-compose.yml spins up Eclipse Mosquitto (2.x, MQTT5-capable) with password auth, plus a TLS listener with self-signed certs for testing the TLS/mTLS code paths.
License notes
docker-compose.yml and the files under docker/ configure the open-source Eclipse Mosquitto broker (EPL-2.0) for local testing only — they are not part of the MCP server itself.
來源:mqtt/README.md,提交 eb4532a
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分