OpenAI Codexcodex-cli 0.154 · macOS, Linux, WSL, Windows
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
26 small wins to finish your pathNext lesson

MCP servers

The built-in tools cover your files and your shell. MCP is how everything else gets in: a database, a ticket tracker, an internal service.

An MCP server is a separate program that exposes tools. You register it once and its tools join the list Codex can use.

bash
codex mcp add sqlite -- npx -y @modelcontextprotocol/server-sqlite --db-path ./links.db
Captured from a real run
Added global MCP server 'sqlite'.

Everything after the double dash is the command that starts the server. That is a real run, and here is the configuration it wrote:

toml
[mcp_servers.sqlite]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-sqlite", "--db-path", "./links.db"]

Which means you can also write it by hand, and commit a project's servers in .codex/config.toml so a colleague gets the same tools by cloning.

Checking what is connected

bash
codex mcp list
Captured from a real run
Name    Command  Args                                                         Status   Auth
sqlite  npx      -y @modelcontextprotocol/server-sqlite --db-path ./links.db  enabled  Unsupported

Name, how it starts, whether it is enabled, and whether it supports authentication. When a tool you expected is missing, this is the first place to look.

bash
codex mcp list
Captured from a real run
No MCP servers configured yet. Try `codex mcp add my-tool -- my-command`.

And that is the same command after removing it again, which is what a clean machine looks like.

Remote servers

A server does not have to be a local command. --url registers a remote one, with OAuth details where the service needs them, which is how hosted tools are added without running anything yourself.

Tool lists are not free
Every server you add describes its tools to the model, so a long list costs you on every turn. Add the ones you reach for, not the ones that look interesting.
Try it yourself
  • Add a server for something you use daily, then run codex mcp list.
  • Move it from your user config into a project config and see who gets it.
PreviousPlugins

Little by little, you're building something great.