Protocol integration
Twin Browser + 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.
How Twin plugs into MCP (Model Context Protocol)
Twin ships a first-party MCP server as the npm package `twin-browser-mcp`. It speaks stdio: your client starts it with `npx`, you give it one environment variable — `TWIN_API_KEY` — and the execution engine appears as 31 native tools. `run_goal` turns a goal on a target URL into deterministic browser action; `compile_skill` freezes a successful run into a reusable skill; `run_skill` blind-replays one with no model in the loop; `dispatch` fuzzy-matches a re-worded goal to a skill you already have. Beyond those, the catalogue covers async jobs, extraction, search, crawling, monitors, connect links, human-in-the-loop resume and recording. Every target-bearing call is authenticated with your key, scoped to your tenant, metered and audited.
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 MCP (Model Context Protocol)done
- Compile DOM → token-efficient indexed statedone
- Match the semantic dispatch cacherunning
- Replay compiled skill — 0 LLM callsqueued
What you get through MCP (Model Context Protocol)
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 MCP (Model Context Protocol).
Copy, paste, and swap in your Bearer key. The first run compiles a skill; repeats match the semantic dispatch cache and replay deterministically.
{
"mcpServers": {
"twin-browser": {
"command": "npx",
"args": ["-y", "twin-browser-mcp"],
"env": { "TWIN_API_KEY": "ab_live_…" }
}
}
}
// The model can now call, among 31 registered tools:
// run_goal(url, prompt, success) -> plans and executes a goal
// compile_skill(target, goal) -> freezes a run into a reusable skill
// run_skill(name) -> deterministic replay, no LLM in the loop
// dispatch(url, prompt, success) -> semantic-cache match, else compile + cacheBase 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 a key in the Twin dashboard under Keys & Secrets. It starts with ab_live_ and is the only thing the server needs.
Register the server
Add a twin-browser entry to your client’s MCP config with command npx, args -y twin-browser-mcp, and TWIN_API_KEY in the env.
List the tools
Restart the client. It launches the server over stdio and discovers all 31 tools automatically.
Run a goal
Ask the agent to perform a web task — it calls run_goal, and repeated work can be compiled and replayed.
FAQ
MCP (Model Context Protocol) on Twin — common questions
Is there an HTTP or SSE MCP endpoint I can point a URL at?
Which MCP clients work with Twin?
Do I pay the LLM cost on every MCP call?
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.
REST API
Twin’s REST API is the universal integration path: HTTPS endpoints under `/api/v1/*`, authenticated with a Bearer key. Any language that can make an HTTP request can drive the browser execution layer — no SDK required, and none is published.
Wire up MCP (Model Context Protocol) 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.