
CodeCraftinghub
If you’ve tried to connect the Chrome DevTools MCP server to Cursor IDE, you might have run into a frustrating wall
If you’ve tried to connect the Chrome DevTools MCP server to Cursor IDE, you might have run into a frustrating wall: Chrome doesn’t automatically open a debugging port, and even if you force it, your existing Chrome session gets tangled up. After wrestling with this myself, I found a clean, simple solution. Let me share it with you.
The Chrome DevTools MCP server needs to talk to a Chrome instance that’s listening for debugging connections on a port (like 9222). But the Chrome you use daily isn’t started in debug mode. You could close Chrome and relaunch it with the right flags, but that kills your tabs and settings not ideal.
Even if you try to add the flags while Chrome is running, it won’t work. And using your regular profile for debugging can cause conflicts with extensions, bookmarks, and logged in sessions.
We’ll launch a second Chrome window that:
No extensions, no cookies, no interference. Perfect for automated testing or just inspecting your code’s runtime.
Note: I’m using Windows here. For macOS/Linux, see the alternative commands at the end.
Open a Command Prompt (or PowerShell) and run this single command:
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="C:\Temp\chrome-debug-profile"A new Chrome window will pop up. It’ll look bare – no extensions, no bookmarks, no history. Keep this window open while you use Cursor.
In Cursor, open your MCP configuration. You can find it under File > Preferences > MCP Servers (or by editing ~/.cursor/mcp.json directly).
Add (or replace) the Chrome DevTools entry:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--browser-url=http://127.0.0.1:9222"
]
}
}
}The key part is --browser-url=http://127.0.0.1:9222 – this tells the MCP server to connect to the Chrome instance we just launched, instead of trying to launch its own.
After saving the config, restart Cursor or manually reload the MCP servers from the command palette (Reload MCP Servers). You should now be able to use tools like take screenshot, navigate page, evaluate script, etc.
Launch a separate Chrome instance from Terminal:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --remote-debugging-port=9222 --user-data-dir="$HOME/temp-chrome-debug"google-chrome --remote-debugging-port=9222 --user-data-dir="/tmp/chrome-debug-profile"The Cursor config stays exactly the same across all OSes.
If you close the debug Chrome window, the MCP server will lose its connection. Just re run the command to start a fresh one. And if you ever see “port already in use”, it means you have another Chrome instance occupying 9222 either close it or change the port number in both the launch command and the Cursor config.
Getting Chrome DevTools MCP to work with Cursor IDE doesn’t have to be a headache. With a separate debug instance and a simple config tweak, you can inspect, automate, and debug your web apps right from Cursor – while keeping your personal Chrome session safe and sound.
I hope this saves you the hours I lost figuring it out. If you found it helpful, give it a like or share it with someone who’s wrestling with MCP and Chrome.
Have you tried other MCP servers with Cursor? Let me know in the comments I’m always looking for cool integrations.
Join the newsletter for practical insights on architecture, code quality, and developer workflow.
Comments
No approved comments yet.