Skip to main content
Chrome downloads and secrets stay on the browser host until an explicit narrow transfer. Exports, script artifacts and screenshot files use bounded server memory retention. File bytes are not persisted in PostgreSQL or sent over the native v3 control connection. Native file streaming joins two outbound HTTPS requests with backpressure; retained export/artifact bytes stream directly on GET. This is single-replica, in-memory state, not restart-transparent or horizontally distributed storage. The direct GET-link workflow below is available in 0.3.14; use matching server and CLI versions.

Tools and flow

Tool names have the browser_ prefix:
  • create_upload {name,size,sha256?} prepares one exact-length upload (optional lowercase hex SHA-256) and returns its upload capability.
  • PUT the bytes using the returned capability. transfer_status {resourceId} reports browser-local verification state. Gateway transfer status is separately keyed by transferId. IDs come from tool results; a file name is not an ID, and an unknown ID is reported as not found without changing anything.
  • upload_files {tabId,fileIds,ref?|selector?|chooserId?,frames?} explicitly attaches completed staged IDs. No arbitrary filesystem path or inline bytes are accepted. The runtime retains the exact target element and checks that its document (the page, or the frame that holds the input) did not change, while navigations of the page’s other frames and same-document navigations (history.pushState, replaceState, fragment changes) do not count; it never re-resolves a stale chooser. Attachment can immediately submit data to a website. An uncertain attachment must not be retried automatically. Before attaching, the runtime refuses, with nothing attached and retrySafe: true: a staged file that is not ready (upload_not_ready) or unknown (resource_not_found), a ref or selector that matches no element (file_input_not_found, after waiting up to five seconds for a selector) or several (file_input_ambiguous), an element that is not a file input in the page (not_a_file_input), several files for an input without multiple (file_input_single), a chooser that is no longer open (file_chooser_expired), a page or frame of the input that loaded another document meanwhile (target_changed) and a frames selector that does not match one loaded iframe (frame_not_found). Once the files were handed to the input, the attachment is the tab’s pageState.lastAction (upload_files), also when it then fails. Attached files stay on the browser host while the input’s document lasts, also across its same-document navigations, as the input and the page’s File objects do: until a new document commits in its frame (another page, a reload, a restore from the back/forward cache), the frame is removed (as when the page loads another document) or the tab closes.
  • list_downloads {} lists actual browser download files. create_download {downloadId} (legacy fileId accepted) returns a direct HTTPS GET bearer URL for that exact completed file, never a replay of its URL/request. POST/blob/data/one-use links work through Chrome’s actual completed download file. Page exports, script artifacts and screenshot files (screenshot {deliver:'file'|'both'}, of the page or of one element by ref or selector) return direct links immediately; create_download {resourceUri} reissues a link for retained bytes without rerunning the source action.
  • retry_download_capture {downloadId} explicitly starts capture again for a capture-failed entry, using only its original completed browser source. It returns capturing; poll transfer_status {resourceId: downloadId}. It does not request the website again, issue a transfer link, or extend retention. Older runtimes refuse this new operation until updated.
  • cancel_transfer {resourceId} cancels a staged data resource and revokes its unfinished grants: their transfer_status {transferId} reports cancelled with reason revoked, also when the browser host ending its side of the transfer had failed them first. A grant that expired or failed before the cancel keeps its reason. The existing {tabId,eventId} chooser/download cancellation has separate runtime semantics. Already attached bytes cannot be recalled; backing files remain until document/session lifecycle ends.
  • capture_secrets {tabId,code,frames?} admits a bounded transaction. Within that function only, use await browserMcp.secrets.set('TOKEN', document.querySelector('#token').value). The helper is not installed on window or as a global Playwright binding. It has no reader.
  • list_secrets {} returns vault IDs/names/counts/expiry only, each with the tabId of its tab, the same ID that capture_secrets returned and other tools take; delete_secrets {vaultIds} deletes selected captures.
  • create_secret_export {vaultId,names,format:'json'|'dotenv'} explicitly selects names from one capture and creates a short-lived immutable export. No automatic all-secrets export.
Create operations return browser resource metadata; the server issues separate agent/runtime capabilities and privately authorizes the runtime rendezvous. Only the agent capability may enter MCP results; the runtime bearer must never enter MCP receipts. Capabilities themselves are sensitive model-visible authority.

Results and grant limits

Every model-facing tool result carries its complete data in ordinary text content (serialized JSON), mirrored in structuredContent. No tool requires a client to read structuredContent, so clients that pass only text content to the model can use every transfer. The only exception is the app-only browser_watch_ticket, whose view ticket is for the live-view MCP App. create_upload and create_secret_export results contain:
  • resourceId (upload_files takes an upload’s resourceId as its fileId), transferId, name, maxBytes/size, and state: "prepared";
  • capability: {transferId, resourceId, method, url, headers:{Authorization:"Bearer …"}, expiresAt, limits}. Uploads use PUT; secret exports use GET;
  • expiresAt, the capability’s deadline in epoch milliseconds (at most 60 seconds), and retainedUntil, when the prepared resource is discarded unless it is used (attached uploads stay while their page needs them);
  • guidance on redeeming the capability.
The capability is a bearer credential in model context and conversation history, like download URLs. It is single-use and short-lived, but treat it like a password: keep the bearer in a private mode-0600 header or capability file rather than a command argument, and never publish it. Idempotency receipts never store it: replaying a create call returns only its identifiers (resourceId, transferId, expiry), so you can inspect or cancel the resource and request a new grant with a fresh idempotency key. A session holds at most four outstanding transfer grants: upload, secret-export and Chrome-download (create_download {downloadId}) grants count from the moment they are requested until their transfer completes, fails, is cancelled or expires. Retained export/artifact links count only while being fetched. A request beyond the limit is refused before anything is prepared, with rejectedBeforeAdmission: true, code: "transfer_capacity", the limit that applies (session_streams, global_streams, session_bytes, browser_bytes, global_bytes or leases) and retrySafe: true. Of several parallel create_upload calls, at most four succeed (fewer if grants are already outstanding) and the rest are refused. Send or cancel earlier grants (cancel_transfer {transferId}), or let them expire, then retry only the refused requests with fresh idempotency keys. If a grant cannot be issued after the runtime prepared its resource (authority revoked during the call, a byte limit only known after preparation, or the runtime not confirming authorization), the result is a definite failure: no capability was issued and nothing was transferred. It names the resourceId, and the server cancels the prepared upload or secret export (preparedResourceCancelled). If that cleanup cannot be confirmed, cancel the resource yourself; it also expires within five minutes. A failed Chrome-download grant leaves the retained download unchanged.

Download lifecycle and PDF completeness

Download events carry a stable downloadId/resourceId from start through capture completion or failure. Use that ID in transfer_status {resourceId} and, once ready, create_download {downloadId}. The event’s legacy transferId correlates to its starting event only; it is not the later gateway delivery transfer ID. completed means the bounded copy is retained, not that an HTTPS link was fetched or the document is valid. Capture waits for browser completion and compares the completed local file’s size/SHA-256 with an independent reread of retained bytes before publishing readiness. Unavailable, unreadable or mismatched source bytes fail closed; the website action is never replayed. Downloads belong to the session that owned the originating tab when the download began. A tab a session opens is owned before its first navigation, so open_tab or navigate to a URL that answers with an attachment starts a download owned by that session: the tab keeps its document and the result reports downloadStarted: true instead of a navigation error. Navigation (including subframes), tab close and tab handoff do not revoke them, so a popup that closes itself after starting its download keeps it. They are retained for five minutes after Chrome finishes the file; a download still in progress may take up to the ten-minute admission deadline. Explicit cancellation, session end and runtime disconnect revoke bytes earlier. A download from a tab no session owns (a user tab, including one whose session ended) and a completed download that Playwright never attributed to a tab (for example a new tab opened without an opener whose first navigation downloads) are shared: owner: "user" instead of owner: "this_session", listed and retrievable by every session of the runtime, like user tabs themselves, and unaffected by any one session’s end. Downloads in a tab another session owns stay private to that session. Admission refuses a download (download_scope_unavailable) when the runtime is disconnected, when its tab’s ownership was revoked while it was being admitted, when a download from a user tab is being admitted while any session ends or hands a tab back (the user tab may have just been released), or when the tab closed before admission and had no recorded owner. A popup whose opener closed before the popup was tracked has no known owner, so its downloads are shared. list_downloads returns pending/ready/capture-failed files plus a separate terminal array; terminal failure/expiry/revocation metadata is retained for five minutes, bounded to 128 records. After that bound (or process restart), status may be unavailable. Failed capture is never reported as completed. Reissuing a link only transfers retained bytes, never repeats the website action. Attached uploads and secret exports, by contrast, end with the document they belong to (see upload_files and the secret contract). A completed browser source whose capture fails remains in the runtime-owned mode-0700 Chrome spool, under its original quota reservation, until the original five-minute expiry (cleanup sweep within ten seconds) or earlier explicit cancellation/revocation/shutdown. Partial copies are discarded. capture-failed has readiness: unavailable, no retrieval selector, and a capture-only retry selector. Unsafe, oversized, cancelled or browser-failed sources are not eligible. Retry never extends expiry, and concurrent retry attempts are refused. Missing bytes are reported explicitly; retry cannot recreate them. A used/expired transfer link still uses create_download, not capture retry. After an uncertain retry response, inspect status before starting a fresh attempt. Native download metadata includes scope-private capture evidence (completion/stage, source and retained size/hash, comparison and cleanup), never source paths, URLs, raw browser errors or document contents. contentValidation.status: not-validated explicitly distinguishes byte integrity from document validity. Verified zero-byte files remain retrievable with readiness: ready-with-warning: .pdf/.eml names get empty-document and an unusable-document warning; other names get empty-file, which may be intentional. Filename-based warnings do not validate MIME or syntax. Empty HTTP retrieval is supported. Failure codes include download_capture_source_unavailable, download_capture_browser_failed, download_capture_mismatch, download_capture_timeout and download_quota_exceeded; terminal records have no retrieval selector. capture.diagnostic contains a random correlation id, an allowlisted operation (completion, path, open, stat, copy, verification) and reason: ENOENT, EACCES, EPERM, ELOOP, ENOTDIR, EMFILE, ENFILE, EIO, ENOSPC, not-regular-file, unsafe-path, source-changed, outside-spool, quota-exceeded, browser-failed, cancelled, or unknown. outside-spool means Chrome reported writing the completed file somewhere other than the private spool; Browser MCP never reads other folders, offers no capture retry for it, and re-pins routing for later downloads. No arbitrary exception text is returned. sourceAvailability is present, unavailable, unconfirmed or unsafe; presence does not establish readability or verified bytes. Size/hash fields are only populated when measured, independently of cleanup status. PDF export is page printing, not native message/document export. Results identify exportKind: page_print, printMode: css_print, and contentCompleteness: unverified. Chrome applies print CSS; scroll containers, collapsed sections, lazy/unloaded content and images may be omitted. Successful PDF generation verifies bytes, not source completeness. Inspect all PDF pages for the expected text/images. Prefer the site’s original download/export for messages and proprietary documents. If authorized, use normal site controls to open its dedicated print view and export that tab. The tool does not automatically expand, scroll, rewrite styles, or trigger a site print action.

HTTP contract

Download capability JSON includes transferId, resourceId, method:"GET", url, empty headers, expiresAt (epoch ms), limits, name, mimeType, exact size and lowercase-hex sha256. The URL is /api/native-data/<transfer-id>/download/<256-bit-random-token> and is sufficient for ordinary curl, without cookies, headers or any chat-specific import tool. It is intentionally model-visible in ordinary text, structuredContent, conversation history and shell logs. Anyone holding it can redeem it until expiry/revocation; do not publish it. The gateway keeps only token hashes, while bounded ordinary result receipts retain download URLs to replay the same result (not issue new links). Upload and secret-export capabilities retain headers.Authorization on /api/native-data/<transfer-id>; the URL alone grants nothing. The capability, including that header, is in ordinary result text as well as structuredContent (see results and grant limits). A distinct header bearer on /runtime is only for the browser host and is never exposed to the client. All routes reject query strings, ambient cookies and Origin headers; no CORS or cookie authority is granted. Methods and Range are constrained. Downloads return no-store attachment responses with safe filename/MIME, size and no-referrer headers. Both sides and all joined streams expire at the absolute 60-second grant deadline (or earlier issuer expiry); attachment never extends it. Links to retained export/artifact bytes, which the server already holds and which take a stream slot only once fetched, have a 5-minute deadline instead, bounded the same way. The server revalidates issuer scope before issuance/redemption and every second during active leases, with a 900 ms fail-closed authorization deadline. All grants permit exactly one request per side, including ordinary files. Ranges/resumption/automatic retries are unsupported. A valid download URL returns 410 link_used, link_expired, link_revoked or link_failed; unknown/invalid/purged links return 404, unsupported method/Range 400, stream capacity 429 before consumption. A GET consumes its link on admission, not after confirmed local saving. After an ambiguous reply, query state rather than repeat the PUT or browser attachment. Request a new grant when needed; secret exports always require a fresh grant after uncertain delivery. Revocation aborts joined streams. The side that receives the bytes (the browser host for an upload, the agent for a Chrome download or secret export) gets its response once the other side’s first bytes arrive, or once it completed a zero-byte transfer: if the grant ends first (it expired, was cancelled or revoked, or the other side failed before sending anything), that response is 410, with link_expired, link_revoked or link_failed for a link and Transfer failed otherwise, never a body that only looks complete. A stream that ends later, before its bytes are complete, ends the response early (the side that receives the bytes checks their size and SHA-256). The grant’s state (transfer_status {transferId}: failed with reason expired or failed, or cancelled with reason revoked) records why, and the server logs nothing for it. Relay restart loses all grants. Default ceilings: 256 MiB/file; 512 MiB/session; 1 GiB/browser-local spool and gateway browser reservations; 4 GiB/global gateway reservations; 32 concurrent gateway streams and 4 per authenticated session, counting outstanding grants from request to settlement (retained export/artifact links reserve byte capacity when issued, opening streams only on GET); 4,096 retained gateway lease records (completed, failed and cancelled metadata is kept for three minutes after a link’s deadline, and the oldest of it is dropped first when the limit is reached); 128 local resources. Gateway queue watermarks are 64 KiB measured in bytes. Incoming HTTP chunks are sliced into 64 KiB writes with awaited backpressure; only one upstream chunk is retained at a time. The HTTP parser’s incoming allocation remains bounded by the request/file ceiling and concurrency, not by the gateway queue watermark. Streams use bounded backpressure, not full-file memory buffers. Prepared files expire after five minutes; attached upload backing files survive until document/tab/session cleanup (relay disconnect/pause retains already attached backing files while pages survive). Private directories/files use modes 0700/0600. Only manifest-owned paths are deleted. Crash directories are intentionally retained rather than guessed safe to delete. Chrome’s download routing is pinned by a browser-level CDP session that the native lifecycle opens before exposing the context and keeps attached until the owned browser closes. It sets Browser.setDownloadBehavior (allowAndName) to the same private spool Playwright uses for Download.path(). Chrome lets the most recent caller own that per-context setting and restores its normal download folder when that caller’s session detaches. A page-target session detaches when its tab closes, which is why CLI 0.3.17 and earlier sent every later download to the host’s normal download folder (failing capture at browser-file with ENOENT) once the first tab of the dedicated window was closed. The same session receives download events from every tab and enforces admission: 256 MiB/file, 512 MiB aggregate active downloads, eight concurrent downloads and a ten-minute deadline. Installation fails closed if routing cannot be enabled. Chrome reports where it wrote each completed file: capture compares that with the spool path and reports outside-spool rather than a bare ENOENT when they differ, and the session immediately re-pins routing. An interrupted or cancelled download’s partial file is removed by its exact GUID. Completed files in the spool are captured. Page downloads surfaced by Playwright are matched to Chrome’s download GUID by URL and suggested filename and confirmed when capture opens the file. A completed download that no page event surfaced is adopted as a shared download after five seconds, or up to about 35 seconds while a page download with the same URL and filename may still confirm it; a download that fails before confirming releases its tentative match. Downloads that complete before the data plugin starts (for example while pairing) are adopted once it does, within ten minutes. Downloads that complete while the runtime is disconnected are deleted, like other bytes at disconnect. The guard keeps download records for ten minutes after they settle, at most 512; a completed file whose record is dropped before capture stays in the spool until the owned run directory is removed. The plugin opens the completed local file as a regular, non-symlink file and makes a bounded private copy; it does not trust Playwright stream EOF as proof of success. Source stability and retained bytes are verified before deleting only that exact download’s original spool file. Recoverable capture failure does not delete the completed source (capture.cleanup: retained); cancellation/revocation does. Capacity is reserved for measured bytes when the browser completes a file, not for the largest possible file when it starts, so concurrent downloads do not exhaust the budget: a completed source counts its size against the 512 MiB/session logical-file quota (shared downloads count only toward the browser budget) and twice its size against the 1 GiB/browser disk budget (source plus copy) until verified source deletion leaves only the copy. In-flight bytes are bounded by the admission limits above. A failed source that could not be measured keeps a conservative 512 MiB disk reservation. A completed file that does not fit fails with download_quota_exceeded and is deleted. download.delete() alone is not deletion proof: Playwright suppresses unlink errors. Cleanup removes only the exact owned spool leaf and checks local absence before releasing accounting. capture.cleanup: browser-context means cleanup is unconfirmed; accounting remains reserved. A download that failed or was cancelled before completion has no completed file: the guard removes Chrome’s partial file for its GUID when Chrome settles it, even if Chrome confirms the cancellation slowly, so this never closes the browser. If a completed source’s deletion cannot be confirmed, data admission stops and the owned Chrome/profile run directory is closed to bound leftovers; cleanup never follows a symlink or scans another Downloads directory. Filesystem/ownership failures during shutdown remain explicit and may require operator cleanup. browser-context is not a recovered download. Waiting for Chrome to finish a download is bounded by the ten-minute admission deadline; copying and verification then have a two-minute capture deadline. Filesystem kernel I/O itself is not forcibly cancellable. Progress cancellation is reactive and can overshoot between events; production needs an OS/filesystem quota for a hard whole-profile disk ceiling. An incognito window opened in the dedicated browser keeps Chrome’s own download routing; Browser MCP does not capture its downloads, but the guard’s admission limits apply to every download the browser makes, including those. No user’s Downloads directory is scanned. HTTPS is mandatory. Server/plugin constructors can explicitly enable allowInsecureLoopback for development-only localhost/127.0.0.1/[::1] HTTP fixtures; this is not permitted for remote origins. Agent helpers remain HTTPS-only.

Agent commands

The optional helpers accept capability JSON in a private mode-0600 file (or via stdin). Downloads also work with plain curl; upload/secret-export credentials still belong in protected header/capability files, never literal bearer arguments:
Output creation is exclusive, non-symlink-following and mode 0600; existing outputs are not overwritten. Helpers do not print secret plaintext. POSIX output protections are implemented; Windows output fails closed until explicit ACL support exists. exec invokes an executable with shell:false, injecting parsed values directly into its environment. The child can expose those values through its own output; its output is not magically redacted. NUL-containing environment values are rejected. Ordinary download/export/artifact links require only curl (the variable below is illustrative; no real token belongs in documentation):
Do not use --location or automatic retries. Verify size and SHA-256. A result with two or more export or artifact files also has one tar bundle link and, in its text, a ready-to-run command that fetches, checks and unpacks all of them; see several files. Use browser_create_download with the same retained source selector (or resourceUris for several files) and a fresh idempotency key for a fresh link; never replay the website download/export/script automatically. See expiry, reissue and recovery. Upload curl interoperability still uses a protected header file, not a broad credential in command arguments:
The header file contains Authorization: Bearer ..., must be mode 0600, and must never be committed. Curl output permissions/overwrite protection are the caller’s responsibility (prefer helper commands). Do not use --location or automatic retries.

Secret contract and limits

Variable names match [A-Za-z_][A-Za-z0-9_]*. Duplicate names within a capture reject the entire transaction; each successful capture creates a separate immutable version/vault ID. Maximum 128 variables/capture and 128 characters/name, 64 KiB UTF-8/value and 1 MiB aggregate runtime vault accounting (including names and per-entry overhead), five-minute TTL. Empty captures are rejected; entry ceilings are 32/session, 64/browser and 128/runtime. Exports recheck revocation and document identity after asynchronous resolution and immediately before resource admission. The capture deadline is 15 seconds. A timed-out page function may still execute, but it cannot commit to the vault; do not blindly re-run it. Diagnostics remain suppressed until its actual evaluation settles. Capture return values are discarded. Exceptions are replaced with fixed errors; normal metadata contains no plaintext or plaintext-derived digest. Vault scope includes browser instance, authenticated credential/session, tab, origin and the document the values were captured from: the tab’s page, or the frame frames named. The end of that document (its frame navigates, also within itself with history.pushState, or is removed; the page navigates), tab close or handoff, session end and disconnect revoke vaults and their exports and abort in-progress browser data requests. Navigations of the page’s other frames (ads, embeds, lazily loaded frames) do not: the values stay usable, for exports and HTTP sign-ins too, while their own document lasts. JavaScript memory offers no secure-erasure guarantee. JSON is lossless for arbitrary strings. The documented dotenv dialect is exactly NAME=<JSON string> per line, with JSON escaping for newlines/quotes/backslashes/Unicode. The matching parser does no interpolation. This deliberately is not shell syntax and is not guaranteed compatible with every third-party dotenv package. Never source untrusted page-derived text. This protects the dedicated capture path from accidental transcript leakage; it is not universal redaction. Arbitrary JavaScript, normal page text, screenshots/live view, malicious same-user processes, authorized client shells and the TLS-terminating server operator remain outside that guarantee. Operator-blind encryption and a trusted non-model capability delivery channel are not implemented.