Local tooling for keeping agent/client configuration consistent across Claude Code, Codex, and OpenCode.
The MCP sync utility keeps MCP server definitions in one source file and renders each client-specific config format. It supports local stdio servers, remote HTTP/SSE servers where each client supports them, per-platform include/exclude rules, and platform-specific overrides for auth differences.
Canonical files live in mcp-sync/:
mcp-sync/servers.example.jsonis a template for your local MCP servers.mcp-sync/servers.jsondefines MCP servers once and is intentionally ignored by git.mcp-sync/sync-mcp-configs.mjsupdates Claude, Codex, and OpenCode configs.mcp-sync/test-sync-mcp-configs.mjsruns fixture checks without touching live configs.mcp-sync/servers.schema.jsondocuments the source format.
Set up your local config:
cp mcp-sync/servers.example.json mcp-sync/servers.jsonThen edit mcp-sync/servers.json for your local paths and MCP server names.
Run it with:
node ~/projects/agent-tooling/mcp-sync/sync-mcp-configs.mjsOr point it at another source or backup directory:
node ~/projects/agent-tooling/mcp-sync/sync-mcp-configs.mjs --source ./servers.json
node ~/projects/agent-tooling/mcp-sync/sync-mcp-configs.mjs --backup-dir ~/.local/state/agent-tooling/mcp-sync/backups/manualEach source file is authoritative for the target files it configures. Multiple profiles targeting the same Codex config replace this tool's generated Codex block rather than merging generated blocks from each profile.
Restart already-running agent sessions after syncing so they reload MCP tools.
Before overwriting an existing target config, the sync utility copies it into a timestamped backup directory under ~/.local/state/agent-tooling/mcp-sync/backups/, or into backupDir / --backup-dir when configured. New target files are created without backups.
Run fixture checks with:
node mcp-sync/test-sync-mcp-configs.mjsUseful source fields:
type: "local"usescommand,args, and optionalenvironment.type: "remote"usesurl, optionalheaders, and platform-specific OAuth config.platformsincludes a server only for listed clients.excludePlatformsomits a server from listed clients.claude,codex, andopencodeoverride fields for one client, orfalsedisables that server for that client.claudemeans Claude Code's local MCP config, not Claude.ai account connectors. UseexcludePlatforms: ["claude"]when Claude.ai already provides the server.- Claude MCP targets use
mcpConfigPathfor~/.claude.jsonor.mcp.json;settingsPathis only for optional permissions allow-list updates. - Target paths and source paths support
~expansion. - A local
*.state.jsonfile tracks generated JSON-target servers, Codex target paths, and Claude MCP permission entries so stale entries can be pruned on later syncs.
MIT