# Codex browser: what works in the CLI and IDE

> OpenAI's built-in Browser runs in ChatGPT, not in the Codex CLI or IDE extension. How to give Codex a browser there with an MCP server in config.toml, and which one to pick.

Canonical: https://dejo.run/blog/codex-browser
Last updated: 2026-11-13

> For AI agents: the index of this site is https://dejo.run/llms.txt, and every page is also served as markdown (add .md to its address, or send Accept: text/markdown).

I build Dejo, one of the browser servers below, so weigh the last part with that in mind. The facts about Codex come from OpenAI's own docs, read on 13 November 2026.

**Short answer:** OpenAI's built-in Browser works in ChatGPT on the web and in the ChatGPT desktop app, not in the Codex CLI or the IDE extension. In OpenAI's words: "Browser isn't available in Codex CLI or the Codex IDE extension. Open the ChatGPT desktop app to use the built-in browser." To give Codex a browser in the terminal or your editor, add a browser MCP server to `~/.codex/config.toml`.

## Where Codex can use a browser

From OpenAI's [Browser docs](https://learn.chatgpt.com/docs/browser):

| where you use Codex | browser |
|---|---|
| ChatGPT on the web, ChatGPT desktop app | the built-in Browser: opens websites, gathers current information, acts while you watch |
| Codex Cloud tasks | a browser inside the cloud task, to inspect your web app, reproduce a bug or check a fix |
| Codex CLI, Codex IDE extension | none built in; add a browser MCP server |

The same docs give one safety rule worth keeping whichever browser you use: treat page content as untrusted, and review the site and the proposed action before sharing anything sensitive.

## Add a browser to Codex CLI in a minute

Codex reads MCP servers from `~/.codex/config.toml`. Either run `codex mcp add`, or write the table yourself.

**Dejo** (remembers each task, Python 3.11+):

```bash
pip install dejo-mcp
playwright install chromium
codex mcp add dejo -- dejo-mcp
```

or in `~/.codex/config.toml`:

```toml
[mcp_servers.dejo]
command = "dejo-mcp"
```

**Playwright MCP** (Microsoft's, Node):

```toml
[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]
```

Check with `codex mcp list`, and inside Codex with `/mcp`. Codex waits 10 seconds for a server to start unless you set `startup_timeout_sec`. The [MCP config generator](https://dejo.run/tools/mcp-config-generator) writes the block for any server.


## Which one to add

- **Reading one page now and then:** Playwright MCP is fine. Each session starts from nothing, which doesn't matter for one-offs.
- **The same website task again and again** (a dashboard number, a report download, an admin form): a browser that remembers the task. With Dejo, the first run learns the route and every run after is one `dejo_run` call that walks it in plain code, with no model calls inside Dejo.
- **Your app, while you build it:** the built-in Browser in the ChatGPT desktop app, or a Codex Cloud task with browser access, sees what you're working on.

We measured the repeat cost in Claude Code rather than Codex: on 19 real-website tasks, repeat runs with Dejo averaged 89K tokens against 409K per run with Playwright MCP. The method is on [the benchmark page](https://dejo.run/benchmark); we haven't run the same test in Codex yet.

## Signing in

Sites behind a login need a session the browser keeps. With Dejo, Codex calls `dejo_login`, a window opens, you sign in yourself, and the session stays in Dejo's profile; details in [keep your AI agent signed in](https://dejo.run/docs/sign-in). With Playwright MCP, see [Playwright MCP login](https://dejo.run/blog/playwright-mcp-login).

The full Codex setup page, with timeouts and settings: [browser automation in Codex](https://dejo.run/docs/codex).

Related reading: [Playwright MCP login](https://dejo.run/blog/playwright-mcp-login), [why Playwright MCP uses so many tokens](https://dejo.run/blog/why-playwright-mcp-uses-so-many-tokens) and [Dejo vs agent-browser](https://dejo.run/compare/agent-browser).

## FAQ

## FAQ

### Does Codex have a browser?

Not in the Codex CLI or the Codex IDE extension. OpenAI's docs say: "Browser isn't available in Codex CLI or the Codex IDE extension. Open the ChatGPT desktop app to use the built-in browser." Codex Cloud tasks can use a browser to inspect a web app. In the CLI and IDE you add a browser as an MCP server.

### How do I give Codex CLI a browser?

Add a browser MCP server. For Dejo: pip install dejo-mcp, playwright install chromium, then codex mcp add dejo -- dejo-mcp, or a [mcp_servers.dejo] table in ~/.codex/config.toml with command = "dejo-mcp". Playwright MCP works the same way with npx @playwright/mcp@latest.

### Which browser MCP is best for Codex?

For one-off pages, Playwright MCP is fine. For website tasks Codex will repeat, a server that remembers the task, such as Dejo, makes the next run one tool call instead of a full exploration. In our Claude Code benchmark, repeat runs with Dejo averaged 89K tokens against 409K with Playwright MCP.

## Related

- [Playwright MCP login: keep your agent signed in](https://dejo.run/blog/playwright-mcp-login)
- [Browser agent token statistics (2026, measured)](https://dejo.run/blog/browser-agent-token-statistics)
- [Why Playwright MCP uses so many tokens](https://dejo.run/blog/why-playwright-mcp-uses-so-many-tokens)
- [Dejo MCP server setup: install in a minute](https://dejo.run/docs)
