Skip to content

config.toml quietly reverts to the earlier configuration - cc-switch

Quick fix

The cc-switch database is the single source of truth. Hand edits to local files are overwritten — change things in the MCP manager or general config instead.

Error output
在 ~\.codex\config.toml 更改配置后, 过几天不知不觉又回到之前的配置了, 例如删掉一个 mcp, 删了两个月了一直删不掉, 时不时就回来
English translation

After changing the config in ~/.codex/config.toml, a few days later it quietly reverts to the earlier configuration. For example I deleted an mcp — I have been deleting it for two months and it keeps coming back.

cc-switch is designed around its own database as the single source of truth. When switching provider, syncing config, or starting up, cc-switch exports everything stored in the database — including historical MCP enablement state — and writes it over the local ~/.codex/config.toml. So deleting an MCP or changing config directly in the local file is restored from the old database data on the next sync.

Early versions (< v3.12.2) also had a bug where TOML was appended rather than merged intelligently, and reverse sync could pull local runtime config into the database, compounding duplicate config and data pollution.

  1. Stop editing the local ~/.codex/config.toml directly and open the cc-switch main window.

  2. Click the MCP manager at the top right, find the MCP services you do not want in the list and delete them, so the database state matches what you expect.

  3. To change general config, tick 写入通用配置 (write general config) on the 编辑供应商 (edit provider) screen and make changes through the 编辑通用配置 (edit general config) module, letting cc-switch manage it centrally.

  4. If the config is badly polluted and beyond untangling, back up your baseurl, apikey, and model-id, delete the .cc-switch folder in your home directory, and add the providers again.

Toolcodex
VersionUnknown
PlatformsmacOSWindows
Why does editing config.toml in the cc-switch UI report a format error on save?
macOS WKWebView has smart quotes on by default, which turns straight quotes into curly full-width quotes and fails TOML validation. Check your quotes, or upgrade to the latest version.
Does cc-switch merge MCP entries I added locally by hand?
No. cc-switch exports wholesale. If you added an MCP by hand locally, run the import in cc-switch MCP management first so it is managed centrally in the database.

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.