MCP client integration

Twin Browser + Claude Code

Claude Code is Anthropic’s agentic coding tool for the terminal, and it supports MCP servers. Registered tools become available to the agent so it can take real actions — including browser automation — as part of a coding task.

MCP client4-step setupBearer key auth

How Twin plugs into Claude Code

Register the Twin MCP server and “check that the deployed page actually works” or “grab the data behind this login” becomes one tool call. The pattern worth building here is compile-then-replay: have the agent solve a flow once with `run_goal`, freeze it with `compile_skill`, and then call that skill by name from CI over REST — a per-deploy check that costs no model call.

Twin is the browser execution layer your stack calls. The first run cold-compiles a skill via skill compilation; every similar request after that is matched from the cache and replayed deterministically, so your marginal cost per run trends toward zero rather than climbing with usage.

app.example.com
  1. Receive goal from Claude Codedone
  2. Compile DOM → token-efficient indexed statedone
  3. Match the semantic dispatch cacherunning
  4. Replay compiled skill — 0 LLM callsqueued

Wire it up

Drop Twin into Claude Code.

Copy, paste, and swap in your Bearer key. The first run compiles a skill; repeats match the semantic dispatch cache and replay deterministically.

Register with the Claude Code CLIbash
claude mcp add twin-browser \
  --env TWIN_API_KEY=ab_live_… \
  -- npx -y twin-browser-mcp

# Then, inside Claude Code:
#   "With twin-browser, run the signup flow on the preview URL and compile it
#    into a skill so CI can replay it on every deploy."

# And from CI, with no model in the loop:
curl -X POST https://twin-browser.com/api/v1/skills/signup-smoke/run \
  -H "Authorization: Bearer $TWIN_API_KEY"

Base URL https://twin-browser.com/api/v1 · auth Authorization: Bearer ab_live_… · over MCP the same engine is run_goal, compile_skill and run_skill — the full tool table.

  1. Get an API key

    Create an ab_live_ key in the Twin dashboard under Keys & Secrets.

  2. Add the server

    Run claude mcp add with --env TWIN_API_KEY and the npx command, or edit the MCP config directly.

  3. Confirm the tools

    Claude Code lists the twin-browser tools on startup.

  4. Compile for CI

    Have the agent compile the flow once, then replay it by name from CI over the REST API.

FAQ

Claude Code on Twin — common questions

Why use Twin here instead of a headless browser script?
A script breaks on layout drift and an in-loop agent re-plans on every run. Twin plans once, compiles the path, and replays it deterministically — so a per-deploy check is both cheap and resilient, and a genuine break surfaces as a failed replay rather than a silent selector miss.
Can Claude Code compile skills for CI?
Yes — that is the intended pattern. Have the agent call compile_skill once, then call POST /api/v1/skills/{name}/run from CI for a deterministic, LLM-free check.

Wire up Claude Code in minutes.

Free to start. Usage-based credits from $29/mo — each call billed the higher of its flat action price or its metered cost.