Как добавить MCP servers в Codex
Codex is OpenAI's coding agent, with a CLI, a desktop app and an IDE extension that share one configuration. MCP servers live in config.toml under [mcp_servers.<name>].
Добавление MCP server в Codex
- 1Open
~/.codex/config.toml; the CLI and the IDE extension share it. - 2Paste the
[mcp_servers.name]table from the server page. - 3Put secrets in the
[mcp_servers.name.env]table. - 4Start Codex and run
/mcpto list the active servers.
Пример: Codebase Memory
[mcp_servers.codebase-memory-mcp]
command = "npx"
args = ["-y", "codebase-memory-mcp"]One config for the CLI, app and IDE
- The CLI, desktop app and IDE extension read the same
config.toml, so a server added once shows up everywhere. default_tools_approval_modesets per server whether tools run automatically, ask first, or ask only for writes.required = truestops Codex from starting without a server you depend on.- Remote servers can take a bearer token from an environment variable with
bearer_token_env_var.
Где Codex хранит MCP servers
~/.codex/config.tomluser.codex/config.tomltrusted project
Проверить загрузку: codex mcp list
Ограничения и настройки
- Servers have 10 seconds to start (
startup_timeout_sec) and 60 seconds per tool call (tool_timeout_sec) by default. enabled_toolsanddisabled_toolslimit which tools Codex sees.- A project
.codex/config.tomlis read only for trusted projects. required = truemakes Codex fail to start if that server cannot start.
Если сервер не работает в Codex
- Run
codex mcp listto see configured servers. - For OAuth servers, run
codex mcp login <name>or choose Authenticate in the app. - Raise
startup_timeout_secfor servers that download packages on first run.
Вопросы о MCP в Codex
How do I add an MCP server to Codex?
Run codex mcp add <name> -- <command>, or add a [mcp_servers.<name>] table to ~/.codex/config.toml. HostedMCP server pages give the TOML.
Does Codex support remote MCP servers?
Yes, over Streamable HTTP with OAuth or a bearer token taken from an environment variable.
Where is the Codex config file?
~/.codex/config.toml for your user, and .codex/config.toml in a trusted project.
Can I approve tool calls automatically?
Yes. default_tools_approval_mode can be set per server to auto, prompt, writes or approve.
Популярные MCP server для Codex
- 1
Provides a local knowledge graph that connects source code, documentation, and infrastructure to give AI agents structural context.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.codebase-memory-mcp] command = "npx" args = ["-y", "codebase-memory-mcp"] - 2
Securely execute LLM-generated code in isolated containers or local Linux and Windows sandboxes across multiple programming languages.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.llm-sandbox] command = "uvx" args = ["llm-sandbox"] - 3
Lets an AI client create, inspect, validate, and save editable 3D building scenes, including walls, rooms, doors, and furnishings.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.editor] command = "npx" args = ["-y", "@pascal-app/mcp"] - 4
Lets AI agents search, run, and read results from thousands of web scraping and automation Actors on Apify Store.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.apify-mcp-server] url = "https://mcp.apify.com/" - 5
Provides AST-based semantic code search for local repositories using incremental re-indexing and natural language queries.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.cocoindex-code] command = "uvx" args = ["cocoindex-code"] - 6
Lets an AI client read and change Google Ads, Reddit Ads and GA4 campaigns, with a preview shown before every change.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.adloop] command = "uvx" args = ["adloop"] - 7
An agent meta-harness that provides Claude Code and Codex with specialized agent swarms, self-learning memory, and enterprise security guardrails.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.claude-flow] command = "npx" args = ["-y", "claude-flow"] - 8
Enables LLMs to interact with web pages through structured accessibility snapshots using Playwright browser automation.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.playwright-mcp] command = "npx" args = ["-y", "@playwright/mcp"] - 9
Allows an AI client to interact with Bitbucket Data Center repositories and code through the Model Context Protocol.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.atlassian-dc-mcp] command = "npx" args = ["-y", "@atlassian-dc-mcp/bitbucket"] - 10
Lets an AI agent draw and edit draw.io diagrams on a live browser canvas that you can also edit by hand.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.next-ai-drawio] command = "npx" args = ["-y", "@next-ai-drawio/mcp-server"] - 11
Packs a local or remote codebase into a single AI-friendly file with token counts so LLMs and coding agents can read or search it.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.repomix] command = "npx" args = ["-y", "repomix"] - 12
Connects AI agents and IDEs to enterprise databases using prebuilt tools or a custom framework for secure, structured queries.
Конфиг для Codex
~/.codex/config.toml[mcp_servers.mcp-toolbox] command = "docker" args = ["run", "-i", "--rm", "us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:1.17.0"]