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.
Related: How to list Codex MCP servers
Related: How to add an MCP server URL in Codex
Steps to remove a Codex MCP server:
- Open a terminal in the environment where Codex is configured.
- 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
- 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.
- 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.
- 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
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
