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.
Symptom
Section titled “Symptom”在 ~\.codex\config.toml 更改配置后, 过几天不知不觉又回到之前的配置了, 例如删掉一个 mcp, 删了两个月了一直删不掉, 时不时就回来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.
Stop editing the local ~/.codex/config.toml directly and open the cc-switch main window.
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.
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.
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.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 6 real issues
- #35不能给codex的配置文件添加mcp server服务
- #955[Bug] Codex MCP stale enabled_codex rows are re-injected on switch/sync and overwrite ~/.codex/config.toml
- #1028cc-switch的mcp配置问题
- #1189bug: Codex 通用配置写入 config.toml 采用追加而非智能插入逻辑
- #2670[Question] Codex 通用配置机制咨询(配置反复意外变化)
- #5395bug: Codex provider backfill stores live-only TOML sections and machine-local paths in settings_config
- 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.
Related problems
Section titled “Related problems”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.