Skip to content

Codex browser MCP: use your logged-in Chrome from OpenAI Codex

Connect Codex to your signed-in Chrome: desktop app, CLI and IDE setup, email verification, pairing, Windows instructions and troubleshooting.

Mehmood Ur Rehman Qureshi12 min readGuide

Codex can use MCP Browser Extension to work in the Chrome you already use, with your sessions and logins. This guide covers setup in the desktop app, terminal and IDE extension, installing the Chrome extension, verifying your email, pairing and a first browser task.

What you get

MCP Browser Extension has two halves. A stdio MCP server, started by Codex, and a Manifest V3 extension that runs inside your normal Chrome. The extension dials into the server over localhost and carries out the tool calls: open tabs, read pages, take an accessibility snapshot, click and type.

MCP Browser Extension workflow: open three background tabs, then read each page as markdown with its explicit tab ID.
Workflow example: open several tabs in one batch, then read their pages in parallel. Every call keeps its own permission checks.

Because it drives your real Chrome, Codex sees what you see. If you are signed in to GitHub or an analytics dashboard, so is Codex, with no password in its context. It is not the only tool that works this way; the comparison page and logged-in Chrome page cover the alternatives. What it adds is a deny-all default: with no flags, Codex can read nothing.

What we verified about Codex MCP config

The configuration and app steps below were checked against OpenAI's MCP documentation on 20 October 2026. They apply to local Codex clients:

  • Codex reads MCP servers from ~/.codex/config.toml, one [mcp_servers.<server-name>] table per server.
  • A stdio server uses command, args, and optionally env and cwd.
  • Optional keys include startup_timeout_sec (default 10), tool_timeout_sec (default 60), enabled, enabled_tools and disabled_tools.
  • codex mcp add <server-name> -- <command> writes the entry for you, and codex mcp list shows what is configured.
  • Inside the Codex TUI, /mcp lists active servers.
  • Servers can also be scoped to a project in .codex/config.toml, for trusted projects only.
  • The Codex CLI, the IDE extension and the ChatGPT desktop app share this configuration.

Codex changes quickly. If a key below is rejected, check those docs first.

Requirements

  • Node 20 or newer (node --version).
  • Chrome 116 or newer.
  • A signed-in Codex desktop app, CLI or IDE extension with access to the computer running Chrome.

No browser is downloaded. The server drives the Chrome you already have.

Step 1: add the server to Codex

Decide which sites Codex should be able to reach. Each one gets an --allow-domain flag. Add --enable-mutations if Codex should click, type and navigate. --persist-token keeps the same token across restarts; pairing survives without it, but it does no harm.

Choose one setup method. They configure the same server; you do not need to follow all of them. If you already installed a plugin that provides MCP Browser Extension, check its existing connection before adding a manual entry.

Option A: desktop app

  1. In the desktop app running Codex, go to Settings, then MCP servers.
  2. Use Add server and choose STDIO for a server running on this computer.
  3. Enter these values, replacing example.com with the site you want Codex to use:
FieldValue
Namemcp-browser-extension
Commandnpx
Arguments-y mcp-browser-extension@latest --allow-domain example.com --enable-mutations --persist-token
  1. Save the entry, then select Restart. If the app presents arguments as separate items, add one item per space-separated value shown above.
  2. In the composer, use /mcp to check the connection. Continue with the extension and verification steps below; a saved server entry does not mean Chrome is ready yet.

On Windows, use cmd as the command and put /c npx before the arguments above. The complete TOML example is in the Windows section.

Option B: Codex CLI

codex mcp add mcp-browser-extension -- \
  npx -y mcp-browser-extension@latest \
  --allow-domain example.com --enable-mutations --persist-token

Everything after -- is the server's own command line. Keep the --, or Codex tries to read --allow-domain as one of its own options. Then confirm:

codex mcp list

After adding the entry, start a fresh Codex CLI session and use /mcp to see whether the server starts. Do not use Claude Code's -s user option in the Codex command.

Option C: Codex IDE extension

These steps are for the Codex extension in VS Code or a compatible editor. VS Code Copilot uses a separate configuration.

  1. Open the gear menu in the Codex sidebar and choose MCP servers.
  2. Select Add server, choose STDIO, and enter the same name, command and arguments from the desktop table above.
  3. Save, then choose Restart extension so it loads the server.
  4. Open a Codex chat and ask it to call chrome_status. Follow the installation and verification steps below if this is your first connection.

If you configured this server through the CLI on the same Codex host, check the existing entry instead of adding another. For remote editors or WSL, verify which machine runs the MCP process; its localhost must reach the intended Chrome bridge.

Option D: edit config.toml

Open ~/.codex/config.toml and merge this table. If it already exists, update its values rather than pasting a second copy:

[mcp_servers.mcp-browser-extension]
command = "npx"
args = [
  "-y", "mcp-browser-extension@latest",
  "--allow-domain", "example.com",
  "--enable-mutations",
  "--persist-token",
]
startup_timeout_sec = 30

Save and restart the client. The optional startup_timeout_sec = 30 gives the first package download more time than Codex's 10-second default. This file uses TOML; the mcpServers JSON examples for other clients do not belong here.

Windows

On Windows npx is npx.cmd, a batch shim, and MCP hosts spawn servers without a shell. Wrap the command in cmd /c:

[mcp_servers.mcp-browser-extension]
command = "cmd"
args = [
  "/c", "npx", "-y", "mcp-browser-extension@latest",
  "--allow-domain", "example.com",
  "--enable-mutations",
  "--persist-token",
]

Save the file under %USERPROFILE%\.codex\config.toml and restart the client. From PowerShell, the equivalent command is:

codex mcp add mcp-browser-extension -- cmd /c npx -y mcp-browser-extension@latest --allow-domain example.com --enable-mutations --persist-token

This example runs on native Windows; WSL2 is not required. A Codex process inside WSL has its own Linux environment and configuration.

Local and cloud sessions

These instructions start a process on the computer running your Codex host. Chrome, the extension and that process must be able to connect. An unrelated cloud task does not automatically gain access to your laptop's browser or local MCP configuration. See OpenAI's connection guidance before switching environments; test chrome_status in the environment that will run the task.

Step 2: load the extension

The extension is required. Without it, no tool can run. Install MCP Browser Extension from the Chrome Web Store. No Developer mode, and Chrome keeps it updated automatically. The store build is reviewed before each release, so it can trail the npm package by a version.

If you are working on the extension itself, you can load the folder that ships inside the npm package instead. npx -y mcp-browser-extension@latest --extension-path prints its path (~/mcp-browser-extension, or %USERPROFILE%\mcp-browser-extension on Windows). That copy pairs itself from a pairing.json file the server writes there, but it does not update through Chrome.

Step 3: verify your email

Start a fresh Codex session after saving the server configuration, then ask:

Call chrome_status and help me finish connecting MCP Browser Extension.

On the first browser tool call, enter your email in the MCP prompt. Open the sign-in link sent to that address and click Verify this device. Opening the email link alone is not enough. The waiting tool reports Email verified and continues.

If Codex cannot show the prompt, it is dismissed, or a bypass mode suppresses it, the server automatically opens a temporary local verification form in Chrome. Enter your email there. The tool also returns ACCESS_INPUT_REQUIRED with the form's address as a backup. Use the existing form; do not ask the agent to fill it or read your inbox. The form expires after 10 minutes.

If the tool returns ACCESS_PENDING, ask Codex to call chrome_status again. It keeps waiting for the same link; there is no code to copy and no need to request another email. Bypass mode does not skip verification.

Verification is enabled by default. The optional local-only opt-out and its limits are documented in the Quickstart. Installing the extension or seeing a green connection badge does not replace this access check.

Step 4: pair Chrome

Start a Codex session so it launches the server at least once. On every start the server registers a small native messaging helper with Chrome, which only this extension can reach.

Chrome hides new extensions behind the puzzle-piece button, so pin MCP Browser Extension first. If chrome_status says no browser is paired, click its toolbar icon and press Connect. The first time, Chrome asks for permission to communicate with cooperating native applications. Allow it, and the extension fetches the port and token from the server by itself. There is nothing to copy or paste. A fresh install also opens the extension's Settings page with the same button. If Chrome is already connected, continue without pairing again.

If the server later changes its token, the extension fetches the new one on its own. The popup also shows the connection status, whether the current site is allowed (with an Allow button), recently blocked sites and your allowed sites.

MCP Browser Extension Settings with example connection values: a Connect button at the top, then the port and token fields, the outline toggle, the connection status, and the allowed sites list with a recently blocked site offering Allow.

Settings example captured on 15 October 2026 with sample data. Connect sits at the top; the port and token fields below it are for the manual fallback.

The badge on the toolbar icon tells you where things stand.

BadgeMeaning
green dotpaired and connected
yellow dotsconnecting
grey circlenot paired yet
red exclamation marktoken rejected; fetches the new token and re-pairs by itself

If Connect reports a problem, or the server runs with --no-native-host, run npx -y mcp-browser-extension@latest --print-pairing, open the extension's Settings, and paste the port and token from ~/.mcp-browser-extension/handshake.json. The agent setup guide walks through this fallback step by step.

Step 5: choose the allowlist

The server is deny-all by default: no domains, no clicks, no eval, no downloads, no uploads. You open exactly what a task needs.

  • --allow-domain github.com opens one host. *.example.com covers a domain and its subdomains. The flag is repeatable.
  • --enable-mutations allows clicking, typing and navigation.
  • --enable-downloads, --enable-uploads and --unsafe-enable-eval are separate opt-ins.
  • --redact scrubs JWTs, API keys and bearer tokens out of page reads. Password field values are never returned, with or without it.
  • --unsafe-all-domains removes the allowlist. It is named that way on purpose.

Page text is untrusted input to the model. A page can carry instructions meant to redirect the agent. A short allowlist limits where a redirected agent can go. Every call is logged to the task's history.jsonl with the URL, the allow or deny verdict, duration and bytes. See security for the full model.

Trim the tool list

To expose a smaller browser toolkit, the server's --tools flag advertises only the tools you name and refuses the rest. Keep chrome_status so Codex can check verification and pairing. Update the existing server's arguments with this flag; do not add a duplicate entry:

--tools chrome_status,tabs_list,tab_new,navigate,snapshot,click,type,get_text

Codex's own enabled_tools key filters on the client side as well. The server flag is the stronger of the two because hidden tools are also refused if called. The full catalog is in the tools reference.

Step 6: a first task

Start Codex and check the connection first:

MCP Browser Extension task folder example with screenshots, results and the history.jsonl action log.
Task folder example: screenshots, page results and a timed action log stay together. The folder name is illustrative.
Call chrome_status, then tabs_list, and tell me what you see.

Complete any verification prompt first. Then chrome_status should report the extension backend as connected, and tabs_list should return tabs from your real Chrome.

Then a real task on an allowed domain. The setup above allows example.com; to use this GitHub example, first add --allow-domain github.com to the existing server's arguments and restart the client:

Open https://github.com/<your-org>/<your-repo>/pulls in a new background tab,
take a snapshot, and list each open pull request with its author and age.

Codex will call tab_new, then snapshot or get_text, and summarise. The snapshot returns interactive elements with stable ref ids, so later clicks target a ref instead of a guessed CSS selector.

Finally, prove the deny-all works:

Navigate to https://news.ycombinator.com and read the front page.

If that domain is not on your allowlist, the call is refused with a policy error. That refusal matters more than the happy path.

For multi-tab work, the batch tool runs many calls in one request, in parallel or serial. The guides show it, along with iframes, snapshot diffs and auth walls.

For a recorded example, see Check a website before release with Codex and Chrome. It checks the install tab and setup instructions in a real Chrome preview.

Troubleshooting: Codex browser not working

Codex is waiting for email verification

For ACCESS_INPUT_REQUIRED, use the local form the server opened. For ACCESS_PENDING, open the email link, click Verify this device, then call chrome_status again. Do not start a second email request while the first form is active. If the local form expired, a fresh tool call can create another.

If Codex times out while you are completing verification, finish the verification and retry chrome_status. For longer interactive waits, set tool_timeout_sec = 180 in the existing server's TOML table and restart Codex. This changes the tool-call timeout, not the server's startup timeout.

The server is listed but browser tools are missing

codex mcp list confirms a saved configuration. Open a fresh CLI session and check /mcp, or use Restart in the desktop app / Restart extension in the IDE after saving. Check for an existing disabled entry or an enabled_tools, disabled_tools or --tools filter that hides the tool you need. Avoid configuring the same extension twice through a plugin and a manual server entry.

Codex says the server failed to start

Run the command by hand to see the real error:

npx -y mcp-browser-extension@latest --extension-path

If it works by hand but Codex times out, raise startup_timeout_sec. On Windows, check that the command is cmd with /c first.

chrome_status shows the extension disconnected

The server is running but the extension is not paired. Check the badge. If it is grey, click the toolbar icon and press Connect, or use the manual pairing fallback if Connect reports a problem.

Pairing breaks after every restart

The server mints a fresh token on each boot unless you pass --persist-token, but the extension now fetches the new one by itself. If it still drops, check that the server is not running with --no-native-host, and press Connect in the popup again.

A page you expected to work is refused

The domain is not on the allowlist, or it is an iframe from another origin. Frames are checked against their own URL. Add the domain explicitly.

The agent stalls on a login page

Your session expired. auth_check reports a sign-in wall, and --fail-on-auth-wall turns it into an [AUTH_REQUIRED] error. Sign in again in Chrome and retry. The server holds no credentials and never signs in for you.

Several Codex sessions at once

Each session starts its own server. The first owns the bridge port and later ones join it as peers, so they all share your Chrome. Give each session its own tabs with tab_new so they do not step on each other.

Other hosts

The same server works in Claude Code, Claude Desktop, Cursor, VS Code and Windsurf with the same flags. See the Cursor guide, the Claude Code guide and the VS Code Copilot guide, or the quickstart for every config.

FAQ

Does OpenAI Codex support MCP servers?

Yes. Codex reads stdio MCP servers from [mcp_servers.<name>] tables in ~/.codex/config.toml, and codex mcp add writes them for you. The CLI, IDE extension and ChatGPT desktop app share that config.

Can Codex use my logged-in Chrome?

Yes, through an MCP server with a Chrome extension, such as MCP Browser Extension. Codex works in tabs where you are already signed in, limited to the domains you allow.

Does MCP Browser Extension in Codex need Developer mode?

Only if you load the extension from its folder. Installing MCP Browser Extension from the Chrome Web Store needs no Developer mode.

Which sites can Codex reach?

Only the hosts you pass with --allow-domain. Everything else is refused before the call reaches the page.

Does it work in the Codex IDE extension too?

According to OpenAI's docs, the IDE extension shares the CLI's config.toml, so a server added once is available in both.

Why does Codex ask me to verify my email?

MCP Browser Extension checks access on the first browser tool call by default. Enter your email in the MCP prompt or the local browser form, then click Verify this device in the email link. This is separate from signing in to Codex or connecting the extension to Chrome.

Set it up in a few minutes

One command for the server, one click for the extension.