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.
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.
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.
{
"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.
Inspect the running server.
- Open the Command Palette and run MCP: List Servers. Select
legbaand confirm it is running without an output error. - Open Chat and choose Configure Tools. Confirm VS Code discovered
session.spawn,navigate,extract,act,screenshot, andsession.destroy. - 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.
Continue with the docs, API quickstart, or cloud API pricing.
Also installing for: Cursor, Claude Code, Claude Desktop, and Windsurf.