Share MCP servers across Claude Code and Codex
You wired an MCP server into Claude Code. Now you want the same servers in Codex, Cursor, and VS Code without hand-editing six config files that each use a different shape.
Updated November 15, 2026
Short answer: keep one canonical list of MCP servers in a single file and project it into each tool’s native config, instead of hand-editing each one. BrigadeStack does this with brigadestack mcp sync: one catalog in .brigade/mcp.json, merged into Claude Code, Codex, Cursor, VS Code, OpenCode, and Grok in the project, plus Antigravity, OpenClaw, Hermes, and user-wide configs with --user-scope. It is dry-run by default, so you review the diff first, and it records each multi-file write so an interrupted one can be recovered.
If you are looking for the broader workflow, start here: sync MCP servers across coding agents.
Why six files drift
Every coding agent reads its MCP servers from a different file in a different shape:
| Tool | File | Format |
|---|---|---|
| Claude Code | .mcp.json | JSON |
| Cursor | .cursor/mcp.json | JSON |
| Codex CLI | .codex/config.toml | TOML |
| VS Code | .vscode/mcp.json | JSON, secrets as inputs[]. VS Code now marks this editor-managed file deprecated for new setups |
| OpenCode | opencode.json | JSON |
| Grok CLI | .grok/config.toml | TOML |
| Antigravity | ~/.gemini/config/mcp_config.json | JSON, user-scoped |
Add one server and you are editing seven files by hand, in three formats, and keeping them in sync forever. Miss one and that agent silently runs without the tool.
The options
| Approach | One source | Per-tool format | Review before write | Receipt / rollback |
|---|---|---|---|---|
| Hand-editing each config | no | manual | you are the diff | no |
| A dotfile manager (chezmoi) | as templates | you template each | no | git, not per-write |
| add-mcp | no catalog file, it unifies existing configs | 25 agents, with dropped-field warnings | prompts on sync, no dry-run diff | no |
| BrigadeStack | yes, .brigade/mcp.json | native shapes for six project tools, more with --user-scope | yes, dry-run per-tool diff | recorded projections, mcp recover |
Dotfile managers and small installers get you part of the way. chezmoi shows a per-file diff before it applies, but it treats an MCP config as text, so a per-server merge is yours to template. add-mcp maps fields into each client’s native shape and warns about dropped fields, but it has no catalog file to review and no dry-run diff. BrigadeStack adds the catalog and a per-tool, per-server plan before any write.
How BrigadeStack does it
brigadestack mcp init # scaffold .brigade/mcp.json
brigadestack mcp add --name github --command npx \
--args "-y @modelcontextprotocol/server-github" \
--env GITHUB_TOKEN=ref:GITHUB_TOKEN --timeout 60
brigadestack mcp sync # dry-run: the per-tool diff, server by server
brigadestack mcp sync --write # merge into each tool's native config
brigadestack mcp sync is dry-run by default. It prints the plan for every tool before a single file changes:
brigade mcp sync (dry-run): /home/you/agent-workspace
source: /home/you/agent-workspace/.brigade/mcp.json
destination: /home/you/agent-workspace/.mcp.json
destination: /home/you/agent-workspace/.cursor/mcp.json
destination: /home/you/agent-workspace/.codex/config.toml
destination: /home/you/agent-workspace/.grok/config.toml
destination: /home/you/agent-workspace/.vscode/mcp.json
destination: /home/you/agent-workspace/opencode.json
claude github missing -> create
cursor github missing -> create
codex github missing -> create
grok github missing -> create
vscode github missing -> create
opencode github missing -> create
The command prints brigade because brigadestack is the same program under the new name. A field-fidelity report follows the plan and lists any field a target cannot carry. VS Code is included only when the repo already has a .vscode/ directory, so a sync never creates one unasked.
Four things make it safe to run on a config you care about:
- It merges by server key, so servers you added by hand are left alone, and ones you edited are untouched unless you pass
--force. - Secrets are written as
${VAR}references (or VS Code${input:VAR}), never inlined. - Codex
config.tomlis merged surgically, so your other tables are preserved. - Writing a stdio server into a user-wide config (
--user-scope) shows the destination and the process count first, because each active client session then starts one child process per server. Non-interactive and--jsonruns need--allow-global-stdio.
After --write, add --verify (or run brigadestack mcp verify) to probe that each selected server actually starts.
Tools and skills get the same reviewed treatment: brigadestack tools sync plan previews and brigadestack tools sync apply writes one reviewed catalog into each harness’s native format.
When you do not need this
If you run a single agent and never touch a second one, one config file is fine, edit it directly. BrigadeStack starts to pay off the moment you have two or more agents that should share the same servers, or the moment a tool overwrites a config and you want a receipt of what changed.
Questions
Does it support Claude Code and Codex specifically? Yes. Claude Code writes to .mcp.json, Codex to .codex/config.toml, and BrigadeStack keeps both in sync from one catalog. Cursor, VS Code, OpenCode, Grok, and (with --user-scope) Antigravity are supported too.
Will it overwrite servers I added by hand? No. It merges by server key and only touches a server you already own if you pass --force.
Is anything sent to a server or the cloud? MCP sync writes local config files and does not start a background service. Sharing memory through the backend is a separate set of commands.
Full behavior is in the MCP sync docs.