Legba MCP server for Claude Code
Register Legba once from your project directory. Claude Code can then operate a disposable browser through its normal tool flow.
Browser tools inside the terminal.
Claude Code receives tools for spawning, navigating, acting, extracting, screenshotting, and destroying a browser session. Each session runs real Chromium with a fresh residential IP and fingerprint. The final destroy call removes browser state before another coding task begins.
Add the local server.
Run this command from the project that needs Legba. Claude Code stores the server in its default local scope, so the entry stays private to you and that project. The separator before npx passes the remaining arguments to the MCP server.
The command explicitly selects the stdio transport. It registers the package without creating a shared .mcp.json file. That keeps the key out of the repository while preserving the same server name, executable, arguments, and environment variable documented on the MCP overview.
claude mcp add --env LEGBA_API_KEY=lgb_your_api_key --transport stdio legba -- npx -y legba-browser-mcpReplace the placeholder before running the command. It registers the server name legba, launches npx -y legba-browser-mcp, and passes the same LEGBA_API_KEY used by the main MCP guide.
Check the connection.
- Run
claude mcp get legba. The result should show the stdio command and its arguments. - Start Claude Code and run
/mcp. Open thelegbaentry. Confirm it is connected and all six browser tools are available. - Request a fresh browser session. Confirm
session.spawnreturns a session ID, then testnavigateand finish withsession.destroy.
If the entry exists but remains disconnected, inspect claude mcp get legba first. Check the placeholder was replaced and the package name is unchanged. Remove and add the entry again only after correcting the command.
Continue with the docs, API quickstart, or cloud API pricing.
Also installing for: Cursor, Claude Desktop, VS Code, and Windsurf.