Config not applied: MCP not imported and environment variables overwritten
Quick fix
cc-switch overwrites wholesale. Extract hand-edited config into 通用配置 (general config), import MCP by hand, and tick the write-general-config option.
Symptom
Section titled “Symptom”自己写进去setting.json的其它选项在切换后丢失The other options I wrote into setting.json myself are lost after switching
cc-switch overwrites wholesale when switching provider rather than merging field by field. Field-level merging was attempted in v3.11.0 and rolled back in v3.11.1 because of state conflicts. By design, the request address and API key belong to the provider, while other shared config — plugins, hooks, MCP — has to travel between providers through the 通用配置 (general config) feature. If you edit settings.json by hand or install a plugin through the Claude marketplace without extracting it into the cc-switch database, that config is overwritten on the next switch or restart. For MCP, older versions only scanned at first install; v3.9.0 added a manual import button. Environment variable config needs the write-general-config override ticked to take effect. Finally, config directories (WSL versus native Windows) do not switch together — only the selected one applies.
Open cc-switch, go to the provider edit page, find the 通用配置 (general config) panel, and click 从当前供应商提取 (extract from current provider) to read plugins, hooks, and other shared config into the database.
When creating or switching a provider, keep 写入通用配置 (write general config) ticked — it is on by default — so plugin data and similar survive.
If you use MCP, click the 手动导入 (manual import) button available from v3.9.0 to import your existing MCP config into the database.
If you rely on environment variable config, tick the write-general-config override in cc-switch, or comment out / rename the original config file so it is not overwritten by what cc-switch writes.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 11 real issues
- Why did my plugin config disappear after switching provider?
- Because cc-switch overwrites wholesale by design. Shared config such as plugins has to be extracted into 通用配置 (general config) with 写入通用配置 (write general config) ticked to survive.
- Could it merge the JSON rather than replacing it entirely?
- Field-level merging was attempted in v3.11.0 and rolled back over state conflicts. The current design is a full overwrite, with no plan to return to field-level merging.
- My MCP config does not apply. What now?
- Before v3.9.0, MCP was only scanned at first install. Newer versions add a manual import button — click it.
- cc-switch overwrites my environment variable config. What now?
- Tick the write-general-config override, or comment out / rename the original config file so your environment variables win.
- After configuring a WSL directory, does the native Windows directory still apply?
- No. By design cc-switch switches only the selected directory, never several at once.
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.