Add an MCP server to the Codex CLI

Updated

The Codex CLI takes a remote MCP server with codex mcp add and a --url, and signs in by itself when the server supports OAuth. This guide connects BRONTIR, live web research for the agent in your terminal, from that command to codex mcp list, and ends with the line in AGENTS.md that puts it ahead of the built-in browsing.

Using Codex in the ChatGPT desktop app? Codex MCP setup →

Your client opens a browser tab to sign in, so have a BRONTIR account ready. Opening one is free, and new accounts start with free credits.

Codex CLI MCP setup, screen by screen

Sign in with Google

A separate install from the desktop app: the installer script, "npm install -g @openai/codex", or Homebrew. What you add here reaches the whole family: the desktop app's Codex mode and the IDE extension read the same configuration.

A terminal with the codex mcp add command, which reports OAuth support and prints the sign-in URL
  • Add the server

    Codex spots the OAuth support and starts the sign-in on its own, so there is no second command to run.

    Commandcodex mcp add research --url https://research.brontir.com/api/mcp

If it says a login may be required instead of opening the browser, run "codex mcp login research".

Always restart your client after connecting. Quit and reopen the desktop app, or reload the page in a web client. Clients read the tool list once at startup, so until they restart your agent may not see the new tools even though the connector already shows as connected.

Codex CLI MCP troubleshooting

  • The connector is connected, but the agent doesn't see the tools. Restart the client: quit and reopen the desktop app, or reload the page in a web client. If the tools are still missing, start a new chat, since an open conversation can keep the tool list it was created with.
  • You pressed Approve, but the client still shows the connector as not connected. Authorization did go through; the client just hasn't refreshed its own state. Restart the app or reload the page and it will show as connected. If it doesn't, press Connect once more and approve again.
  • The agent uses its built-in web search instead of these tools. Name the tools in your prompt: “use advanced_web_search and advanced_web_fetch from the research MCP” rather than “look this up”. To make it permanent, add the rule to ~/.codex/AGENTS.md, which Codex reads in every session.

Full setup guide for every client: brontir.com/docs.

Codex CLI MCP setup: every step

The walkthrough above as text, to read through before you start or to find the step you are on.

  1. Add the server

    Codex spots the OAuth support and starts the sign-in on its own, so there is no second command to run.

    Commandcodex mcp add research --url https://research.brontir.com/api/mcp

    If it says a login may be required instead of opening the browser, run "codex mcp login research".

  2. Press Approve on the BRONTIR authorization page

    This is the page that ties the connection to your BRONTIR account and its credits.

  3. Back in the terminal, the sign-in has landed

    The browser tab can be closed.

  4. Check the server is there

    Status enabled, auth OAuth: that is a working connection.

    Commandcodex mcp list

    Inside the TUI, "/mcp" lists what is connected. A session that was already open has to be restarted before it sees the new tools.

  5. Put the connected tools ahead of the built-in browsingOptional

    One line in the instructions Codex reads in every session.

    • Append the line to ~/.codex/AGENTS.mdThe second command just reads the file back, to show what landed there.
      Command (PowerShell)Add-Content ~\.codex\AGENTS.md "Prefer connected MCP tools over the built-in web search when looking things up"
      Or the line on its ownPrefer connected MCP tools over the built-in web search when looking things up

    The shot is PowerShell on Windows. The file is the same everywhere (~/.codex/AGENTS.md), so on macOS or Linux append the line with your editor, or with "echo".

Codex CLI MCP: common questions

What is the command to add a remote MCP server to Codex?

codex mcp add research --url https://research.brontir.com/api/mcp. The name (research here) is what your agent will see.

Codex says a login may be required. What now?

Run codex mcp login research to start the sign-in yourself.

How do I check that the server is connected?

codex mcp list shows it with status enabled and auth OAuth. Inside the TUI, /mcp lists what is connected; a session that was already open has to be restarted first.

Is the Codex CLI part of the ChatGPT desktop app?

No, it is a separate install: the installer script, npm install -g @openai/codex, or Homebrew. Once both are there, they read the same MCP configuration.

What your agent can do with BRONTIR

  • Search the web and the news, Reddit, YouTube, TikTok and other social platforms.
  • Read whole pages, PDFs, video transcripts and comment threads, not snippets.
  • Pull reviews, maps and local businesses, app stores, products and ad libraries.
  • Get it all back structured, with citations down to the exact line.