> ## Documentation Index
> Fetch the complete documentation index at: https://browser-mcp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Runtime recovery and transfers

# Runtime deadlines and document transfers

Deadline recovery and binary artifacts were introduced in Browser MCP 0.3.13. **Unreleased follow-up:** downloads now use direct URL-bearer GET links, replacing the header-only/chat-import workflow described in the historical verification below. Use matching server and native CLI 0.3.13; native protocol remains 3 and there is no database schema change. Older runtimes report update-required errors for missing capabilities. Stop the old CLI before upgrading, then restart the same named profile to preserve sign-ins and pairing. The npm distribution is one cross-platform Node package; the Helm chart remains community-only.

## Deadline, quarantine and recovery

`browser_runtime_health {}` uses the relay control path, not page JavaScript. It reports caller deadline, execution state, quarantine, and a non-sensitive `operationId`. Health records are scoped to the originating browser credential/session; another scope sees only anonymous blocker state, never the operation identity, target or timing.

**Unreleased — bounded ordinary FIFO (`runtime-queue.v1`).** Normal concurrent commands wait in arrival order; only one ordinary operation executes at a time, including its result transfers. Waiting is limited to **16 requests per runtime, 8 per credential/session scope, and 5 seconds per request**, additionally bounded by the caller's total deadline. Queue wait does not reset or extend the execution deadline. The server sends an absolute `deadlineAt` (epoch milliseconds), separate `queueWaitMs`, and the existing execution `timeoutMs`; clocks should be synchronized. The broker's result-delivery grace never permits later execution. Older protocol-3 runtimes still use their previous immediate-busy behavior.

* `queue_full` and `queue_wait_expired` are actionable `outcome:not_dispatched`, `executionState:not_started`, `retrySafe:true` rejections. Those requests cannot run later. Re-observe the target/authority, then retry **only a never-dispatched request** with a fresh idempotency key; do not use tight retry loops or close tabs for normal contention.
* Cancellation while waiting returns `queue_cancelled` and `cancellationConfirmed:true`. Cancellation of executing work returns an uncertain result and quarantines it: aborting a transport wait does not prove page effects stopped. MCP request cancellation is forwarded by the server, and independently authenticated control frames may cancel only the original connection's exact request ID. A caller deadline signal expires waiting work but does not abort running page JavaScript or turn it into confirmed cancellation.
* Before execution, the runtime rechecks the original scope epoch, connection generation, tab object, the tab's document (a navigation of its page, also to the same URL or within the document, or a handoff; an iframe's navigation leaves a waiting request as it was, !823), and ownership. It does not claim or retarget another session's tab on queue admission. With a matching server, a bounded `dispatch_check` / `dispatch_ready` exchange revalidates live server authority at the FIFO head. Missing/revoked/expired authority fails closed. Queued authorizations are cancellable and use the same waiting bound. Native checks run again after asynchronous page preflight; later batch steps recheck scope/deadline without treating deliberate earlier-step navigation as stale queue input.
* Session end settles that scope's waiting calls; pause, disconnect, shutdown and recovery discard affected waiting work. On transport loss, local health retains bounded scoped never-started records; a server that did not receive a result truthfully reports unknown, never guesses cancellation succeeded. Reconnect never restores the old queue. The runtime retains its request-ID replay fence across reconnects.
* Health, authorized recovery and session teardown bypass the ordinary FIFO. Broker control requests have a separate bounded allowance. Remote health's `queueDepth` covers **only the requesting scope**, with no other scope's identities, targets, arguments or timing; local owner health can report total depth. Queue limits and retry guidance contain no page data. Normal results are published before the next queued command starts.

A timeout is **not cancellation**. The runtime keeps the operation quarantined while its execution is unresolved. Later ordinary commands return `blocked_by_prior_operation` immediately, with `outcome: not_dispatched`; they are **not queued**. There is no automatic mutation replay, including after reconnect.

* Timeout/interruption immediately settles all waiting requests as never dispatched. The queue is discarded, not suspended for automatic resumption.
* Natural late completion clears admission and records `settled_late`. Only **fresh, revalidated requests** can then execute; the discarded queue stays discarded. Late settlement does not rewrite the original caller's unknown result or replay it.
* Pause/disconnect/session cancellation aborts transport waits but does **not** prove page JavaScript stopped. The quarantine survives relay reconnect even when the transport promise settles.
* With explicit user approval to discard the blocked tab's unsaved page state, call:

  ```json theme={null}
  {"operationId":"<health operationId>","method":"close_tab","approval":"The user approved closing this blocked tab"}
  ```

  using `browser_runtime_recover`. Only the exact operation's owning scope can do this. It closes that tab without before-unload handlers; it does not clear cookies/profile data, close other tabs, or rerun the original command. `terminationConfirmed:true` requires confirmed target closure **and** original runtime-task settlement. The original effect remains unknown.
* If closure cannot be verified within five seconds, recovery reports unknown. Do not repeat it; health can report late recovery. For unavailable recovery (no tab, ended owner session, or browser transport failure), ask the user to stop/restart the dedicated runtime. Never kill an unrelated Chrome or delete its profile.
* A local pause deliberately disconnects remote access. `browser-mcp browser status --profile NAME` still reports independent local health, including quarantine; a remote client receives `browser_offline` or explicit paused/initializing rejection. Remote tools cannot undo local pause. Local `stop`/Ctrl-C closes the owned Chrome; restarting gets a new runtime generation and never replays old operations. Existing stale-lock `browser recover` is separate from remote tab recovery.

Errors include sanitized categories, diagnostic IDs, stage and operation-specific recovery: `unsupported_target`, `tab_closed`, `runtime_disconnected`, `context_destroyed`, `execution_timeout`, `script_exception`, `transfer_failed`, and `blocked_by_prior_operation`. Operator stderr receives correlation ID/category/stage/outcome only, not exception messages, page URLs, code, credentials or stacks. Read-only failures and pre-dispatch rejection are distinguished from unknown mutations. This metadata cannot prove whether a website completed a business action. One exception: a `browser_run_js` `script_exception` returns `scriptException` with the script's own exception `name`, a `message` bounded to 500 characters (`messageTruncated`), its `line`/`column` within the submitted script and the tab's current `url`, marked untrusted like the script's result; the stack stays suppressed. The outcome stays `unknown` for a script declared `intent: "mutate"`; a script declared `intent: "read"` fails definitely, with `retrySafe: true`, like an observation (see [scripts](https://browser-mcp.mintlify.site/mcp-tools.md#scripts)).

Pointer and form actions on a ref say why they could not act, instead of an `execution_timeout` (see [clicking and typing like a person](https://browser-mcp.mintlify.site/mcp-tools.md#clicking-and-typing-like-a-person)): `ref_stale`, `not_a_form_field`, `option_not_found`, `invalid_browser_input`, `pointer_unknown` and a `target_not_actionable` for an input drawn over by its widget are definite failures before any input (`retrySafe: true`); a `target_not_actionable` after Playwright's own wait and `check_state_unchanged` keep the outcome `unknown`. Their messages and recovery texts are constant. What covers an element (`cover`, `layer`) and a select's `options` are bounded page data in result fields, untrusted like `scriptException`, and receipts drop them with other page-derived content.

An action's `target` locator (see [finding elements](https://browser-mcp.mintlify.site/mcp-tools.md#finding-elements-query-matches-targets-and-dom-backed-refs)) is resolved before any input: `target_not_found`, `target_ambiguous`, `target_invalid` and `target_unresolved` are definite refusals (`retrySafe: true`) with constant messages and recovery texts; their `candidates` (refs, roles, names, boxes) are bounded page data in result fields, untrusted like `cover`. A ref whose frame navigated or was removed is `ref_stale` too, no longer a `runtime_operation_failed` with an unknown outcome.

A failure before the first dispatch is never reported as an unknown outcome. The relay and the runtime track when an operation first dispatches (the point `pageState.lastAction` uses); whatever fails before it, such as a tab that closed first or a document read for screenshot coordinates that failed because the page navigated, is reported as `not_dispatched` with `retrySafe: true`, the code of its cause and a recovery that says nothing was dispatched, and stops a batch at that step with `not_dispatched`. Checks the runtime makes before input are refusals with their own codes and constant messages, listed in [outcomes](https://browser-mcp.mintlify.site/mcp-tools.md#outcomes-receipts-and-sessions): runtime argument checks (`invalid_browser_input` with a constant `problem`), `screenshot_crop_outside_viewport`, the element checks of `browser_screenshot` (`screenshot_target_missing`, `screenshot_target_ambiguous`, `screenshot_target_invalid`, `screenshot_target_not_visible`), the file input checks of `browser_upload_files` (`file_input_not_found`, `file_input_ambiguous`, `not_a_file_input`, `file_input_single`, `file_chooser_expired`, `target_changed`), `frame_not_found` and `browser_session_stopped`. Failures after dispatch keep the outcome `unknown`.

## Tool-only binary workflow

1. Use authorized website download/export UI. Observe a **ready** entry from `browser_list_downloads`; `terminal` records describe terminal failures/expiry/revocation. For a `capture-failed` entry, inspect its sanitized `capture.diagnostic` and `sourceAvailability`, then explicitly use `browser_retry_download_capture {downloadId}` and poll status. This retries only the original completed browser file before its original expiry, never the website action; genuinely missing bytes cannot be recreated. No link is available until capture is verified. Download events carry the same `downloadId`; query `browser_transfer_status {resourceId: downloadId}` for status. An empty list is not proof of a browser crash. See [download lifecycle and print completeness](https://browser-mcp.mintlify.site/native-data.md#download-lifecycle-and-pdf-completeness).
2. Call `browser_create_download {"downloadId":"<returned downloadId>"}`. Legacy `fileId` remains accepted. Pass exactly one selector.
3. Read `capability.url` from the ordinary tool text (also in structuredContent). Fetch it directly with a generic shell:

   ```sh theme={null}
   umask 077
   curl --fail --output document.pdf "$DOWNLOAD_URL"
   sha256sum document.pdf
   pdftotext document.pdf -
   ```

The URL alone authorizes GET: **no headers, browser cookies, resource-reading tools, Browser MCP CLI, chat adapter or import tool**. Do not use redirects (`--location`), automatic retries, or Range. Verify exact `size` and `sha256` before processing/publishing. Curl output paths and overwrite protection are the caller's responsibility. Publishing is a separate authorized action.

Page exports (`browser_export_page`), binary script artifacts and screenshot files (`browser_screenshot` with `deliver: "file"` or `"both"`) immediately include the same direct URLs in ordinary text, HTTPS `resource_link` blocks and `structuredContent.resources[]`. Each entry includes `url`, `capability`, `resourceUri` (the retained-source selector, not the download URL), and `reissue:{tool:"browser_create_download",arguments:{resourceUri}}`. No follow-up call is needed before the first GET. If capacity/authority prevents issuance, the completed source's selector is preserved with `linkError` and recovery advice, not a request to replay the source action.

A result with two or more such files also carries `bundle`: one single-use link to a tar archive of all of them, with `reissue:{tool:"browser_create_download",arguments:{resourceUris}}` for every file, and each `resources[]` entry gives its `bundleName`. Its text has one ready-to-run shell command that fetches the archive once, checks its SHA-256 (`sha256sum` or `shasum`) and unpacks the files into a new `browser-mcp-<id>` directory; run it instead of one curl per file. See [several files](direct-download-links.md#several-files-one-bundle-one-command).

Both create-download results and capability include `size`, lowercase-hex `sha256`, `name` (safe filename), `mimeType`, `sourceKind`, and `expiresAt` (link deadline in epoch milliseconds). `retainedUntil` separately describes source retention. Native Chrome downloads conservatively use `application/octet-stream`; exports/artifacts declare their MIME. Capability shape:

```text theme={null}
{transferId, resourceId, method:"GET", url, headers:{},
 expiresAt:<epoch milliseconds>, limits:{maxBytes,maxAttempts:1,resumable:false},
 size, sha256, name, mimeType, sourceKind}
```

The URL contains a random 256-bit bearer token. **Anyone holding it can redeem it until expiry/revocation.** By design it is visible in model context, conversation history and shell-command logs. It is also retained in bounded ordinary tool receipts; replaying the receipt returns the same URL, not a fresh lease. Do not publish URLs, cookies, tokens or private content in issue/release evidence. Operators should redact download paths in access logs. The gateway stores only token hashes. Broad MCP/runtime credentials are never returned. Upload/secret-export grants keep their bearer in an Authorization header; like download URLs they appear in ordinary result text, but never in receipts (see [results and grant limits](https://browser-mcp.mintlify.site/native-data.md#results-and-grant-limits)).

Native files support up to 256 MiB; export/script resources remain limited to 20 MiB per blob/call. No client-specific import limit applies. Existing scoped `resources/read` remains compatible but is not required. The optional updated `browser-mcp files download` helper still verifies exact size/hash and creates exclusive mode-0600 output; ordinary curl is sufficient.

### Lifetimes and reissue

* One-use links to retained export/artifact/screenshot-file bytes, bundles included, expire within 5 minutes; Chrome-download, upload and secret-export grants within 60 seconds. Both are additionally bounded by token and source expiry. No Range/resume or transparent retry.
* Preview resources last up to 30 minutes under a bounded server memory quota (20 MiB per blob). Native download retention has its own runtime quota/lifetime.
* Session end, token revocation, runtime disconnect/pause, server restart, or browser-generation change revoke access. **Disconnect also destroys resource bytes/URIs and runtime download IDs.** Reconnect does not restore them.
* Valid URLs return HTTP 410 JSON with `link_expired`, `link_used`, `link_revoked` or `link_failed`. Invalid/unknown URLs (including after restart or metadata purge) return 404. Unsupported method/Range returns 400 without consuming a valid link. Capacity returns 429 before consumption; inspect active transfers rather than blindly retrying. A GET consumes the link on admission, even if delivery is later interrupted.
* If a link expires/is used while its source is still retained in the current connection/session, call `browser_create_download` for the same `resourceUri` or `downloadId`, or with `resourceUris` (such as `bundle.reissue.arguments`) for several export/artifact files at once. A fresh tool idempotency key is required for a fresh link; replaying a receipt returns the same, possibly expired/used URL. No source action is replayed. For an active native producer, wait for settlement or cancel the old `transferId` before reissue.
* `browser_cancel_transfer {transferId}` revokes one link; it does not destroy the source bytes or undo a completed GET. Session/token/runtime revocation prevents reissue too. After short-lived gateway metadata is purged, exact expired/used/revoked distinctions are unavailable.
* After ambiguous GET delivery inspect transfer status. Reissue only for retained bytes if the user still authorizes transfer; never automatically re-run a website download, export or script. After source revocation, a new source action needs an explicit task decision.

## Binary script artifacts and PDFs

`r5dCreateArtifact(filename, content, mimeType?)` accepts strings, `Uint8Array` and `ArrayBuffer`. File names are simple names, at most 255 characters. At most 32 files / 20 MiB total are accepted per call. Binary encoding is internal to the browser-to-relay transport; tool text contains only metadata and direct HTTPS links. Ordinary return values still have the 1 MiB JSON limit.

On a supported web page, when the user authorizes fetching the original same-origin document and ordinary controls cannot perform that transfer:

```js theme={null}
const response = await fetch('/authorized-document', { credentials: 'same-origin' });
if (!response.ok) throw new Error('Document request failed');
const bytes = await response.arrayBuffer();
r5dCreateArtifact('document.pdf', bytes, 'application/pdf');
return { saved: true }; // Do not return the bytes or response headers.
```

Pass `intent:"read"` (the script changes nothing in the page or the site; use `mutate` for one that may) and a specific reason to `browser_run_js`. Browser authentication stays in the browser. This does not bypass access controls, authorization, CORS, consent, or file-size limits.

`browser_capabilities` exposes target metadata and transfer guidance without a URL/origin denylist (`targetPolicyRestricted:false`). `pageToolsSupported`, `observation`, and `screenshot.supported`, `runJs.supported`, and `export.supported` are `null` when unprobed, **not** promises of support or policy denials. `capabilityProbe: metadata_and_webmcp` describes metadata/WebMCP discovery, not successful screenshot, evaluation or export. PDF classification uses available CDP MIME metadata as well as viewer/URL hints; a `.pdf` suffix alone is not proof of content type or complete document access.

Chrome may still refuse particular internal/extension/viewer operations. Report the actual limitation rather than repeatedly retrying or weakening browser security. A viewer DOM or screenshot is not complete PDF text or original bytes. When source bytes are needed, use the site's/viewer's actual download/export UI and the existing `browser_list_downloads` → `browser_create_download` path, or an explicitly authorized fetch from a page where Chrome permits it, then use local document tools. No new original-document download API or page-script PDF decoder is added. See [document access](https://browser-mcp.mintlify.site/document-access.md).

## Model schema compatibility

The server advertises all 50 tools using a compact schema projection. It omits only repeated locator-strategy `anyOf` branches and the nonblank `\\S` regex; types, property names, required fields, bounds, other regexes, nullable variants and action unions remain. Locator descriptions still require exactly one nonempty strategy. The complete canonical schema is retained for Ajv validation, after semantic preflight, **before admission**; refusals name the argument and its shape (see [argument errors](https://browser-mcp.mintlify.site/mcp-tools.md#outcomes-receipts-and-sessions)). This is not a relaxation of runtime input validation. The projection addresses a model grammar-compiler failure observed as an HTTP-200 empty/zero-token response with the complete browser/workspace catalog. No tools are hidden or truncated.

## Historical 0.3.13 verification (2026-10-20)

This section records the superseded header-grant/chat-import workflow and the **prior document-target denylist**, not the current unrestricted target policy. Internal-page rejections below are historical results, not current expected behavior or evidence that Chrome itself refuses those targets. See [direct-link verification](direct-download-links.md) for the subsequent URL-bearer workflow and [document access](https://browser-mcp.mintlify.site/document-access.md) for the current target policy.

No automated test suites were added or run for this change. Source typechecks and production server/frontend/CLI builds passed. Disposable Chromium probes used only synthetic local content:

* Unresolved async promise and infinite CPU loop: caller deadline, reachable independent health, immediate later-command rejection, explicit approved close-tab recovery verified.
* CPU side-effect counter remained exactly one after recovery. Natural late completion similarly produced one effect and cleared quarantine without replay.
* Relay disconnect/reconnect retained quarantine even after its cancelled transport wait settled; recovery remained reachable. Relay Stop → native shutdown → owned context close also exited cleanly with an infinite CPU script running.
* Empty approval rejected; internal `chrome://version` capabilities reported unsupported page tools; screenshot rejected with transfer guidance; closed-tab and script-exception categories were sanitized (synthetic exception sentinel was not returned/logged).
* ArrayBuffer artifact and PDF print export traversed real Chromium → relay blob upload → scoped resource store → one-use data gateway with matching hashes/sizes; second redemption returned 404.
* Ordinary Chrome download transferred with exact checksum; fresh grants after success and after expiry reused retained bytes, without another website request. Separate manual gateway probes covered expiry, revocation, session isolation, size bounds, and exclusive source selector validation.

A chat client integration verified both the real app-adapter path and a full real-model/UI flow: minimal page read → authenticated PDF download → workspace import (16,993 bytes) → correct `pdftotext` output; HTML export/import (248 bytes) → local read; Uint8Array artifact/import (5 bytes) → exact hex `00ff018041`. The model used all browser tools plus workspace tools with non-strict optional-input handling; the advertised projection resolved the empty-response compiler failure without hiding tools. Reloaded UI showed all three successes. Independently inspected persisted transcripts contained no Bearer/Authorization strings or capability URLs. Same-operation-ID path replay and cross-chat isolation were also verified. No publish action was taken. No deployment/release was performed here. OS/platform variations (especially real PDF viewer internals and a full CLI stop/restart under CPU saturation) require further target-platform coverage; the tested Linux headless Chromium closure is not a claim that every Chrome/platform supports recovery.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.