HUB
Sign inSign up
anchorbrowser logo

sbx/anchorbrowser

Verified Publisher

By Docker, Inc

•Updated about 16 hours ago

Anchor cloud browsers for sandbox agents. Hosted MCP servers, REST API and SDKs. Key stays on host.

Sandbox Kit
0

241

sbx/anchorbrowser repository overview

Tag
Digestsha256:b0ab5106e0de…
Size8.6 kB
Schemav3
Pushedabout 16 hours ago
Specificationspec.yaml
MIXIN

Anchor cloud browsers for sandbox agents. Hosted MCP servers, REST API and SDKs. Key stays on host.

Arguments
NameRequiredDefaultDescription
mcpOptionalall
Register Anchor's hosted MCP servers with the agent (all), or leave the agent's MCP config alone (none).Options: all, none
Providesanchorbrowser
Capabilities

Expand a row to see its full configuration. See the full spec for the complete descriptor.

ConfigurationTypeRequiredDescription
com.docker.sandbox/network-policy@1Required—
com.docker.sandbox/credential@1RequiredAnchor Browser API key from https://app.anchorbrowser.io/api-keys
com.docker.sandbox/lifecycle@1Required—
com.docker.sandbox/agent-skill@1Optional—
com.docker.sandbox/agent-skill@1Optional—
com.docker.sandbox/agent-context@1Required—

Apply this mixin to a sandbox

sbx run <agent> --kit sbx/anchorbrowser:latest

Make sure you have docker sbx installed

Run the following command to install sbx on your machine.

macOS
brew install docker/tap/sbx
Windows
winget install Docker.sbx
Learn more about docker sbx(opens in new tab)

Note

Experimental: Sandbox Kit v3

This kit uses the experimental Sandbox Kit specification⁠, specifically v3⁠. The format and runtime behavior may change before v3 is stable.

⁠Anchor Browser

A mixin kit (kind: mixin) that gives any Docker Sandbox agent access to Anchor Browser⁠ cloud browsers. It registers Anchor's three hosted MCP servers with Claude Code and Codex, bundles two skills, and routes API authentication through the sandbox proxy so the real key never enters the sandbox.

Anchor maintains this kit at anchorbrowser/anchorbrowser-plugin⁠. The copy here tracks that repository so the kit is discoverable alongside the other community kits.

⁠Prerequisites

Create an Anchor Browser⁠ API key and store it once in Docker Sandboxes' host-side secret store:

sbx secret set anchorbrowser

⁠Usage

The primary form is the published OCI artifact on Docker Hub:

sbx run --kit "docker.io/sbx/anchorbrowser:latest" claude

Or target this repo directly over git:

sbx run --kit "git+https://github.com/docker/sbx-kits-contrib.git#dir=anchorbrowser" claude

Or use a local clone:

sbx run --kit ./anchorbrowser/ claude

On the first run sbx asks you to approve sending the anchorbrowser credential to api.anchorbrowser.io. Accept it; the value already lives in the secret store.

Inside the sandbox, anchorbrowser-smoke checks the whole path: it confirms the key is accepted, creates a session, opens the CDP websocket, calls the hosted MCP endpoint, then ends the session and confirms nothing is left running.

⁠What works on which base

Docker's claude, codex and shell workloads ship Python and pip, and no Node.

PathOn those workloads
MCP toolsWork. Claude Code connects to all three servers. Codex gets them in ~/.codex/config.toml.
REST with curlWorks.
Python SDKpip install --user anchorbrowser works, and so do sessions and tasks.
Playwright from PythonIts driver needs the libatomic1 system library, which these images lack.
TypeScript SDKNeeds Node. Compose with the Playwright mixin, which brings it.

To write and run TypeScript against a session, compose the two mixins:

sbx run --kit "docker.io/sbx/playwright:1.65.1-0" --kit ./anchorbrowser/ claude

In that sandbox npm install anchorbrowser and the SDK's createBrowser() connect to a live Anchor session.

⁠How auth works

The kit declares two things:

  • A com.docker.sandbox/credential@1 capability whose apiKey.inject maps api.anchorbrowser.io to the anchorbrowser credential, telling the proxy to set the anchor-api-key header on outbound requests to that host.
  • A com.docker.sandbox/network-policy@1 capability whose runtime.allow also permits connect.anchorbrowser.io, the CDP websocket host, which gets no auth injection. The cdp_url Anchor returns carries no API key.

ANCHORBROWSER_API_KEY is declared with apiKey.proxyManaged: true: the sandbox holds a placeholder, and the proxy supplies the real credential at request time. Because the proxy sets the header on every request to the API host, the SDKs, curl and the MCP clients all authenticate without sending anything themselves.

⁠How MCP registration works

ServerURL
anchorhttps://api.anchorbrowser.io/v1/mcp
anchor-browserhttps://api.anchorbrowser.io/v1/mcp/browser
anchor-actionshttps://api.anchorbrowser.io/v1/mcp/actions

One script, anchorbrowser-mcp-register, runs as an install hook and again as a startup hook. The install run is race-free: it comes after the workload's own install hooks, which seed the agent's config, and before the agent launches. The startup run repeats it on every boot. It stores no header and no placeholder in the agent's config, because the proxy supplies the key.

It registers with Claude Code (claude mcp add) and Codex (~/.codex/config.toml). For other agents, add the URLs by hand. To leave the agent's MCP config alone:

sbx run --kit ./anchorbrowser/ --kit-arg mcp=none claude

⁠What gets installed

ComponentLocationHow
anchorbrowser-smoke/usr/local/bin/Static file in the kit's overlay layer
anchorbrowser-mcp-register/usr/local/bin/Static file in the kit's overlay layer
SDK skill and MCP tool guide/usr/share/anchorbrowser/skills/Static files in the overlay, exposed to the agent through agent-skill@1 where the workload has a skills directory

The overlay is staged under /out and copied into a scratch stage with explicit modes. Copying a file straight into scratch with --chmod applies that mode to every parent directory BuildKit creates, which would replace the base's /usr/share with one the agent cannot traverse.

⁠Network

api.anchorbrowser.io and connect.anchorbrowser.io for Anchor itself, and pypi.org, files.pythonhosted.org and registry.npmjs.org for the SDK installs the agent context documents. The live view on live.anchorbrowser.io is left out on purpose: you open it in your own browser, not from the sandbox.

⁠Cleanup

The kit writes nothing to the host. Remove the stored key with sbx secret rm anchorbrowser. Sessions created inside the sandbox belong to your Anchor account; anchorbrowser-smoke ends the one it creates.