Skip to main content
BRICKS Foundation implements the Chrome DevTools Protocol (CDP), providing a frontend-like debugging experience for your applications. Connect via Chrome DevTools to inspect the DOM, debug JavaScript, profile performance, and view console logs. You can also connect CDP-supported tools like Puppeteer or Playwright to write automation scripts or connect via AI agents. An MCP endpoint is also provided for AI agent integration.

On by default

On BRICKS Foundation 2.25 and later, local debugging is on by default — the DevTools server starts at boot with no setup, listening on the local network on port 19851. If that port is already in use, it increments to the next available port. To review or change the controls, open Settings on the device and navigate to the advanced settings section:
  • Enable local debugging turns the server on or off entirely. Turn it off to stop the server.
  • Enable Chrome DevTools Protocol (CDP), Enable Model Context Protocol (MCP), and Enable LAN Discovery are sub-toggles, all on by default.
  • Passcode is optional — set it only when you want to require a passcode for access.
Requires BRICKS Foundation 2.25 or later. On older versions the server is opt-in — enable Chrome DevTools manually in advanced settings.

Discover devices

Use the BRICKS CLI to scan your local network for devices with DevTools enabled:
Devices must have Enable LAN Discovery turned on in advanced settings for network scanning to work. This is enabled by default.

Authentication

DevTools access is scoped to the device’s workspace. Clients authenticate with either a workspace token or an optional device passcode.

Workspace tokens

Any member of the device’s workspace can connect using a DevTools workspace token — an Ed25519-signed token that is distinct from the Workspace API Token. The BRICKS CLI and CTOR Desktop acquire and refresh these tokens automatically, so signed-in workspace members usually connect without any extra steps. To issue or refresh a token manually, run:
Tokens have a default lifetime of 30 days. The CLI caches the token per profile and workspace in ~/.bricks-cli/config.json (it is never printed), reuses it until it nears expiry, and re-issues automatically if a request returns 403.

Optional passcode

A device also accepts a passcode, but only when one is explicitly set in advanced settings. There is no default passcode. As a one-time migration, a device that had local debugging explicitly enabled before upgrading to 2.25 but no passcode keeps the legacy BRICKS_DEVTOOLS passcode so existing access keeps working. Clients can present either credential — over the WebSocket path /ws/<credential>, as a query parameter, or as an Authorization: Bearer <token or passcode> header for MCP. When both are available, a workspace token takes precedence over a passcode.

Auth state

bricks devtools scan and bricks devtools open show an auth state for each device: bricks devtools open --info also reports whether workspace authentication is enabled.

DevTools endpoints

Once you find a device, use bricks devtools open with the --info flag to view all available endpoints:
This displays connection URLs for: With --info, the output also includes the authorization details for whichever credential applies. The MCP and MCP SSE endpoints accept an Authorization: Bearer <workspace token or passcode> header. Without --info, the command shows server identity (name, version, device ID, workspace, protocols, and authentication state).

Open the DevTools page

Open the Web UI URL in your browser to access the DevTools landing page. From there you can inspect the running application, view available debug targets, and connect to the device.

Connect with Chrome

You can also connect directly through Chrome:
  1. Open chrome://inspect in Chrome
  2. Your device appears in the list of remote targets — the /json discovery endpoints are always served, so no setup is required
  3. Click inspect to open a DevTools window connected to the running application
If the device has a passcode, enable Expose passcode to chrome://inspect in advanced settings so Chrome can connect without a prompt.
Expose passcode to chrome://inspect embeds the configured passcode into the public /json URLs in plain text. Only enable it for debugging on trusted networks.

Inspect via BRICKS CLI (CDP)

Requires BRICKS Foundation version 2.24 or later.
The BRICKS CLI provides CDP commands to inspect devices directly from the terminal — without opening a browser:
Signed-in workspace members need no extra flags — the CLI acquires a workspace token automatically. Use --passcode only to reach a passcode-protected device whose workspace you are not a member of. See the CLI command reference for the full list of CDP commands.

What you can do with DevTools

A connected DevTools window looks like a browser’s, but BRICKS Foundation is not a web page — each panel projects the device’s live runtime instead. Four panels are wired up and meaningful: Elements, Console, Network, and Application. Other panels (Sources, Performance, Memory, and the inspect-element button) are hidden because there is no web page behind them.

Elements — the Brick tree

DevTools Elements panel showing the BRICKS render tree as a DOM document
The Elements panel shows your application’s render tree projected as a DOM document. The tree is rooted at #document and nests the structures you build in BRICKS:
  • Each Subspace is a <subspace> element. The Canvas that is currently displayed is merged into it, so its Bricks appear directly as children — there is no separate <canvas> node — and canvas-* attributes (canvas-id, canvas-title, …) describe which Canvas is showing.
  • Each Brick is one element whose tag name is the Brick type with the BRICK_ prefix removed — for example <text>, <image>, <text_input>, <video>, <chart>, <items>, <webview>, <qrcode>.
  • A Brick’s primary content appears as the element’s text — a Text Brick shows its string, an Image Brick shows its source path (long values are truncated).
Only the currently rendered Canvas of each Subspace is shown; Bricks on the Subspace’s other Canvases are not in the tree. Generators and Data do not appear in Elements — find Generator traffic in the Network panel and stored Data in the Application panel. Read a Brick’s identity and layout from its attributes: Selecting a Brick shows its attributes inline and its resolved runtime state in the side panel — the Properties tab exposes the Brick’s props, events, outlet, and templateKey, while Styles and Computed show its synthesized layout. Hovering or selecting a node highlights the matching Brick or Subspace on the device, with a label such as text — WelcomeHeader. Search the tree from the Elements search box with BRICKS-aware selectors:
  • #welcome-text or #B_3 — match by alias or short ID
  • :pressable, :editable, :hidden — match by capability or state
  • .MyStateGroup — match Bricks belonging to a state group
The Elements tree is read-only — editing attributes or removing nodes does not change the running app, and edits revert. To drive the app, use the system helpers in the Console (below) or a CDP automation tool.

Console — runtime logs and the system helpers

DevTools Console panel showing the connect banner and the system helper object expanded
The Console streams the device runtime’s own logs — application output, [System] Event: lines when events fire, and native model (LLM/STT) logs. It is not a web page’s console.*. Recent history replays automatically when you connect. When you connect, BRICKS also injects a set of helper objects directly into the Console’s evaluation scope. Type them by name — there is no globals prefix to write. Run usage() first to print the full catalog, or type globalThis to expand the whole tree. system.* is the core of app inspection:
IDs follow the same prefixes as the Elements panel — Subspaces S_, Bricks B_, Data/properties D_, Generators G_. Asynchronous helpers report through [Launcher] … log lines rather than an inline return value. Secrets (passwords, tokens, API keys) are masked as [HIDDEN].

Network — request traffic

DevTools Network panel showing a captured HTTP request with headers
The Network panel shows requests made by Generators, the preload process, and the runtime. Capture is active whenever DevTools is enabled, so requests appear even before you open the panel. How each source is represented: For example, a Generator pointed at mqtt://broker.example.com:1883 shows one row (status 101 Connected); publishing {"temp":21} to sensors/room1 appears in Messages as an outgoing frame [sensors/room1] {"temp":21}, and inbound messages appear as incoming frames.
Network traffic is shown verbatim and is not redactedAuthorization headers, API keys in URLs, and request/response bodies are all visible. DevTools access is workspace-scoped by default, so treat it as sensitive — anyone with your workspace membership or the device passcode can see this traffic verbatim.
Subspaces, Canvases, Bricks, and Property Bank values have no direct Network rows — they only appear indirectly, as the source of the Generators or preload steps that make requests. Response bodies are cached for recent requests only, and connections opened before DevTools started will not appear.
Responses served from the runtime cache do not appear as network requests yet — surfacing runtime cache activity in this panel is planned for a future release.

Application — stored Data (read-only)

DevTools Application panel showing BRICKS storage projected into IndexedDB
The Application panel projects the device’s runtime storage into the browser’s storage buckets, all under a single origin bricks://app:
A DATA-… database holds the runtime Property Bank, which is distinct from the Data Bank storage product in BRICKS Controller. Likewise, GENERATIVE_MEDIA_CACHE is a runtime cache, not Media Box or Media Flow.
The Application panel is read-only — values cannot be edited from DevTools; change them in the app instead. Object values update live as the app runs, and secrets are masked as [HIDDEN].

Next steps

Remote debugging

Debug devices remotely via BRICKS Controller without local network access.

Debug panel

Use the on-device overlay to inspect runtime state.