
Node-RED
STDIO连接语言模型与Node-RED的MCP服务器
连接语言模型与Node-RED的MCP服务器
Model Context Protocol (MCP) server for Node-RED — allows language models (like Claude, GPT) to interact with Node-RED through a standardized API.
node-red-mcp-server
creates a bridge between language models and the Node-RED platform, providing tools to manage flows, nodes, and settings via the MCP (Model Context Protocol). This enables language models to automate and control Node-RED flows programmatically.
npm install -g node-red-mcp-server
npm install node-red-mcp-server
node-red-mcp-server --url http://localhost:1880 --token YOUR_TOKEN
.env
Create a .env
file:
NODE_RED_URL=http://localhost:1880
NODE_RED_TOKEN=YOUR_TOKEN
Then run:
node-red-mcp-server
Start the MCP server or configure Claude Desktop to start it automatically with the tool configuration below.
Configure Claude Desktop:
{ "node-red": { "command": "node", "args": [ "/path/to/node-red-mcp-server/bin/node-red-mcp-server.mjs", "--verbose" ], "env": { "NODE_RED_URL": "http://your-node-red-url:1880", "NODE_RED_TOKEN": "your-token-if-needed", "MCP_SERVER_PORT": "3000" } } }
/path/to/node-red-mcp-server
with the actual path to your installationNODE_RED_URL
to point to your Node-RED instanceNODE_RED_TOKEN
if your Node-RED instance requires authenticationAfter configuration, Claude can interact with your Node-RED instance through the MCP tools.
For more information about the Model Context Protocol, visit the official MCP documentation.
import { createServer } from 'node-red-mcp-server'; const server = createServer({ nodeRedUrl: 'http://localhost:1880', nodeRedToken: 'YOUR_TOKEN', verbose: true }); await server.start();
Parameter | Short | Description |
---|---|---|
--url | -u | Node-RED base URL |
--token | -t | API access token |
--verbose | -v | Enable verbose logging |
--help | -h | Show help |
--version | -V | Show version number |
Variable | Description |
---|---|
NODE_RED_URL | URL of your Node-RED instance |
NODE_RED_TOKEN | API access token |
get-flows
— Get all flowsupdate-flows
— Update all flowsget-flow
— Get a specific flow by IDupdate-flow
— Update a specific flow by IDlist-tabs
— List all tabs (workspaces)create-flow
— Create a new flow tabdelete-flow
— Delete a flow tabget-flows-state
— Get deployment stateset-flows-state
— Change deployment stateget-flows-formatted
— Get human-readable flow listvisualize-flows
— Generate graph-like view of flowsinject
— Trigger an inject nodeget-nodes
— List available node typesget-node-info
— Detailed info about a node moduletoggle-node-module
— Enable/disable a node modulefind-nodes-by-type
— Locate nodes by typesearch-nodes
— Find nodes by name or propertyget-settings
— Get Node-RED runtime settingsget-diagnostics
— Fetch diagnostics infoapi-help
— Show Node-RED API helpMIT License
Copyright (c) 2023
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.