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.

Protocol4-step setupBearer key auth

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.

app.example.com
  1. Receive goal from MCP (Model Context Protocol)done
  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 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.

mcp.json — register the Twin MCP server over stdiojson
{
  "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 + cache

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 a key in the Twin dashboard under Keys & Secrets. It starts with ab_live_ and is the only thing the server needs.

  2. 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.

  3. List the tools

    Restart the client. It launches the server over stdio and discovers all 31 tools automatically.

  4. 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?
The Twin MCP server is the npm package `twin-browser-mcp` and it speaks stdio — your client launches it with `npx -y twin-browser-mcp` and passes `TWIN_API_KEY` in the env. There is no hosted HTTP or SSE MCP endpoint to point a URL at; every tool routes through the same `/api/v1` REST surface using your key.
Which MCP clients work with Twin?
Any client that can launch a stdio MCP server — Claude Desktop, Claude Code, Cursor, Windsurf, VS Code and Cline all take the same npx command with TWIN_API_KEY in the env. The config key differs slightly (VS Code uses "servers"; the rest use "mcpServers"), and the server itself is identical.
Do I pay the LLM cost on every MCP call?
Only on the calls that need a model. A cold run_goal plans with an LLM, and that call is billed the higher of its flat price or its metered cost. A compiled skill replayed with run_skill makes no model call at all, and a dispatch hit matches a re-worded goal to an existing skill instead of planning it again.

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.