Edge + Chrome DevTools MCP: Setup Guide
In this article
This guide shows you how to connect Microsoft Edge to the Chrome DevTools MCP (Model Context Protocol) server, letting an AI assistant inspect, debug, and automate your browser in real time. You'll be able to give natural-language commands like "open the console and show errors" or "take a screenshot of this page" and have them executed via DevTools. Before starting, you need: Node.js (v18 or later), an MCP-compatible client (like Claude Desktop, Cursor, or VS Code with Copilot), and Microsoft Edge installed. You'll also need to enable remote debugging in Edge, which is a one-time setup.
What You'll Need
- Node.js (v18+) installed on your system
- An MCP client (e.g., Claude Desktop, Cursor, or VS Code with the MCP extension)
- Microsoft Edge (stable, Beta, or Dev channel)
- Basic familiarity with command-line tools
Step-by-Step
- Install the Chrome DevTools MCP package globally:
Open a terminal and run:npm install -g @modelcontextprotocol/server-chrome-devtools
This installs the official MCP server that bridges AI clients to Chrome DevTools Protocol. - Enable remote debugging in Edge:
Right-click the Edge shortcut (desktop or taskbar) and select Properties. In the Target field, append the flag--remote-debugging-port=9222(after the existing path). For example:C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --remote-debugging-port=9222
Click OK. If you're on macOS/Linux, you can launch Edge from the terminal with the same flag. - Start Edge with remote debugging:
Launch Edge using the modified shortcut. You should see a new browser window. To verify debugging is active, open a new tab and go tohttp://localhost:9222/json– you'll see a JSON list of open tabs. - Configure your MCP client:
Open your MCP client's configuration file (e.g.,claude_desktop_config.jsonfor Claude Desktop, or the MCP settings in Cursor/VS Code). Add a new server entry with the command:npx @modelcontextprotocol/server-chrome-devtools
Set the environment variableCHROME_PATHto the full path of your Edge executable (e.g.,C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe). Also setCHROME_DEBUG_PORTto9222. - Restart your MCP client:
After editing the config, restart the client completely. The MCP server will start automatically and connect to Edge via the debugging port. - Test the connection:
In your MCP client, send a simple command like "List all open tabs" or "Navigate to example.com". If everything is set up, you'll see the action executed in Edge. - Use DevTools features via natural language:
You can now ask the AI to run JavaScript in the console, inspect network requests, capture screenshots, or evaluate accessibility. For example: "Take a screenshot of the current page" or "Show me the console errors on this page."
Common Mistakes
- Not using the exact flag: The flag is
--remote-debugging-port=9222(double dash, no spaces). A typo like-remote-debugging-portwill silently fail. - Forgetting to set CHROME_PATH: Without this, the MCP server may try to launch Chrome instead of Edge, or fail to find the browser.
- Using a different port: If you change the port in Edge, you must also change it in the MCP client config. Mismatched ports cause connection errors.
- Running Edge with an existing profile: Remote debugging may not work if Edge is already running with a regular profile. Close all Edge instances before starting with the flag.
- Ignoring firewall prompts: On Windows, you may see a firewall prompt for Node.js – allow it, otherwise the connection may be blocked.
Tips
- Use a dedicated Edge profile: Create a separate profile for debugging (e.g., in Edge settings) to avoid messing with your everyday browsing data.
- Keep the debugging port private: Only run remote debugging on localhost. Do not expose the port to your network – it allows full control of the browser.
- Combine with Playwright: The MCP server can also control Playwright scripts if you need more complex automation.
- Check the JSON endpoint: If something doesn't work, visit
http://localhost:9222/json/versionto see the browser version and ensure the debugging is active. - Update regularly: Both Edge and the MCP package get updates. Run
npm update -g @modelcontextprotocol/server-chrome-devtoolsperiodically.
Troubleshooting
Connection refused on port 9222: This usually means Edge isn't running with the debugging flag. Close all Edge windows, then launch it again with the modified shortcut. Verify with http://localhost:9222/json.
MCP server starts but no browser opens: Check that CHROME_PATH points to the correct executable. On Windows, the path may contain spaces – enclose it in quotes in the config.
Commands work but nothing happens in Edge: Make sure you're interacting with the right tab. The MCP server may target the active tab by default. Try "List tabs" to see what's open.
Error: "Cannot find module" when running npx: This indicates the package isn't installed. Run npm install -g @modelcontextprotocol/server-chrome-devtools again, or try npx @modelcontextprotocol/server-chrome-devtools --help to test.
Edge crashes when starting with the flag: Some extensions or settings may conflict. Try launching Edge with a clean profile: add --user-data-dir=C:\temp\edge-debug to the target.
AI can't see console logs: Ensure you've enabled console listening in the MCP client. Some clients require you to explicitly ask for console output.
Frequently Asked Questions
Can I use this with Chrome instead of Edge?
Yes, but you'd need to adjust CHROME_PATH to point to Chrome. The MCP server works with any Chromium-based browser.
Do I need to keep the terminal open?
No, the MCP server runs as a background process started by your client. You only need the terminal for setup and troubleshooting.
Is remote debugging safe?
It's safe if you only listen on localhost (the default). Do not change the port to a network-facing one without a firewall.
Can I automate form filling or clicking?
Yes, the MCP server supports DOM actions like clicking, typing, and submitting forms via natural language commands.
What if I have multiple Edge windows open?
The MCP server connects to the first available debugging endpoint. You can specify a tab by URL or title in your command.
Will this work on Edge for Mac or Linux?
Yes, as long as you set the correct path to the Edge executable and use the same debugging flag.