Skip to content

cc-switch loses, rewrites, or fails to load Claude Code / Codex MCP configuration

Quick fix

Upgrade cc-switch, disable or use unified MCP takeover carefully, find the one broken MCP entry, and fix rewritten command/type/path fields.

Error output
No MCP servers configured. Use `claude mcp add` to add a server.

This cluster holds several related but distinct MCP problems. cc-switch may reset or overwrite Claude Code plugin and MCP configuration while taking over or syncing MCP. It may incorrectly strip the outer mcpServers key when saving or switching, leaving the config structurally invalid. Syncing to Codex/OpenCode may convert stdio, url/SSE, and path/command fields into a structure the target client does not accept. Under WSL, an npx path may be converted incorrectly. A Codex streaming HTTP MCP may be lost after a switch. And the Responses → Chat Completions conversion path may drop MCP function tools. The fix status differs per problem: some are fixed in v3.15.0 / v3.16.0 or a later PR, others are still open or only have a workaround.

  1. Upgrade cc-switch to the latest version. A Codex import of an MCP that has only url and no type being misread as stdio, and tokens being logged in clear text, were both fixed in commits around v3.15.0 / v3.16.0.

  2. If Claude Code plugins, skills, agents, or MCP vanish after restarting cc-switch, first turn off 接管 (takeover) or the unified MCP/Skills takeover option in cc-switch. If you must use takeover, save the current config into the general settings first, then run the sync for each provider.

  3. If Claude Code reports No MCP servers configured while the config file still holds MCP entries, enable and disable them one at a time to find the entry that breaks all of them, then delete or repair it.

  4. When saving MCP JSON, make sure the outermost level is wrapped in mcpServers rather than being a single server object, so cc-switch does not strip it down to an invalid structure with no server name.

    Claude Code MCP 配置示例
    {
    "mcpServers": {
    "Context 7": {
    "command": "npx",
    "args": ["-y", "@upstash/context7-mcp@latest"],
    "env": {}
    }
    }
    }
  5. If a Codex import of an existing MCP complains about a missing command while the config only has url, upgrade to a fixed version so cc-switch recognises it as a remote HTTP/SSE MCP rather than stdio.

  6. If an npx-type MCP gets converted to a wrong path under WSL, npm install the package by hand first, then set command in the MCP config back to a working executable.

  7. If chrome-devtools or another MCP in OpenCode/Codex is rewritten into an incompatible shape — path becoming an array, or command silently changed to cmd /c npx ... — restore the original MCP fields in the target client config by hand for now, and avoid letting cc-switch rewrite that MCP when switching provider.

  8. If adding a streaming HTTP MCP in Codex and then switching provider loses the MCP list, back the Codex MCP config up and restore it after switching. This is still open in the given issues with no final fix version.

  9. If Codex cannot see MCP function tools through a Chat Completions upstream, confirm your CC Switch version has the Responses → Chat Completions conversion that drops tool definitions. As a stopgap, use an upstream that supports the native tool format, or wait for the fix.

ToolClaude Code / Codex
Version3.9.0 - 3.18.0
PlatformsWindowsmacOSLinux
Why do the agent, skill, and MCP settings of the everything claude code plugin disappear after restarting cc-switch?
Users report the takeover/sync mechanism causes this. Try turning takeover off, or save to the general settings after updating the config and sync for each provider. Others kept their plugins by configuring enabledPlugins in settings.local.json.
Saving MCP JSON reports success, but afterwards every Claude Code MCP is unavailable. What now?
Check whether you saved a single server object with no outer mcpServers wrapper. One malformed MCP config can break Claude Code parsing and take every MCP down with it. Delete or repair the bad entry and keep the mcpServers wrapper.
Why does a Codex MCP with only url fail to import, complaining about a missing command?
Older versions default to treating it as stdio and therefore demand a command field. This was fixed in later versions, where a url-only config is handled as a remote SSE/HTTP MCP.
An npx MCP path gets converted under WSL. What now?
Users solved it by npm installing the package directly and then editing command in the MCP config by hand. The path conversion problem was also fixed in a related PR.
Can cc-switch logs leak an MCP token?
Early versions logged Authorization/token and similar sensitive fields in clear text. Later fixes redact Authorization, token, api_key, secret, password, and cookie, along with Bearer/sk/ghp/github_pat shaped values.
A Codex streaming HTTP MCP is lost after switching. Is there a final fix?
The problem is still open in the given issues with no stated fix version. Back the Codex MCP config up and restore it by hand after switching, or follow the related issue.

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.