Skip to content

Flows MCP server ​

The Flows MCP is the MCP server of a Rosepetal controller. With it an assistant such as Claude works on the controller's Node-RED: it reads the flows and the node types, creates, changes, moves and deletes nodes and tabs, follows messages through the flows, reads node statuses, debug output and the runtime log, commits and switches branches in the project's git repository, looks at the editor canvas and tests dashboards in a headless browser, and reads the NATS traffic and the resource history of the controller. MCP is the protocol AI assistants use to call external tools.

It is a different server from the Platform MCP, which works on the datasets, images and models of a Rosepetal project. The Flows MCP works on one controller and its Node-RED.

This manual describes version 1.5.0 of the server. get-MCP-node-red and get-controller-info report the version a controller runs.

WARNING

Every tool that changes flows deploys to the running Node-RED at once: there is no separate deploy step, and the only undo is the project's git history. inject, send-to-node, browser-open and browser-interact act on the running flows too: whatever the flows do with a message (database writes, device commands, NATS publishes) happens for real.

Where it runs ​

The server is a module of the controller: a container that runs on the controller itself, next to Node-RED, on the controller's network. It works through Node-RED's admin API and editor connection, and, for the NATS and metrics tools, through pilot, the controller module that records the NATS traffic and the resource usage of the machine.

One server serves one controller. To work on several controllers, connect the client to the server of each one.

Each client connection is a session. A session keeps its own debug capture and its own browser page; everything else is shared with the other sessions and with the people using the editor.

Requirements ​

  • The address at which your client reaches the controller, and the MCP token of the controller. Ask the administrator of your Rosepetal installation.
  • An MCP client that supports the Streamable HTTP transport with a custom header, such as Claude Code.
  • On the controller, some tools depend on what is installed and configured:
NeedsTools
A Node-RED project active in the editorgit-commit, git-checkout, git-log, git-branches, git-flow-diff
The Git Control plugin in Node-RED, and an active projectgit-status, git-stage, git-unstage, git-fetch, git-pull, git-push, git-reset, git-discard, git-validate-checkout, git-merge
The Message Control plugin in Node-REDget-node-messages, get-messages, trace-message, message-control-settings. Message history needs version 1.2.0 or later
Message Control 1.3.0 or latersend-to-node, search-module-files, read-module-file. get-runtime-logs, search-runtime-logs and get-log-info read its log buffer; without it they can only read a host log next to the server, if there is one
send-to-node enabled on the controllersend-to-node. It is off by default: see Debugging tools
pilot on the controller, and the module configured to use it (it is by default)nats-overview, nats-query, nats-stats, nats-watch. metrics-overview, metrics-query and metrics-stats also need pilot 1.3.0 or later
The headless browser enabled on the controller (it is by default)capture-flow, browser-open, browser-snapshot, browser-interact, browser-screenshot, browser-wait, browser-status
runtimeState.enabled in Node-RED's settings.jsget-flows-state

Connecting a client ​

Endpoint ​

The server listens on port 3003 of the controller, at the path /mcp:

http://<controller>:3003/mcp

<controller> is the address of the controller as your client reaches it. When your installation reaches controllers through another address, use the address it gives you, with the path /mcp.

PropertyValue
TransportStreamable HTTP
MethodsPOST for requests. GET opens the event stream of a session and DELETE ends it; both need the session header
SessionsYes. The answer to initialize carries an mcp-session-id header, and the client sends it on every later request. A request without it that is not an initialize is answered with 400. An unknown session id (a closed session, or one lost when the module restarted) is answered with 404 and the JSON-RPC error -32001: the client has to start a new session
Request sizeUp to 10 MB of JSON
Server name and versionrosepetal-mcp-server, 1.5.0
CapabilitiesTools, resources (the topics of the guide, as guide://<topic>) and session instructions. The tool list changes when the active project of Node-RED changes; the client is notified

Sessions live in the memory of the server. After the module restarts, calls fail with the session error until the client reconnects.

Token ​

Every request to /mcp carries the MCP token of the controller:

http
Authorization: Bearer <MCP token>

A missing or wrong token is answered with 401 and the JSON-RPC error -32000 Unauthorized. The token is part of the configuration of the module on the controller; ask the administrator of the controller for it.

WARNING

The token gives the access of a Node-RED administrator: whoever holds it can change and deploy the flows, use the project's git repository and read context, messages, logs and NATS traffic. Keep it out of shared files and repositories, and have it replaced if it leaks.

Client configuration ​

With Claude Code:

bash
claude mcp add --transport http nodered-line-1 \
  http://<controller>:3003/mcp \
  --header "Authorization: Bearer <MCP token>"

Or in the .mcp.json of a project, with the token read from an environment variable so that it is not written in the file:

json
{
  "mcpServers": {
    "nodered-line-1": {
      "type": "http",
      "url": "http://<controller>:3003/mcp",
      "headers": { "Authorization": "Bearer ${NODERED_MCP_TOKEN}" }
    }
  }
}

With several controllers, add one server per controller, each with a name that tells them apart. The session instructions ask the assistant to call get-controller-info first and, when several controllers are connected, to ask which one to work on.

Checking the connection ​

GET /healthz answers without a token and shows that the server runs:

bash
curl http://<controller>:3003/healthz
json
{ "status": "ok", "sessions": 1, "browser": { "enabled": true, "state": "idle" } }

sessions is the number of open MCP sessions. browser.state is idle, launching, running, closing or error.

From the client, ask the assistant to call get-controller-info: it answers with the controller, its Node-RED version and active project, the addresses of the editor and the dashboards, and the version of the server.

Session instructions ​

On connect the server sends the client a short set of working rules (know which controller you are on, read before editing, commit each verified step, verify every change, warn before anything with effects outside the flow, keep the flows in English and free of credentials, investigate failures before guessing), followed by one line about the controller: its host, its Node-RED version and active project, a warning when Node-RED did not answer, and a note when the server runs on another machine. Some clients do not show these instructions; get-MCP-node-red with instructions: true returns them.

The rest of the working guide is served by the guide tool and as guide://<topic> resources: start, editing, conventions, git, testing, troubleshooting, standard-tabs, rosepetal-nodes and tools.

How tools answer ​

  • Results come back as text. Many tools return JSON as text; others return formatted text: listings, diffs, log lines, message sequences. capture-flow, browser-open, browser-screenshot and browser-interact also return an image.
  • Errors come back as a tool result with the reason as text, such as Node abc123 not found, so the assistant can read it and correct the call. Some tools flag errors with isError; many return them as the plain text of a normal result, so the text is what to read.
  • Writes deploy at once. The tools that change nodes and tabs deploy the flows as a partial deploy (nodes): only the nodes that changed restart, and nodes that only move or are rewired do not restart. The flows file is written with the deploy. delete-flow uses Node-RED's own deletion of a tab instead, and reload-flows and the git tools that change the flows file reload all the flows.
  • Checks before deploying. In the partial deploys, properties are compared with the definition of the node type: properties the type does not define, and credentials passed as plain properties, come back as warnings, or are refused with strict: true. A node type that is not installed is refused, because it would stop every flow. A wire to a node on another tab, or to an id that does not exist, is refused: across tabs, use a link out and link in pair.
  • Deploy check. After a partial deploy, the answer reports the new revision, the nodes that restarted, the errors they logged, their red statuses, and errors of other nodes in the same moments. After delete-flow and the full reloads, it reports the revision and the errors logged. If the flows stopped (a missing node type, for example), the call is an error. JSON answers carry this report in a deploy field and text answers append it. The controller can switch the check off; the answer then says not verified.
  • Concurrent deploys. If someone deploys between the moment a tool reads the flows and the moment it makes a partial deploy, the change is applied again on top of theirs, up to three times: a deploy made by someone else is never overwritten.
  • Deploys made by others. When someone deployed outside the session since its previous answer (from the editor, or another assistant), the next answer starts with a notice that summarizes what changed, so the assistant re-reads what it is about to edit.
  • Dry runs. With dryRun: true, a write tool reports what it would do and deploys nothing. update-flow, create-flow, create-node, batch-create-nodes, update-node-config, batch-update-nodes and delete-node return a diff of the flows, the nodes that would restart and the result of the checks. delete-flow returns the diff and the nodes of other tabs that still refer to the tab. move-nodes returns its plan and the result of the checks. update-tab, delete-nodes and restart-nodes return the report they would give after deploying, without the checks.
  • Credentials. Values stored as credentials are never returned; get-node-config says which credential fields are set and which are missing. A secret written as a plain property is part of the flows file, and the tools that return whole nodes (get-flows, get-flow, search-nodes) show it.
  • Context is read-only. The context tools read global, flow and node context; no tool writes or deletes it.
  • Times. The log, NATS and metrics tools accept and print times in the controller's local time zone, with milliseconds.

Which tools a controller has ​

The server has 78 tools. Which of them a controller registers depends on its setup:

  • The project git tools (git-commit, git-checkout, git-log, git-branches, git-flow-diff) exist only while a Node-RED project is active. When the active project changes, the tools are replaced and the client is notified. git-project-status is always there and says why the project tools are missing.
  • The browser tools are absent when the browser is disabled, or not set up correctly, on the controller.
  • The NATS and metrics tools are absent when the module is configured without pilot. Where pilot is configured but does not answer, they are there and say so.
  • The other tools are always registered. Those that need a plugin answer which plugin or version is missing.

A client sees new tools only after it refreshes its tool list. After an update of the server, reconnect the client.

Tools ​

PageReadChange or act
Flow toolsget-flows, get-flow, get-flows-state, lint-flowsupdate-flow, create-tab, create-flow, update-tab, delete-flow, reload-flows
Node toolsget-nodes, get-node-schema, get-node-help, search-nodes, get-node-configcreate-node, batch-create-nodes, update-node-config, batch-update-nodes, move-nodes, delete-node, delete-nodes, restart-nodes, inject
Debugging toolsget-node-status, get-debug-messages, clear-debug-messages, get-debug-connection-info, get-node-messages, get-messages, trace-message, get-runtime-logs, search-runtime-logs, get-log-infomessage-control-settings, send-to-node
Git toolsgit-project-status, git-status, git-log, git-branches, git-flow-diff, git-validate-checkoutgit-stage, git-unstage, git-commit, git-checkout, git-fetch, git-pull, git-push, git-merge, git-reset, git-discard
Browser toolscapture-flow, browser-snapshot, browser-screenshot, browser-wait, browser-statusbrowser-open, browser-interact
NATS and metrics toolsnats-overview, nats-stats, nats-query, nats-watch, metrics-overview, metrics-stats, metrics-query
Controller and runtime toolsguide, get-MCP-node-red, get-controller-info, get-controller-resources, get-settings, get-diagnostics, get-context, list-context-keys, get-context-stores, get-module-info, search-module-files, read-module-file

clear-debug-messages empties the session's own capture buffer and changes nothing in Node-RED. message-control-settings without parameters only reads.