← knowledge.oriz.in

MCP config single source of truth

rule mcpconfigagentssyncinfrastructure

MCP config single source of truth

The rule

.mcp.json at workspace root is the single canonical MCP server configuration. Every agent-specific MCP file is a derived copy.

What this means

  1. Edit .mcp.json only — never modify .kilocode/mcp.json, .vscode/mcp.json, .antigravity/mcp.json, or .opencode/opencode.jsonc directly.
  2. Run the sync script after every .mcp.json change:
    node scripts/sync-mcp-configs.mjs
    
  3. The sync script copies to 4 agents with identical format (.kilocode/, .vscode/, .antigravity/) and transforms to OpenCode's JSONC format (.opencode/opencode.jsonc).

Rationale

Previously, each of the 5 agents (Claude Code, OpenCode, Kilo Code, Cline, Antigravity) maintained its own copy of the MCP server definitions. Adding a new server or fixing a config required editing 5 files — error-prone and inconsistent.

Exceptions

Related