extension_network_stub
Add a network stub rule to a Chromium session, or clear the rules.
Quick start
Make the API answer 500 and show me what the popup renders
How the agent uses it
Answers the rules now in force; extension_network_read lists them and the requests seen. Rules last until extension_stop. Firefox is refused.
Page text in the answer
Part of this tool's answer is text a web page or the extension wrote. The server fences it between <untrusted-data-ID> and </untrusted-data-ID> with a fresh random ID per call, named in untrusted.boundary. A fence is a signal to the model, not a gate: pair it with --no-ship when the agent reads pages you do not trust. See Server flags and telemetry.
Reference
| Group | extras, off unless named: on with --features=local,platform,extras or --features=local,extras |
| Tier | Test |
| Needs | the server started with extras in --features, as in --features=local,platform,extras; a live dev or start session on a Chromium browser |
| Read only | no |
| Destructive | no |
| Idempotent | no |
| Reaches the open web | no |
Inputs
| Input | Type | Required | Default | What it does |
|---|---|---|---|---|
projectPath | string | yes | Project root of a running session: extension_dev, extension_start, or npx extension dev|start by hand | |
action | "add" | "clear" | no | "add" | add a rule, list or clear the rules, or requests: which requests hit a rule or missed. |
method | string | no | add: HTTP method; default ANY. | |
url | string | no | add: exact URL, or a glob with * and ?. | |
status | number | no | 200 | add: HTTP status to answer. |
body | string | no | add: response text. | |
json | any | no | add: response as a JSON value; not with body. | |
contentType | string | no | add: Content-Type; default by body or json. | |
browser | string | no | Running session's browser; needed when several run. |
When it fails
- The call is refused because no session is live. Start one with
extension_devorextension_startand call again. - The tool is missing from the client's list, or the call answers
E_TOOL_DISABLED. Theextrasgroup is off unless named. Start the server with--features=local,platform,extras, or--features=local,extraswithout the platform tools; see Server flags and telemetry.
Next
- MCP server: install, the three groups and the session gates
- Install in your client
extension_assert: Run a test stage on an extension_dev or extension_start session: pass, fail, not ready (a precondition) or inconclusive per expectation, in one call; extension_dom_snapshot and...extension_network_read: List the network stub rules of a Chromium session, or read which requests hit one or missed.