Skip to content

unknown configuration field `mcp_servers.context7.type`: Codex

Quick fix

Remove the type field from the Codex MCP configuration; an unfixed cc-switch will write it back during the next sync.

Error output
unknown configuration field `mcp_servers.context7.type`

cc-switch 3.20.3 through 3.20.4 writes `type = "stdio"` or `type = "http"` in Codex `[mcp_servers.*]` configuration. Codex infers the MCP transport from `command` or `url` and does not recognize `type`; normal mode reports that the setting is ignored, while strict configuration mode refuses to start.

After temporarily removing this field manually, Codex can still identify the transport correctly. However, any later cc-switch MCP sync or Codex provider switch writes it back in unfixed versions. The import logic must also infer HTTP from `url` when `type` is absent; otherwise, merely removing the output field causes configurations containing only `url` to be treated as stdio.

  1. Remove the `type` line from every `[mcp_servers.*]` section in `~/.codex/config.toml`, then rerun the Codex strict configuration check.

    ~/.codex/config.toml
    [mcp_servers.context7]
    type = "stdio"
    command = "context7-mcp"
  2. Until cc-switch is fixed, avoid enabling entries for Codex that trigger MCP sync. Clear the Codex selections in MCP management and maintain `~/.codex/config.toml` manually to prevent sync from writing the field back.

ToolCodex
Version3.20.3 - 3.20.4(受影响)
PlatformsWindowsmacOSLinux
Does an ignored `type` make MCP completely unavailable?
No. The issue reports confirm that Codex can still identify the MCP transport correctly, but strict configuration mode refuses to start because of the unknown field.
Why does the problem return after manually removing `type`?
An unfixed cc-switch writes the field back when it syncs MCP again or switches the Codex provider.
Is removing only the logic that writes `type` enough?
No. When importing Codex configuration, infer HTTP if `type` is absent and `url` exists, so configurations containing only URL are not treated as stdio and skipped.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.