Debugging tools of the Flows MCP server
The 12 tools that show what the running flows do: the status of each node, the debug output, the last messages each node received and sent, and the runtime log. How to connect, and how results and errors come back, is in Flows MCP server.
A good order when something does not work: get-node-status (a red status usually names the problem), the deploy check of the last change, get-node-messages along the path to see where a message stops, get-debug-messages, and then the runtime log.
Node statuses
get-node-status
The last status of nodes, as text: the colored dot or ring and the label each node shows under it in the editor (a red ring Missing config, a green dot connected). Problems are listed first: red, yellow, then blue, green and grey; within a color, by tab and position. Read-only.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
tabId | string | no | Only nodes of this tab or subflow |
type | string | no | Only nodes of this type, for example mqtt in |
ids | array of strings | no | Only these nodes |
color | red, yellow, green, blue or grey | no | Only statuses of this color |
text | string | no | Only statuses whose text contains this, in any letter case |
includeEmpty | boolean | no | Also list the nodes in scope that show no status. Default false |
limit | integer, 1 to 1000 | no | Default 100 |
offset | integer, from 0 | no | Skip this many matching nodes |
Each line has the node id, type and name, the status and since when it is shown, and marks disabled nodes. For a status that was already set when the server connected to the runtime, the exact time is unknown and the line says set before that moment. Statuses come from the live status stream of the runtime: a node that never set a status has none. When a filter leaves nothing, the answer says how many nodes show a status and of which colors.
Debug messages
The server captures the messages of debug nodes, and the runtime warnings and errors the debug sidebar shows, over its connection to the editor. The capture belongs to the session and starts with its first get-debug-messages or clear-debug-messages call: only messages that arrive after that call are captured. Call get-debug-messages once before testing. The buffer keeps at least the last 1000 messages.
Every answer starts with the state of the capture: whether the connection is up and the periods without connection since the capture started, during which messages were missed. The connection comes back by itself.
get-debug-messages
The captured debug messages, oldest first. Each one has timestamp, nodeId, nodeName, msgTopic, payload and the raw message of the debug sidebar.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
limit | number | no | The most recent this many. Default 50 |
nodeId | string | no | Only messages of this debug node |
since | string | no | ISO timestamp: only messages after it |
clear-debug-messages
Empties the session's buffer, and starts the capture if it was not running. Takes no parameters. Nothing changes in Node-RED.
get-debug-connection-info
The state of the connection used for the capture (connected or not, since when, reconnections, last error, next attempt), this session's buffer (messages kept and dropped), and the periods without capture. Takes no parameters. It does not start the capture. Use it when debug messages seem to be missing.
Recorded messages
These tools read what the Message Control plugin records in Node-RED: the last message each node received and sent, sampled, and from version 1.2.0 a short history and the messages sent to outputs without wires. Answers warn when the plugin is too old, when recording is paused, and when newer messages were not sampled. Without the plugin, get-node-messages answers with a warning, and the other three tools with an error.
get-node-messages
The last input and output messages recorded for one or several nodes, with their times. Read-only.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeId | string, or array of strings | yes | One node id, or several |
includePayloadOnly | boolean | no | Return only payload instead of the whole message. Default false |
history | integer, 0 to 100 | no | Also return up to this many recent messages per direction, newest first. Default 0: only the last ones. Needs Message Control 1.2.0 or later |
Each history entry has its time, its sequence number and, for outputs, the output port and whether it had wires. With an array of ids the answer is { nodes, total }. A node with nothing recorded gets an error and a hint: it has not received or sent a message since recording started, or since a deploy recreated it, or the id is wrong.
get-messages
Lists the nodes Message Control knows, with their last messages and times. Use it to find which nodes have seen traffic. Read-only.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
flowId | string | no | Only nodes of this tab |
nodeType | string | no | Only nodes of this type |
nodeName | string | no | Text contained in the node name, in any letter case |
hasInput | boolean | no | true: only nodes with a recorded input; false: only nodes without |
hasOutput | boolean | no | true: only nodes with a recorded output; false: only nodes without |
Returns messages, totalNodes, filtered and the filters applied.
trace-message
Follows the path of a message through the wires from one node, with the messages recorded on each node, as Markdown. Read-only.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeId | string | yes | Node to start from |
direction | downstream, upstream or both | no | Default downstream |
depth | integer, 1 to 10 | no | Maximum number of hops. Default 5 |
traceSameMessage | boolean | no | Follow only nodes that processed the same message (same _msgid) as the start node. Default true |
detail | summary, standard or detailed | no | summary: the tree of the path only; standard (default): with a registry of the messages; detailed: the full message data |
message-control-settings
Reads or changes how Message Control records messages. Without parameters it only reads: the current settings and whether recording is on.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
enabled | boolean | no | false pauses recording and clears the stored messages; true starts it again |
captureInterval | number, 0 to 3600000 | no | Minimum milliseconds between two snapshots of the same node and direction. 0: every message |
captureBudget | number, 0 to 1000 | no | Milliseconds of snapshot CPU allowed per second, across all nodes. 0: unlimited |
historySize | integer, 0 to 100 | no | Messages kept per node and direction. 0: only the last one |
historyMaxBytes | integer, 0 to 1073741824 | no | Memory budget of the whole history, in bytes; the oldest messages go first |
captureUnwired | boolean | no | Also record messages sent to outputs without wires |
historySize, historyMaxBytes and captureUnwired need Message Control 1.2.0 or later; an older version ignores them and the answer says so. A change applies at once, without a deploy, and lasts until Node-RED restarts: then the values of settings.js apply again.
send-to-node
Delivers a message to the input of a running node, exactly as if it arrived on a wire, without a temporary inject node and without a deploy. Use it to test a node or a branch of a flow with a chosen message.
WARNING
The node processes the message for real: whatever it and every node after it do (writing files or databases, HTTP calls, PLC or device commands, NATS or MQTT publishes, dashboard updates) happens on the controller. Send only what you would be willing to send in production.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
nodeId | string | yes | Node that receives the message |
msg | object | no | The message, for example {"payload": 42, "topic": "test"}. Default {}. _msgid is generated |
observeMs | integer, 0 to 10000 | no | How long to watch what the node does next. Default 1000; 0 does not wait |
The answer gives the id of the message sent and, within observeMs, the messages the node sent (up to three, with their output port, and whether that output has wires) and the warnings and errors it logged.
send-to-node needs Message Control 1.3.0 or later, and it is off by default: on a controller that has not enabled it, the tool sends nothing and answers that it is disabled. It is enabled per controller, by its administrator, with the setting SEND_TO_NODE=true of the MCP server module, followed by a restart of the module. Message Control can also turn the delivery off on the Node-RED side (sendToNode: false in its section of settings.js); the tool then says so.
Runtime log
The log tools read the Node-RED runtime log from the log buffer of Message Control 1.3.0 or later, with every filter. Node construction errors reach only the log: look there when a node does not start.
Times accept RFC 3339, epoch milliseconds, a relative time such as -15m or -2h, or a local time such as 10:30, read in the controller's time zone.
Without the log buffer, the tools read the log of the host when the server runs next to Node-RED and can read it (the systemd journal or a log file), with fewer features: the lines come as the host writes them, level, nodeId and type are ignored, and the times are handed to the journal as given (a log file ignores them). Otherwise they answer that no log is readable and how to get one. The rest of this section describes the log buffer.
get-runtime-logs
The last lines of the runtime log, newest last. Each line has the local time, the level, the node that logged it (type, name and id) when there is one, and the text.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
lines | number | no | How many of the newest lines. Default 50; the log buffer returns at most 1000 |
since | string | no | Only lines from this time |
until | string | no | Only lines until this time |
level | fatal, error, warn, info, debug or trace | no | The most verbose level returned: warn returns warnings and more severe lines |
text | string | no | Only lines that contain this text, in any letter case; it also matches the node name and type |
nodeId | string | no | Only lines logged by this node |
type | string | no | Only lines logged by nodes of this type |
Returns method (where the log came from), source (the size of the buffer, the level it keeps and its oldest line), totalLines, matched and logs. A note says when older matching lines were left out.
search-runtime-logs
Searches the runtime log with a regular expression, applied by the server. Returns the number of matches and the matching lines, newest last, in the format of get-runtime-logs.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
query | string, up to 300 characters | yes | Regular expression |
lines | number | no | Maximum matching lines returned. Default 100 |
caseSensitive | boolean | no | Default false |
level | log level | no | The most verbose level searched |
nodeId | string | no | Only lines logged by this node |
type | string | no | Only lines logged by nodes of this type |
since | string | no | Only lines from this time |
From the log buffer, the search covers the newest 1000 lines that pass the other filters. On a host log the expression is a grep pattern: on the journal lines limits the lines searched, and level, nodeId, type and since are ignored.
get-log-info
Where the runtime log comes from: the log buffer of Message Control (its size, the level it keeps, its oldest line) and the host log found next to the server, with what to do when none is readable. Takes no parameters.