Codex: add Chrome DevTools MCP via config.toml

Register the Chrome DevTools MCP server in Codex by adding the TOML block to ~/.codex/config.toml and restarting Codex.

[mcp_servers."chrome-devtools"]
command = "npx"
args = ["chrome-devtools-mcp@latest"]
Operating Systems
cross-platform
Prerequisites
Codex CLI or IDE extension installedNode.js/npm available for npxAccess to ~/.codex/config.toml
Last Tested

1/10/2025

Tags
mcpchrome-devtoolstomlcodexautomation
Details

What this does

Codex looks for Model Context Protocol servers in ~/.codex/config.toml. Adding the Chrome DevTools block lets Codex launch a dedicated Chrome instance with the correct debugging flags whenever a DevTools task runs.

Steps

  1. Ensure ~/.codex/config.toml exists (create the directory/file if needed).
  2. Append the Chrome DevTools MCP block shown above.
  3. Restart Codex so the new server definition is loaded.

Verification

After Codex restarts, ask it to run a browser task such as:

Check the LCP of https://web.dev

Codex should spawn a Chrome window controlled through MCP and return a response. You can also target a local project:

Open http://localhost:3000 and report console errors

Variations

  • To add more MCP servers, repeat the pattern with another [mcp_servers."name"] block.
  • If the Chrome window fails to launch automatically, manually start Chrome with --remote-debugging-port=9222 and rerun the command.
Safety Notes
  • Non-destructive: only edits your Codex configuration file.
  • Expect a separate Chrome profile window when the MCP server starts.