Agent Browser MCP + Chrome DevTools MCP Setup
In this article
This guide walks you through setting up the Agent Browser MCP (Model Context Protocol) server alongside the Chrome DevTools MCP server, so you can give an AI assistant the ability to control a real Chrome browser, inspect pages, run JavaScript, and interact with live web apps. By the end, you'll have both MCP servers configured and connected to an MCP-compatible client (like Claude Desktop, Cursor, or a custom app), and you'll know how to use them together for tasks like automated testing, web scraping, and debugging.
What You'll Need
- Node.js (version 18 or later) installed on your system
- Google Chrome installed (any recent version)
- An MCP client that supports multiple servers (e.g., Claude Desktop, Cursor, or a custom Node.js app using the MCP SDK)
- Basic familiarity with the command line and JSON configuration files
Step-by-Step
- Install the Agent Browser MCP server. Open a terminal and run:
npm install -g @agent-browser/mcp-server. This installs the server globally so you can run it from anywhere. - Install the Chrome DevTools MCP server. Run:
npm install -g chrome-devtools-mcp. (If the package name has changed, check the official repo; the common one ischrome-devtools-mcp.) - Verify both installations. Run
agent-browser-mcp --versionandchrome-devtools-mcp --versionin your terminal. If you see version numbers, both are ready. - Launch Chrome with remote debugging enabled. The Chrome DevTools MCP needs Chrome to run with the
--remote-debugging-port=9222flag. Close all Chrome windows, then start Chrome from the command line:chrome --remote-debugging-port=9222(on macOS, useopen -a "Google Chrome" --args --remote-debugging-port=9222). - Configure your MCP client. Open your MCP client's configuration file. For Claude Desktop, this is usually
claude_desktop_config.jsonlocated in~/Library/Application Support/Claude/on macOS or%APPDATA%\Claude\on Windows. For Cursor, it's under Settings > MCP. - Add the Agent Browser MCP server entry. In the configuration file, add a new server under the
mcpServerskey. Example:{ "mcpServers": { "agent-browser": { "command": "agent-browser-mcp", "args": [] } } } - Add the Chrome DevTools MCP server entry. Add another entry for Chrome DevTools. Example:
{ "mcpServers": { "chrome-devtools": { "command": "chrome-devtools-mcp", "args": [] } } } - Restart your MCP client. Close and reopen the client so it picks up the new configuration. You should see both servers listed as available.
- Test the connection. In your client, ask a simple question like "List the tools available from agent-browser" or "Take a screenshot of example.com" (the latter uses Chrome DevTools MCP). If you get a response, both servers are working.
- Use them together. For example, you can use Agent Browser to navigate to a page, then use Chrome DevTools to inspect network requests or run JavaScript. In a single prompt, instruct the assistant to use both: "Navigate to example.com using agent-browser, then use chrome-devtools to evaluate document.title."
Common Mistakes
- Not starting Chrome with the debugging port. The Chrome DevTools MCP cannot connect if Chrome isn't running with
--remote-debugging-port=9222. Double-check that the flag is present in the Chrome process. - Using the wrong package name. The npm package for Agent Browser MCP might be different from what you expect. Always check the official documentation or run
npm search agent-browser mcpto confirm. - Config file syntax errors. A missing comma or extra brace in your JSON config will cause the client to ignore the server. Validate your JSON with a linter before restarting the client.
- Port conflicts. If port 9222 is already in use, Chrome DevTools MCP will fail. Change the port in both the Chrome launch command and the MCP server args (if supported).
- Forgetting to restart the client after config changes. Many clients only read the config at startup. Always fully quit and reopen.
Tips
- Use a dedicated Chrome profile for debugging to avoid messing with your personal profile. Launch with
--user-data-dir=/tmp/chrome-debug. - Keep the Chrome DevTools MCP server updated, as it tracks Chrome's DevTools Protocol which changes frequently.
- For complex tasks, break them into smaller steps and test each MCP tool individually before combining.
- If you're using a custom MCP client, check the MCP SDK documentation for how to handle multiple servers; some clients require explicit tool routing.
- Use the Agent Browser MCP's built-in browser automation features (like clicking and typing) for UI testing, and Chrome DevTools MCP for low-level debugging like network and performance.
Troubleshooting
- Server not showing up in client. Check the client's logs (often in the terminal or a log file). Common issues: command not found (install globally or use full path), or the server crashes on startup due to missing dependencies.
- Chrome DevTools MCP says "Unable to connect to Chrome." Ensure Chrome is running with the debugging port. Test by visiting
http://localhost:9222/jsonin a browser; you should see a JSON list of open tabs. - Agent Browser MCP fails with a Node version error. Run
node --version; if it's below 18, update Node.js. Some servers require newer versions. - Permissions errors on macOS. If you get a "Permission denied" error when launching Chrome, grant the terminal app Full Disk Access in System Settings > Privacy & Security.
- Both servers conflict on tool names. Some tools may have the same name (e.g.,
navigate). In your MCP client, you can often prefix tool calls with the server name (e.g.,agent-browser.navigate). Check your client's documentation.
Frequently Asked Questions
Do I need to run both servers at the same time?
No, but they complement each other. Agent Browser MCP handles high-level browser actions (navigate, click, fill forms), while Chrome DevTools MCP gives you low-level access (evaluate JS, capture network, inspect DOM). Running both lets you do both in one session.
Can I use these MCP servers with any MCP client?
Yes, as long as the client supports the MCP protocol and can run local command-line servers. Popular options include Claude Desktop, Cursor, and custom Node.js apps using the MCP SDK.
Is it safe to expose the debugging port to the network?
No. The debugging port allows full control of the browser. Only use it on localhost (the default) and never expose it to the internet. Close the debugging session when done.
What if I get a "Tool not found" error when using a specific function?
This usually means the server hasn't loaded that tool. Check the server's documentation for the exact tool name, and ensure the server version is up to date. Also, some tools require additional arguments (like a URL) that you must provide.
Can I use these MCP servers for web scraping?
Yes, you can use Agent Browser MCP to navigate and extract text, and Chrome DevTools MCP to run JavaScript to scrape dynamic content. Be aware of each site's terms of service and robots.txt.
How do I update the MCP servers?
Run npm update -g @agent-browser/mcp-server and npm update -g chrome-devtools-mcp to update to the latest versions. Then restart your MCP client.