Skip to main content
← Legba MCP server
Legba MCP

Legba MCP server for VS Code

Put Legba behind VS Code's agent tools. The workspace config starts the same server used by every other supported client.

What you get

Six tools in agent chat.

VS Code gains the tools needed to create, drive, read, and destroy a Legba browser session. The browser runs real Chromium on a residential IP with a fresh fingerprint. Its tool set covers navigation, page actions, extraction, screenshots, and explicit session disposal.

Install

Configure the workspace.

Create .vscode/mcp.json in the workspace. VS Code uses the client-specific servers field and an explicit stdio transport. For a profile-wide install, run MCP: Open User Configuration and paste the same server entry there.

Keep legba beside any existing server definitions. The editor starts npx -y legba-browser-mcp as a local stdio process. It passes LEGBA_API_KEY through the env object, matching the canonical Legba configuration while using VS Code's wrapper fields.

.vscode/mcp.jsonjson
{
  "servers": {
    "legba": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "legba-browser-mcp"],
      "env": {
        "LEGBA_API_KEY": "lgb_your_api_key"
      }
    }
  }
}

Replace the placeholder with your Legba API key. Keep workspace credentials out of source control. Save the file, then accept the trust prompt when VS Code starts the local server.

Verify

Inspect the running server.

  1. Open the Command Palette and run MCP: List Servers. Select legba and confirm it is running without an output error.
  2. Open Chat and choose Configure Tools. Confirm VS Code discovered session.spawn, navigate, extract, act, screenshot, and session.destroy.
  3. Ask agent chat to spawn a session and load a test URL. Verify it receives a session ID and page result, then call the destroy tool.

If the server stops immediately, choose Show Output from MCP: List Servers. Confirm the JSON uses servers, not mcpServers. Correct the key or command, then restart the server from the same menu.