FM

fx/mcp-node-red

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

4 stars 6 forks 质量 69 趋势 12MIT

MCP server for Node-RED workflow management. Provides AI assistants with 17 tools to manage flows, node modules, context stores, and runtime settings through the Node-RED Admin API v2.

概览

MCP server for Node-RED workflow management. Provides AI assistants with 17 tools to manage flows, node modules, context stores, and runtime settings through the Node-RED Admin API v2. Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or ~/.config/claude/claude_desktop_config.json (Linux): Restart Claude Desktop to load the server. - NODE_RED_URL (required): Your Node-RED instance URL - NODE_RED_TOKEN (optional): API token for authentication The server loads environment variables from .env and .env.local files in the working directory: - .env -- Base defaults (tracked in version control if desired) - .env.local -- Local overrides (gitignored, never committed) Precedence (highest to lowest): 1. Real environment variables (e.g., set via shell or MCP config) 2. .env.local 3. .env Copy .env.example as a starting template:

README

以下为原文 README 节选,完整内容请查看原文。

Node-RED MCP Server

MCP server for Node-RED workflow management. Provides AI assistants with 17 tools to manage flows, node modules, context stores, and runtime settings through the Node-RED Admin API v2.

Installation

Configuration

Environment Variables

  • NODE_RED_URL (required): Your Node-RED instance URL
  • NODE_RED_TOKEN (optional): API token for authentication

Environment Files

The server loads environment variables from .env and .env.local files in the working directory:

  • .env – Base defaults (tracked in version control if desired)
  • .env.local – Local overrides (gitignored, never committed)

Precedence (highest to lowest):

  1. Real environment variables (e.g., set via shell or MCP config)
  2. .env.local
  3. .env

Copy .env.example as a starting template:

cp .env.example .env

Node-RED Setup

Standalone Node-RED

  1. Enable Admin API in Node-RED settings.js:
adminAuth: {
  type: "credentials",
  users: [{
    username: "admin",
    password: "$2a$08$...",  // bcrypt hash
    permissions: "*"
  }]
}
  1. Generate API token:
curl -X POST http://localhost:1880/auth/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"node-red-admin","grant_type":"password","scope":"*","username":"admin","password":"your-password"}'

Home Assistant Add-on

The Home Assistant Node-RED add-on uses Basic Auth with your Home Assistant credentials:

# Test connection
curl http://USERNAME:[email protected]:1880/flows

Configuration:

{
  "mcpServers": {
    "node-red": {
      "command": "npx",
      "args": ["mcp-node-red"],
      "env": {
        "NODE_RED_URL": "http://admin:[email protected]:1880"
      }
    }
  }
}

Note: No NODE_RED_TOKEN needed - credentials are in the URL.

Features

Flow Management

  • get_flows: Retrieve all flows from your Node-RED instance
  • create_flow: Create new flows via POST /flow
  • update_flow: Update individual flows safely via PUT /flow/:id
在 GitHub 查看完整 README

安装

npx mcp-node-red
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "node-red": { "command": "npx", "args": ["mcp-node-red"], "env": { "NODE_RED_URL": "http://localhost:1880", "NODE_RED_TOKEN": "your-api-token" } } } }