Browser tools of the Flows MCP server
The 7 tools that use a headless browser on the controller to see and try the web pages its Node-RED serves: the editor canvas, the dashboards and the pages of http in nodes. How to connect, and how results and errors come back, is in Flows MCP server.
How the browser works:
- Availability. The tools exist unless the browser is disabled, or not set up correctly, on the controller.
- Reach. The browser only reaches the Node-RED server of the controller; a controller can narrow that to a path, such as
/nodered, or allow other addresses. Anything else is refused before the browser goes there, and every request a page makes is checked the same way. The descriptions of the tools andbrowser-statussay which addresses are reachable. - One page per session. Each session has one page: opening another replaces it. The page is released after a while without browser calls (120 seconds unless the controller sets another time). A limited number of sessions can hold a page at the same time (two unless the controller sets another number); beyond that the tools answer
Browser busy: retry later, or callbrowser-statuswithclose: truein the other session to release its page. - Start. The browser starts on first use; the first capture takes a few seconds.
- Real visits. Opening a page is a real client visit: a dashboard registers a connection and sends its page-view events, and an http in page runs its flow. Interactions are real too: on a dashboard they reach the running flows and every operator connected to it, and in the editor they can deploy, stop flows or install packages. A controller can refuse interactions on the editor page.
- Dashboard addresses. Dashboard pages and http in endpoints are served under the runtime's
httpNodeRoot. The path of a Dashboard 2.0 page ishttpNodeRoot, then the path of itsui-basenode, then the path of itsui-pagenode, for example/nodered/dashboard/page1;get-flowsandget-settingsgive those values.
Flow canvas
capture-flow
An image of a flow tab exactly as the Node-RED editor draws it, without the editor's toolbars and sidebars, plus a text block with:
- the visible area of the canvas and the zoom scale;
- every visible node:
id | type | "name" | center(x,y) | WxH | flags, with its real rendered size; - the pairs of nodes that overlap, from their real boxes;
- the wires drawn over a node they do not connect, sampled along the real wire paths. When there are none, it says so.
Read-only on the runtime: nothing is deployed, no editor settings are saved, and the session is not visible to the people using the editor. This is the reliable layout check: the overlap warnings of the node tools and of lint-flows use estimated sizes.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
flowId | string | yes | Tab or subflow id |
region | { x, y, width, height } | no | Area of the canvas to capture, in canvas units (the x and y of the nodes). Default: the whole tab |
nodeId | string | no | Center the capture on this node and outline it. Instead of region |
radius | number | no | With nodeId: half the size of the square captured around it, in canvas units. Default 300 |
select | array of strings, up to 50 | no | Node ids to outline in the image |
maxDimension | integer, 400 to 2048 | no | Maximum width or height of the image, in pixels. Default 1568 |
format | png or jpeg | no | Default png. A PNG above about 1.5 MB is sent as JPEG |
fresh | boolean | no | Reload the editor before capturing |
The editor page is loaded from the deployed flows and reused between captures while the deployed revision does not change; it is reloaded when the revision changed or cannot be read, or with fresh: true. The first line of the text says which revision it shows and whether the page was reused or reloaded. The node list is capped at 150 entries.
To tidy a flow: capture the whole tab, zoom into the messy parts, move nodes with batch-update-nodes (x and y are node centers, on a 20 px grid) and capture again.
Pages
browser-open
Opens a page served by the controller's Node-RED and looks at it. Waits until the page is ready (for the editor: flows loaded; for other pages: loaded, network quiet and visible text stable, so that single-page apps are seen after their loading screen) and returns the final address, the title, the kind of page, the load time, the first lines of visible text, console errors and blocked requests, and a screenshot.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
url | string | one of the two | An absolute URL; a path starting with /, on the Node-RED server (/nodered/dashboard/page1); or a path without /, relative to the editor (dashboard/page1) |
target | editor | one of the two | The Node-RED editor, with its full interface |
screenshot | boolean | no | Attach a screenshot of the viewport. Default true |
waitFor | string | no | A Playwright selector to wait for, up to 10 seconds, once the page is ready |
viewport | { width, height } | no | Size of the window in CSS pixels: width 320 to 2048, height 240 to 2048. Default 1440 × 900; 390 × 844 shows a phone layout |
timeoutMs | integer, 1000 to 60000 | no | How long to wait for the page. Default 30000 |
browser-snapshot
Reads the open page as text, to find elements without pixels.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
mode | tree or text | no | tree (default): the accessibility tree (headings, text, buttons, fields, links and their states), in which elements that can be used carry a [ref=…] handle for browser-interact. text: only the visible text, the cheapest way to read the values a page shows |
selector | string | no | Only this element (a Playwright selector), to keep the answer small |
maxChars | integer, 500 to 60000 | no | Cut the answer at this length. Default 12000 |
A ref is valid only until the next snapshot or navigation. The flow canvas has no accessibility roles: for nodes and wires use capture-flow and get-flow.
browser-interact
Acts on one element of the open page: click, dblclick, hover, fill (replace the value of a field), type (append keystrokes one by one), press (a key such as Enter, Escape, Tab or Control+a; on the whole page when no element is given), select (an option of a select, by value or label), check, uncheck or scroll (bring the element into view).
| Parameter | Type | Required | Meaning |
|---|---|---|---|
action | one of the actions above | yes | |
ref | string | one of the two | A ref from the latest browser-snapshot |
selector | string | one of the two | A Playwright selector (CSS, text=…, role=…, xpath=…). It must match exactly one element |
value | string, or array of strings | no | fill and type: the text; press: the key; select: the option values or labels |
screenshot | boolean | no | Attach a screenshot after the action. Default true |
timeoutMs | integer, 500 to 60000 | no | How long to wait for the element to be visible and enabled. Default 10000 |
After the action it waits 300 ms for the page to settle and returns what happened: the address, new console errors, blocked requests and a screenshot. These are real interactions: on a dashboard a click sends its message into the running flows. Prefer the flow and node tools to changing flows through the editor's interface.
browser-screenshot
A screenshot of the open page. Read-only. Returns the image and a line with the address, the title and the size.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
selector | string | no | Crop to one element |
fullPage | boolean | no | The whole scrollable page instead of the viewport, up to 4000 px tall |
viewport | { width, height } | no | Resize the window first |
format | jpeg or png | no | Default jpeg; png is sharper for thin lines and text |
quality | integer, 30 to 95 | no | JPEG quality. Default 80 |
browser-wait
Waits until the open page reaches a state, for example after an action that updates it later. Returns the address and the title once the state is reached, or an error at the timeout.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
selector | string | no | Wait for this element |
state | visible, hidden, attached or detached | no | State of the element. Default visible |
text | string | no | Wait until this text is visible on the page |
url | string | no | Wait until the address matches this glob, such as **/page2 |
ms | integer, 0 to 30000 | no | A fixed pause, in milliseconds |
timeoutMs | integer, 500 to 60000 | no | Default 10000 |
At least one of selector, text, url and ms is required.
browser-status
Diagnostics of the browser: whether it is running (version, uptime, how many sessions hold a page, last launch error), this session's page (address, title, kind, viewport, when it will be released), the addresses the browser may reach and whether interaction with the editor is allowed, the last 50 console messages, page errors and HTTP errors, and the last 50 requests that were blocked. Use it when a browser tool fails or a page stays blank.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
clear | boolean | no | Empty the console and blocked-request lists after reading them |
close | boolean | no | Release this session's page now |