Skip to content

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 and browser-status say 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 call browser-status with close: true in 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 is httpNodeRoot, then the path of its ui-base node, then the path of its ui-page node, for example /nodered/dashboard/page1; get-flows and get-settings give 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.

ParameterTypeRequiredMeaning
flowIdstringyesTab or subflow id
region{ x, y, width, height }noArea of the canvas to capture, in canvas units (the x and y of the nodes). Default: the whole tab
nodeIdstringnoCenter the capture on this node and outline it. Instead of region
radiusnumbernoWith nodeId: half the size of the square captured around it, in canvas units. Default 300
selectarray of strings, up to 50noNode ids to outline in the image
maxDimensioninteger, 400 to 2048noMaximum width or height of the image, in pixels. Default 1568
formatpng or jpegnoDefault png. A PNG above about 1.5 MB is sent as JPEG
freshbooleannoReload 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.

ParameterTypeRequiredMeaning
urlstringone of the twoAn absolute URL; a path starting with /, on the Node-RED server (/nodered/dashboard/page1); or a path without /, relative to the editor (dashboard/page1)
targeteditorone of the twoThe Node-RED editor, with its full interface
screenshotbooleannoAttach a screenshot of the viewport. Default true
waitForstringnoA Playwright selector to wait for, up to 10 seconds, once the page is ready
viewport{ width, height }noSize of the window in CSS pixels: width 320 to 2048, height 240 to 2048. Default 1440 × 900; 390 × 844 shows a phone layout
timeoutMsinteger, 1000 to 60000noHow long to wait for the page. Default 30000

browser-snapshot ​

Reads the open page as text, to find elements without pixels.

ParameterTypeRequiredMeaning
modetree or textnotree (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
selectorstringnoOnly this element (a Playwright selector), to keep the answer small
maxCharsinteger, 500 to 60000noCut 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).

ParameterTypeRequiredMeaning
actionone of the actions aboveyes
refstringone of the twoA ref from the latest browser-snapshot
selectorstringone of the twoA Playwright selector (CSS, text=…, role=…, xpath=…). It must match exactly one element
valuestring, or array of stringsnofill and type: the text; press: the key; select: the option values or labels
screenshotbooleannoAttach a screenshot after the action. Default true
timeoutMsinteger, 500 to 60000noHow 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.

ParameterTypeRequiredMeaning
selectorstringnoCrop to one element
fullPagebooleannoThe whole scrollable page instead of the viewport, up to 4000 px tall
viewport{ width, height }noResize the window first
formatjpeg or pngnoDefault jpeg; png is sharper for thin lines and text
qualityinteger, 30 to 95noJPEG 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.

ParameterTypeRequiredMeaning
selectorstringnoWait for this element
statevisible, hidden, attached or detachednoState of the element. Default visible
textstringnoWait until this text is visible on the page
urlstringnoWait until the address matches this glob, such as **/page2
msinteger, 0 to 30000noA fixed pause, in milliseconds
timeoutMsinteger, 500 to 60000noDefault 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.

ParameterTypeRequiredMeaning
clearbooleannoEmpty the console and blocked-request lists after reading them
closebooleannoRelease this session's page now