How to add an MCP server to Codex
This guide adds three MCP servers to Codex: Playwright MCP, which runs locally, Figma MCP Server, which is hosted and connects by URL, and Firecrawl MCP Server, which runs locally and can take an API key. You will see the Codex CLI command and the config table for each one, plus how to confirm Codex loaded them. The commands come from each listing's install data, and the file locations come from Codex's own documentation.
Updated Oct 26, 2026 · Built from catalog data; how we rank and grade
Checked against Codex's documentation on Oct 26, 2026. Commands and config blocks are generated from the same install data as each listing page.
Before you start
- Codex installed and able to start.
- Node.js with npx for local servers that run through npx (check with node --version), or the runtime the server's listing names.
- An API key or account only for servers that need one; hosted servers that sign in with OAuth need an account with that service.
1. Choose a server and see what it needs
Codex can keep a server in your user config or, for a trusted project, in the project's own config, so decide which file should hold each entry before you add anything.
- Playwright MCP: runs locally, no key needed.
- Figma MCP Server: hosted, connect by URL, no key needed.
- Firecrawl MCP Server: runs locally, can take FIRECRAWL_API_KEY.
- Where Codex can keep a server: user (~/.codex/config.toml) and trusted-project (.codex/config.toml).
2. Add a local server (Playwright MCP)
The Codex CLI registers Playwright MCP in a single line, and the same entry can be written as a table in
~/.codex/config.toml. Pick whichever fits how you manage your setup.Add it with the Codex CLI codex mcp add playwright-mcp -- npx -y @playwright/mcp@0.0.82Or add this table to the config file ~/.codex/config.toml[mcp_servers.playwright-mcp] command = "npx" args = ["-y", "@playwright/mcp@0.0.82"]3. Add a remote server (Figma MCP Server)
For Figma MCP Server the CLI takes the
--urloption in place of a launch command, and the config table holds a single url key.Add it with the Codex CLI codex mcp add figma --url https://mcp.figma.com/mcpOr add this table to the config file ~/.codex/config.toml[mcp_servers.figma] url = "https://mcp.figma.com/mcp"- If the server uses OAuth, run codex mcp login with the server name.
4. Keep API keys out of the file (Firecrawl MCP Server)
Codex does not substitute variables inside its config. Instead, the Firecrawl MCP Server table names the variable to forward with
env_vars, and you export it in the shell that starts Codex.Add it with the Codex CLI codex mcp add firecrawl-mcp-server -- npx -y firecrawl-mcp@3.34.1Or add this table to the config file ~/.codex/config.toml[mcp_servers.firecrawl-mcp-server] command = "npx" args = ["-y", "firecrawl-mcp@3.34.1"] env_vars = ["FIRECRAWL_API_KEY"]Set the variable in the shell you start the host from export FIRECRAWL_API_KEY="paste-your-value-here"- Codex config has no ${VAR} interpolation. Use env_vars to forward a variable from your shell, bearer_token_env_var for a bearer token, or env_http_headers for a header taken from an environment variable.
- FIRECRAWL_API_KEY (optional): Your API key for Firecrawl.
5. Restart or reload if the server does not appear
What applies depends on whether you run Codex as the desktop app, an IDE extension or the CLI, and on whether the entry sits in a project file.
- In the desktop app select Restart after saving; in an IDE extension choose Restart extension. The docs do not say whether the CLI needs a restart after you hand-edit config.toml.
- Project .codex/config.toml files are read only when the project is marked trusted.
Check that it works
Codex can list its servers from the shell or from its terminal UI, and a server that signs in has its own login command.
codex mcp list- Run codex mcp list from the shell, or /mcp in the terminal UI. For an OAuth server run codex mcp login <name>.
Troubleshooting
- A server is slow to start or times out
- startup_timeout_sec defaults to 10 seconds and tool_timeout_sec to 60. Raise them in the server's table, or set required = true to fail fast when it cannot start. Source
- Project config seems ignored
- Codex reads .codex/config.toml only for trusted projects. Mark the project trusted or put the entry in ~/.codex/config.toml. Source
Security notes
- A local server runs with your user account's permissions and can do whatever you can on that machine; read what it does before you add it (MCP's security guidance says the same).
- A remote server receives what the agent sends it. Check who runs it and what the service does with your data.
- Codex config has no ${VAR} interpolation. Use env_vars to forward a variable from your shell, bearer_token_env_var for a bearer token, or env_http_headers for a header taken from an environment variable.
- Agent Market does not grade security yet, so a listing page shows no security grade today; read the server's source and permissions yourself (see How we grade security).
Servers and skills in this guide
Next, browse the listings that name Codex as a supported host, or open a guide for a single tool.
- 1Playwright MCP
microsoftOfficial
Playwright Tools.
★ 38.6KLast active Oct 22, 2026Local (stdio)Claude Code, Codex, VS Code, Cursor +2
AFreshness: A–Security: not graded yet - 2Figma MCP Server
mcp.figma.comOfficial
The Figma MCP server brings Figma design context directly into your AI workflow.
★ 2.1KLast active Oct 20, 2026Remote (HTTP)Claude Code, VS Code, Cursor, Windsurf
AFreshness: A–Security: not graded yet - 3Firecrawl MCP Server
firecrawlOfficial
Firecrawl, the context API for AI agents: search, scrape, interact with the web, plus paper search.
★ 7.7KLast active Oct 23, 2026Local (stdio), Remote (HTTP)Claude Code, VS Code, Codex, Cursor +2
AFreshness: A–Security: not graded yet
Related
- Install guideHow to install Agent Skills in Codex
- Host guideMCP servers for Codex
- Host guideAdd-ons for Codex
- Install guideHow to add an MCP server to Claude Code
- Install guideHow to add an MCP server to Cursor
- Install guideHow to add an MCP server to VS Code
- Install guideRemote vs local MCP servers: how to choose
Sources
- Model Context Protocol | ChatGPT Learn · fetched Oct 26, 2026
- Configuration Reference | ChatGPT Learn · fetched Oct 26, 2026
- Developer commands · fetched Oct 26, 2026
Cite this page
How to add an MCP server to Codex. Agent Mart. https://agentmart.dev/guides/add-mcp-server-codex (last updated 2026-10-26)