client setup · updated August 2026

Add MCP servers to Codex CLI

Codex CLI configures MCP servers in TOML rather than JSON: one table per server in its config file.

The config Codex CLI expects

Lives in: ~/.codex/config.toml, one [mcp_servers.name] table per server

One entry per server, under the top-level mcp_servers key:

[mcp_servers.your-server]
command = "npx"
args = ["-y", "the-server-package"]

Swap the placeholder for a real server: every server page on this site renders the exact block, ready to paste.

Official setup guide: Codex CLI documentation ↗

Five proven servers to start with

The highest-ranked servers we track; each page carries the paste-ready config.

Prefer running nothing locally? Start from a hosted endpoint instead: the best remote MCP servers.

Quick answers

Where does Codex CLI keep its MCP configuration?

In ~/.codex/config.toml, one [mcp_servers.name] table per server. The official documentation covers edge cases and the newest options.

Do all MCP servers work with Codex CLI?

Any server speaking standard MCP transports should work: local servers run as a process your client starts, remote servers are a URL you point it at. Each server page on this site shows its exact config, and states when a server needs credentials first.

About this page

Client mechanics come from each client's public documentation, linked above; anything we are not certain of defers to those docs rather than guessing. Server rankings are ours: monthly installs, GitHub stars, and commit recency, recomputed nightly. How we verify.