
Nr Mcp
io.github.Texan-NXTassist由 GitHub 帳號 Texan-NXTassist 發布v1.2.2更新於 Oct 25, 2026
MCP server for Node-RED — safe deploy, optimistic locking, smart search, 13 tools
概覽
本機 MCP 伺服器,讓 AI 助理讀取、搜尋、編輯並安全部署 Node-RED 流程,觸發 inject 節點並管理已安裝模組。
- 可以做什麼
- 讀取流程概覽、單一頁籤、含上下游連線的節點設定、函式程式碼與流程層級內容變數,並讀取流程內容中的除錯輸出。依名稱、類型或 JavaScript 程式碼內容搜尋節點。批次建立與刪除節點及群組,並自動清理連線與群組。透過完整的 GET 到 POST 流程寫入並依 rev 欄位做樂觀鎖來部署變更,因此保留頁籤順序。遠端觸發 inject 節點以測試流程。列出已安裝模組與可用節點類型,並從 Node-RED 註冊表安裝 npm 套件。
- 適用情境
- 適合管理 Node-RED 安裝(例如家庭自動化、物聯網或能源管理)時使用,讓助理檢查流程、修改函式程式碼、增刪節點、測試流程與安裝模組,而不必手動編輯編輯器。當其他人也可能同時部署時,安全部署與衝突偵測格外重要。
- 執行需求
- 以 Python 套件(nr-mcp)透過 pip 或 uv 在本機執行,需要 Python 3.11+ 以及啟用 Admin API 的 Node-RED 實例。設定 NR_URL(預設 NR_TOKEN 用於 Bearer 驗證,或 NR_USER 與 NR_PASS 用於 Basic Auth;依此順序嘗試驗證。需要能存取 Node-RED Admin API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Nr Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
nr-mcp
A Model Context Protocol (MCP) server that lets AI assistants interact with Node-RED — read flows, search nodes, edit function code, deploy changes safely, and manage modules.
Built to solve real problems: the existing Node-RED MCP implementations use PUT /flow/:id which reorders your tabs. nr-mcp uses the correct GET → POST /flows pattern with optimistic locking, so your tab order is always preserved.
Features
13 tools for complete Node-RED flow management:
Why not just use the existing MCP servers?
- Tab reorder bug: Other implementations use
PUT /flow/:idwhich silently reorders your tabs in Node-RED. nr-mcp uses the correctGET → POST /flowsfull-deploy pattern. - Optimistic locking: Every deploy checks the
revfield. If someone else deployed between your read and write, you get a clear conflict error instead of silent data loss. - Smart search: Search across node names, types, function code, templates, and actions in one call.
- Production-tested: Built and used daily for managing complex Node-RED installations (home automation, IoT, energy management).
Installation
Prerequisites
Install from PyPI
Install with uv (recommended)
Or from source:
This creates the nr-mcp command in ~/.local/bin/.
Configuration
Environment variables
* At least one auth method is recommended. Auth is checked in order: token → basic auth → no auth.
Claude Desktop
Add to your claude_desktop_config.json:
Tip: If you get a "working directory" error, create a wrapper script:
Then point
commandto the wrapper path.
Cursor / VS Code
Add to your MCP settings (.cursor/mcp.json or VS Code equivalent):
Usage examples
Once connected, you can ask your AI assistant things like:
- "Show me all Node-RED tabs and their node counts"
- "Search for nodes that contain 'mqtt' in their code"
- "Show me the function code for node abc123"
- "Update the function code in node xyz to add error handling"
- "Create an inject node and an HTTP request node on the Weather tab"
- "What modules are installed? Is node-red-dashboard available?"
- "Install node-red-contrib-influxdb"
- "Trigger the 'Test' inject node and check for errors"
Architecture
nr-mcp is a Python MCP server that communicates with Node-RED via its Admin API. It uses stdio transport (standard for MCP) and makes HTTP calls to your Node-RED instance.
Key design decisions
- GET→POST pattern: All deploys fetch full flows, modify in-place, then POST back. Never uses
PUT /flow/:idwhich reorders tabs. - Optimistic locking: Uses the Node-RED
revfield to detect concurrent modifications. - No caching: Every tool call fetches fresh data. Slightly slower, but always correct.
- Single retry on conflict: Deploy operations retry once on 409 Conflict.
For more details, see docs/ARCHITECTURE.md.
Node-RED setup
The Admin API must be enabled (it is by default). If you've restricted it, ensure these endpoints are accessible:
GET /flowsandPOST /flows— flow read/writeGET /context/flow/:id— flow contextPOST /inject/:id— inject triggerGET /nodesandPOST /nodes— module management
See Node-RED Admin API docs for auth configuration.
Contributing
Contributions welcome! Please open an issue first to discuss what you'd like to change.
License
MIT — see LICENSE.
來源:README.md,提交 3580418
工具
0版本歷史
1- v1.2.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分