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.
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.
- Receive goal from Claude Codedone
- Compile DOM → token-efficient indexed statedone
- Match the semantic dispatch cacherunning
- Replay compiled skill — 0 LLM callsqueued
What you get through Claude Code
Every integration is a thin wrapper over the same execution layer, so the cache, the replay, and the corpus apply no matter how you call in.
Semantic dispatch cache
A re-phrased goal fuzzy-matches an already-compiled skill, so most calls never touch the LLM.
Deterministic replay
A compiled skill replays the exact action path with zero LLM calls — fast, repeatable, cheap.
Cross-tenant skill corpus
A skill compiled once can be safely reused across tenants, so the hit rate climbs as the network runs.
One Bearer key
Auth, usage-based billing, and an audit log run on every call — the same key works from every integration.
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.
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.
Get an API key
Create an ab_live_ key in the Twin dashboard under Keys & Secrets.
Add the server
Run claude mcp add with --env TWIN_API_KEY and the npx command, or edit the MCP config directly.
Confirm the tools
Claude Code lists the twin-browser tools on startup.
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?
Can Claude Code compile skills for CI?
Related
More ways to connect Twin
Claude Desktop
Claude Desktop is Anthropic’s desktop app for Claude, and it can launch local MCP servers listed in `claude_desktop_config.json`. Registered tools become available to Claude in the conversation.
Cursor
Cursor is an AI-native code editor with a built-in agent that can call MCP tools. Servers are registered in `.cursor/mcp.json` for a project or `~/.cursor/mcp.json` globally, and their tools become available to the agent while you work.
MCP (Model Context Protocol)
MCP is an open protocol that lets an LLM application discover and call external tools over a standard interface. An MCP client — Claude Desktop, Claude Code, Cursor, Windsurf, VS Code, Cline — launches or connects to an MCP server, lists its tools, and invokes them on the model’s behalf, with no bespoke glue per app.
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.