Reusing an Existing Browser with the chrome-devtools MCP Server
When you install and use chrome-devtools mcp, a new browser opens. This can sometimes get it recognized and blocked as a bot, or, for services that require you
GGAMI·
When you install and use chrome-devtools mcp, a new browser opens. This can sometimes get it recognized and blocked as a bot, or, for services that require you to log in during development, cookies may not be retained. Since even the login process becomes complicated, it's often difficult to test and develop properly.
I saw a post on another site where they opened a debug port in the existing browser to allow connections, so I decided to do that too.
However, this could pose a security risk, though it seems somewhat okay since you're launching Chrome Dev.app in the first place.
The browser is now set up to launch with a debug port.
But there's a funny thing about macOS: if you don't set --user-data-dir=/tmp/atlas-mcp and run it with the default profile, debug mode will never activate... (I spent hours struggling with this because I didn't know; I don't think it was like that on Windows ㅡㅡ)
Finally, you just need to change the argument values in codex config.toml.
You should set a few other options along with the browser-url option.
After that, when you ask codex cli to open the page in a browser, it connects using the already-open debug chrome dev profile. So if you're already logged in to the page you're working on there, it opens with you still logged in, allowing you to find and fix problems through the cli without any issues.
This could be a security concern, but as far as I know, the debug port can't be connected to from outside. It can only be accessed from the internal network (locally). (At least, that was the case on Windows.)
So I don't think it'll be a major problem, but just in case, it's probably best to be aware that there may be security risks and issues. Alternatively, installing Chrome Dev or Chrome Beta separately and setting it to launch with a separate profile might be somewhat safer.