Removing an MCP server entry prevents Codex from attempting to start, connect to, or offer an integration that is no longer used. Cleaning up stale entries reduces confusion when selecting servers and avoids repeated failures caused by missing binaries, moved endpoints, or retired credentials.

Codex stores Model Context Protocol (MCP) server definitions in /~/.codex/config.toml and references them by a short server name. Each entry typically includes the command used to launch the server, its arguments, and optional environment or working directory settings that Codex uses when invoking it.

Removing a server entry only changes the local Codex configuration and does not terminate any already-running MCP server process. If you want to keep the configuration but disable it, set enabled = false in config.toml instead of deleting the entry.

Steps to remove a Codex MCP server:

  1. Open a terminal in the environment where Codex is configured.
  2. List configured MCP servers to identify the exact entry name.
    $ codex mcp list
    Name             Command  Args                        Env  Cwd  Status   Auth
    chrome-devtools  npx      chrome-devtools-mcp@latest  -    -    enabled  Unsupported
    
    Name            Url                    Bearer Token Env Var  Status   Auth
    analytics       http://127.0.0.1:9010  -                     enabled  Unsupported
    playwright-mcp  http://127.0.0.1:8931  -                     enabled  Unsupported
  3. Save the server configuration if you need a rollback reference.
    $ codex mcp get analytics --json > analytics-mcp.json

    Keep the backup in a private location if it contains internal URLs or arguments.

  4. Remove the MCP server entry by name.
    $ codex mcp remove analytics

    Removing an entry deletes its configuration from Codex, so any session or automation referencing that server name will no longer resolve it.

    Removing the entry does not stop a running MCP server process.

  5. List MCP servers again to confirm the entry is removed.
    $ codex mcp list
    Name             Command  Args                        Env  Cwd  Status   Auth
    chrome-devtools  npx      chrome-devtools-mcp@latest  -    -    enabled  Unsupported
    
    Name            Url                    Bearer Token Env Var  Status   Auth
    playwright-mcp  http://127.0.0.1:8931  -                     enabled  Unsupported