Skip to content

duplicate entry with key "mcp_servers" Hermes configuration error

Quick fix

Upgrade to cc-switch v3.16.3 or later, then switch providers to automatically clean up historical duplicate keys.

Error output
配置错误: Failed to parse Hermes config as YAML: duplicate entry with key "mcp_servers"
English translation

Configuration error: Failed to parse Hermes config as YAML: duplicate entry with key "mcp_servers"

On Windows, CRLF line endings may prevent CC Switch from recognizing existing top-level sections in the Hermes YAML file. When switching providers, it may append a new section instead of replacing the existing one, accumulating duplicate `mcp_servers`, `model`, or `custom_providers` keys and causing YAML parsing to fail. The maintainer confirmed that these issues were fixed in v3.16.3: duplicate sections are cleaned up when writing, and the last copy is retained and repaired when reading. A separate macOS report involved a duplicate `base_url` within a `custom_providers` entry. The maintainer could not confirm its cause and recommended upgrading and checking again; this does not establish that it shares the same cause as duplicate top-level keys.

  1. Upgrade to cc-switch v3.16.3 or later, then switch providers again; the maintainer says this version repairs historical duplicate sections when reading and on subsequent writes.

  2. If the issue persists, provide the relevant sections from the Hermes `config.yaml` (redact secrets first) and the CC Switch version for further investigation.

ToolClaude Code、Codex(问题发生于 CC Switch 管理的 Hermes 配置)
Version3.13.0、3.14.0、3.16.2;v3.16.3 修复顶层重复键问题
PlatformsWindowsmacOSLinux
If the duplicate key error persists after upgrading, what information should I provide?
Share the relevant sections from `config.yaml` with secrets redacted, and provide the CC Switch version.

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.