MCP client integration

Twin Browser + Visual Studio Code

VS Code’s Copilot agent mode supports MCP servers, configured in `.vscode/mcp.json` for a workspace or in your user profile. Note the shape difference: VS Code uses a top-level `servers` key where most other clients use `mcpServers`.

MCP client4-step setupBearer key auth

How Twin plugs into Visual Studio Code

Add Twin to `.vscode/mcp.json` and the agent in your editor can run a browser task against the app you are building — sign into a local or staging environment, walk a flow, and report what it found. Keep the config in the repo and everyone on the team gets the same tools; VS Code also supports prompted `inputs` if you would rather not commit a key at all.

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 Visual Studio 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 Visual Studio Code.

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

.vscode/mcp.jsonjson
{
  "servers": {
    "twin-browser": {
      "command": "npx",
      "args": ["-y", "twin-browser-mcp"],
      "env": { "TWIN_API_KEY": "ab_live_…" }
    }
  }
}

// Committing a key is a bad habit even in a private repo — VS Code supports
// prompted "inputs" so the value is entered once per session instead.

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. Create .vscode/mcp.json

    Use the servers key — VS Code differs from the mcpServers shape other clients use.

  3. Add the server

    command npx, args -y twin-browser-mcp, with TWIN_API_KEY in env (or an input so VS Code prompts for it).

  4. Start it

    Start the server from the editor, then use agent mode and ask for a web task.

FAQ

Visual Studio Code on Twin — common questions

Why does VS Code use "servers" and not "mcpServers"?
It is just VS Code’s own configuration schema. The server, the transport and the tools are identical — only the wrapper key differs, which is the single most common reason a copied config silently does nothing.
Can I keep the key out of the repo?
Yes. VS Code’s mcp.json supports prompted inputs, so the key is entered when the server starts rather than committed. Either way it is a tenant credential — revoke and rotate it from the dashboard if it leaks.

Wire up Visual Studio 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.