AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Sync Agents Settings

mcp-leoyang183-sync-agents-settings · by Leoyang183

Sync MCP server configs from Claude Code to Gemini CLI, Codex CLI, OpenCode, Kiro, and Cursor — one command, all agents.

No reviews yet
0 installs
39 views
0.0% view→install

Install

$ agentstack add mcp-leoyang183-sync-agents-settings

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-leoyang183-sync-agents-settings)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Sync Agents Settings? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

sync-agents-settings

[](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/sync-agents-settings) [](https://www.npmjs.com/package/sync-agents-settings) [](https://www.typescriptlang.org/) [](https://nodejs.org/) [](https://pnpm.io/) [](https://vitest.dev/) [](https://modelcontextprotocol.io/) [](https://prettier.io/) [](https://github.com/Leoyang183/sync-agents-settings/actions/workflows/ci.yml)

Sync MCP server configurations and instruction files (CLAUDE.md) from Claude Code to Gemini CLI, Codex CLI, OpenCode, Kiro CLI, Cursor, Kimi CLI, Vibe CLI (Mistral), Qwen Code, Amp (Sourcegraph), Cline CLI, Windsurf, and Aider CLI.

README translations: [🇹🇼 繁體中文](docs/i18n/README.zh-tw.md) | [🇨🇳 简体中文](docs/i18n/README.zh-cn.md) | [🇯🇵 日本語](docs/i18n/README.ja.md) | [🇰🇷 한국어](docs/i18n/README.ko.md) Support matrix: [CLI compatibility matrix](docs/compatibility-matrix.md)

Why

If you use Claude Code as your primary AI coding agent but also switch between other agents (Gemini CLI, Codex CLI, OpenCode, Kiro, Cursor, Kimi CLI, Vibe CLI, Qwen Code, Amp, Cline CLI, Windsurf) to take advantage of their free tiers or different models, you know the pain — every tool has its own MCP config format, and setting them up one by one is tedious. Same goes for instruction files — CLAUDE.md, GEMINI.md, AGENTS.md all need the same content but in different formats.

This tool lets you configure MCP servers and write instructions once in Claude Code, then sync everywhere with a single command.

Quick Start

Option A: Claude Code Plugin (recommended)

Install as a Claude Code plugin via marketplace:

# 1. Add the marketplace
claude plugin marketplace add Leoyang183/sync-agents-settings

# 2. Install the plugin
claude plugin install sync-agents-settings

# Then use slash commands in any conversation:
#   /sync               — sync MCP configs (with dry-run preview)
#   /sync-list          — list all MCP servers
#   /sync-diff          — compare configs between agents
#   /sync-doctor        — detect config drift and parse errors
#   /sync-validate      — validate schema and target capabilities
#   /sync-reconcile     — validate + detect drift + sync only missing
#   /sync-instructions  — sync CLAUDE.md to other agents
#   /report-schema      — print or write report JSON schema markdown

The plugin also includes a sync-awareness skill that automatically suggests syncing when you edit MCP settings or CLAUDE.md files.

Option B: CLI via npx

No installation needed — just run with npx:

# List all MCP servers detected from Claude Code
npx sync-agents-settings list

# Preview sync (no files modified)
npx sync-agents-settings sync --dry-run

# Sync to all targets (with automatic backup)
npx sync-agents-settings sync

# Sync CLAUDE.md instructions to all targets
npx sync-agents-settings sync-instructions

Option C: Global Install

# Global install for the `sync-agents` command
npm install -g sync-agents-settings

# Then use directly
sync-agents list
sync-agents sync

Usage

# Sync to a specific target
sync-agents sync --target gemini
sync-agents sync --target codex
sync-agents sync --target opencode
sync-agents sync --target kiro
sync-agents sync --target cursor
sync-agents sync --target kimi
sync-agents sync --target vibe
sync-agents sync --target qwen
sync-agents sync --target amp
sync-agents sync --target cline
sync-agents sync --target windsurf

# Sync to Codex project-level config
sync-agents sync --target codex --codex-home ./my-project/.codex

# Sync to Kimi project-level config
sync-agents sync --target kimi --kimi-home ./my-project/.kimi

# Sync to custom home directories
sync-agents sync --target qwen --qwen-home ./my-project/.qwen
sync-agents sync --target amp --amp-home ./my-project/.amp
sync-agents sync --target cline --cline-home ./my-project/.cline
sync-agents sync --target windsurf --windsurf-home ./my-project/.windsurf

# Compare differences
sync-agents diff

# Check drift / parse errors between Claude and targets
sync-agents doctor

# Validate source schema and target capability compatibility
sync-agents validate

# One-shot safe reconcile (validate + doctor + sync missing)
sync-agents reconcile --dry-run

# CI-friendly JSON output
sync-agents reconcile --report json

# CI-friendly JSON output for drift checker
sync-agents doctor --report json

# CI-friendly JSON output for schema/capability validation
sync-agents validate --report json

# CI-friendly JSON output for sync result
sync-agents sync --report json --dry-run

# CI-friendly JSON output for instruction sync
sync-agents sync-instructions --report json --dry-run --global --target gemini

# CI-friendly JSON output for diff result
sync-agents diff --report json --target gemini codex

# Note: all --report json outputs include `schemaVersion: 1`

Report schema reference: `docs/report-schema.md`

# Regenerate report schema documentation
sync-agents report-schema --write docs/report-schema.md

# CI check: ensure report schema doc is up to date
sync-agents report-schema --check

# Auto-fix from doctor (internally runs reconcile)
sync-agents doctor --fix --dry-run

# Auto-fix after validation passes
sync-agents validate --fix --dry-run

# Skip OAuth-only servers (e.g. Slack)
sync-agents sync --skip-oauth

# Skip backup
sync-agents sync --no-backup

# Verbose output
sync-agents sync -v

# Check only specific targets
sync-agents doctor --target gemini codex

# Check Codex project-level config drift
sync-agents doctor --target codex --codex-home ./.codex

# Validate only selected targets and ignore OAuth-only servers
sync-agents validate --target codex opencode --skip-oauth

# Validation semantics:
# - blank-only command/url values are treated as missing
# - OAuth-only servers produce manual-setup warnings without duplicate field errors

# Reconcile selected targets only
sync-agents reconcile --target gemini codex

# Sync instruction files (CLAUDE.md → GEMINI.md / AGENTS.md / Kiro steering / Cursor rules / Aider conventions)
# Targets: gemini, codex, opencode, kimi, vibe, kiro, cursor, aider, qwen, amp
sync-agents sync-instructions

# Sync only global instructions
sync-agents sync-instructions --global

# Sync only project-level instructions
sync-agents sync-instructions --local

# Sync to specific targets
sync-agents sync-instructions --target gemini codex kimi vibe aider qwen amp

# Auto-overwrite without prompts (for CI)
sync-agents sync-instructions --on-conflict overwrite

# Keep legacy behavior: remove standalone @import lines instead of expanding
sync-agents sync-instructions --import-mode strip

# Allow standalone @import to read files outside current project root (use with care)
sync-agents sync-instructions --allow-unsafe-imports

# Preview instruction sync
sync-agents sync-instructions --dry-run

Development

git clone https://github.com/Leoyang183/sync-agents-settings.git
cd sync-agents-settings
pnpm install
pnpm dev list        # Run from source
pnpm test            # Run tests

How It Works

Claude Code is the single source of truth for MCP settings, synced to all supported targets.

                                                 ┌─→ Gemini Writer    ─→ ~/.gemini/settings.json
                                                 ├─→ Codex Writer     ─→ ~/.codex/config.toml
~/.claude.json ─────┐                            ├─→ OpenCode Writer  ─→ ~/.config/opencode/opencode.json
                     ├─→ Reader ─→ UnifiedMcpServer[] ─┼─→ Kiro Writer      ─→ ~/.kiro/settings/mcp.json
~/.claude/plugins/ ──┘                            ├─→ Cursor Writer    ─→ ~/.cursor/mcp.json
                                                 ├─→ Kimi Writer      ─→ ~/.kimi/mcp.json
                                                 ├─→ Vibe Writer      ─→ ~/.vibe/config.toml
                                                 ├─→ Qwen Writer      ─→ ~/.qwen/settings.json
                                                 ├─→ Amp Writer       ─→ ~/.config/amp/settings.json
                                                 ├─→ Cline Writer     ─→ ~/.cline/data/settings/cline_mcp_settings.json
                                                 └─→ Windsurf Writer  ─→ ~/.codeium/windsurf/mcp_config.json

| Stage | Description | |-------|-------------| | Reader | Reads from ~/.claude.json and enabled plugin .mcp.json files, merges into a unified format | | Gemini Writer | JSON → JSON, type: "http"httpUrl, ${VAR}$VAR | | Codex Writer | JSON → TOML, ${VAR:-default} → expanded to actual value (env value or fallback) | | OpenCode Writer | JSON → JSON, command+args → merged command array, envenvironment, type: "local"/"remote" | | Kiro Writer | Same format as Claude, ${VAR:-default} → expanded | | Cursor Writer | Same format as Claude, ${VAR:-default} → expanded | | Kimi Writer | Same format as Claude, ${VAR:-default} → expanded | | Vibe Writer | JSON → TOML [[mcp_servers]] array-of-tables, explicit transport field, ${VAR:-default} → expanded | | Qwen Writer | JSON → JSON, type: "http"httpUrl, ${VAR}$VAR (same as Gemini) | | Amp Writer | JSON → JSON, uses "amp.mcpServers" key, ${VAR} preserved (same as Claude) | | Cline Writer | Same format as Claude, ${VAR:-default} → expanded | | Windsurf Writer | JSON → JSON, urlserverUrl, ${VAR}${env:VAR} |

Instruction Sync (sync-instructions)

Syncs CLAUDE.md instruction files to each target's native format:

                                          ┌─→ ~/.gemini/GEMINI.md             (plain copy)
                                          ├─→ ~/.codex/AGENTS.md              (plain copy)
~/.claude/CLAUDE.md (+ ~/.claude/rules/*.md) ─→ expand @imports ──┼─→ ~/.config/opencode/AGENTS.md    (plain copy)
                                          ├─→ ~/.kimi/AGENTS.md               (plain copy)
                                          ├─→ ~/.vibe/AGENTS.md               (plain copy)
                                          ├─→ ~/.qwen/AGENTS.md               (plain copy)
                                          ├─→ ~/.config/amp/AGENTS.md         (plain copy)
                                          ├─→ ~/.kiro/steering/claude-instructions.md  (+ inclusion: always)
                                          └─→ ⚠ Cursor global not supported  (SQLite)

                                          ┌─→ ./GEMINI.md                     (plain copy)
                                          ├─→ ./AGENTS.md                     (Codex + OpenCode + Kimi + Vibe + Qwen + Amp share)
./.claude/CLAUDE.md (fallback: ./CLAUDE.md) + ./.claude/rules/*.md ─→ expand @imports ──┼─→ .kiro/steering/claude-instructions.md    (+ inclusion: always)
                                          └─→ .cursor/rules/claude-instructions.mdc   (+ alwaysApply: true)

| Target | Global | Local | Format Transform | |--------|--------|-------|------------------| | Gemini | ~/.gemini/GEMINI.md | ./GEMINI.md | Plain copy (expand standalone @import lines) | | Codex | ~/.codex/AGENTS.md | ./AGENTS.md | Plain copy (expand standalone @import lines) | | OpenCode | ~/.config/opencode/AGENTS.md | ./AGENTS.md (shared with Codex) | Plain copy (expand standalone @import lines) | | Kimi | ~/.kimi/AGENTS.md | ./AGENTS.md (shared with Codex/OpenCode/Vibe/Qwen/Amp) | Plain copy (expand standalone @import lines) | | Vibe | ~/.vibe/AGENTS.md | ./AGENTS.md (shared with Codex/OpenCode/Kimi/Qwen/Amp) | Plain copy (expand standalone @import lines) | | Qwen Code | ~/.qwen/AGENTS.md | ./AGENTS.md (shared with Codex/OpenCode/Kimi/Vibe/Amp) | Plain copy (expand standalone @import lines) | | Amp | ~/.config/amp/AGENTS.md | ./AGENTS.md (shared with Codex/OpenCode/Kimi/Vibe/Qwen) | Plain copy (expand standalone @import lines) | | Cline | Not supported | Not supported (uses .clinerules) | — | | Windsurf | Not supported | Not supported (uses own rules format) | — | | Aider | ~/.aider/CONVENTIONS.md | .aider/CONVENTIONS.md | Plain copy + upsert read entry in .aider.conf.yml | | Kiro | ~/.kiro/steering/claude-instructions.md | .kiro/steering/claude-instructions.md | Add inclusion: always frontmatter | | Cursor | Not supported (SQLite) | .cursor/rules/claude-instructions.mdc | Add alwaysApply: true frontmatter |

Notes:

  • Local source resolution prefers ./.claude/CLAUDE.md, then falls back to ./CLAUDE.md.
  • Extra rules in .claude/rules/**/*.md are appended automatically (unless already included via @import).
  • If a rule file has frontmatter paths, it is included only when at least one project file matches.
  • @import handling defaults to inline (expand). Use --import-mode strip to remove standalone import lines.
  • By default, standalone @import can only read files inside the current project root. Use --allow-unsafe-imports to opt out.
  • Inline import expansion has guardrails (max depth: 20, max files: 200) to avoid runaway recursion.
  • Aider sync also upserts .aider.conf.yml read so CONVENTIONS.md is loaded automatically (global/project follows the sync scope).
  • Kimi CLI currently loads AGENTS.md from the working directory. ~/.kimi/AGENTS.md is synced as a reusable global template.

When a target file already exists, you'll be prompted to choose: overwrite, append (keep existing + add CLAUDE.md below), or skip. Use --on-conflict overwrite|append|skip for non-interactive mode.

Safety mechanisms:

  • Existing servers are never overwritten (idempotent, safe to re-run)
  • Automatic backup to ~/.sync-agents-backup/ by default (--no-backup to skip)
  • --dry-run previews changes without writing any files

Source: Claude Code

Reads MCP servers from two sources:

  1. ~/.claude.jsonmcpServers object (user-configured servers)
  2. ~/.claude/plugins/cache////.mcp.json → enabled plugin MCP servers (matched against ~/.claude/settings.json enabledPlugins)

Claude Code has two .mcp.json formats:

// Format 1: Flat (e.g. context7, firebase)
{ "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } }

// Format 2: Nested under mcpServers (e.g. sentry, stripe)
{ "mcpServers": { "sentry": { "type": "http", "url": "https://mcp.sentry.dev/mcp" } } }

Target: Gemini CLI

Writes to ~/.gemini/settings.jsonmcpServers object.

Key format differences from Claude:

  • Claude type: "http" → Gemini httpUrl
  • Claude type: "sse" → Gemini url
  • Claude command (stdio) → Gemini command (same)
  • Env var syntax: Claude ${VAR} → Gemini $VAR (auto-converted)
// Gemini settings.json
{
  "theme": "Dracula",          // existing settings preserved
  "mcpServers": {
    "context7": {              // stdio server
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    },
    "sentry": {                // http server
      "httpUrl": "https://mcp.sentry.dev/mcp"
    }
  }
}

Target: Codex CLI

Writes to ~/.codex/config.toml (global) by default. Use --codex-home to write to a project-level .codex/config.toml instead.

> Note: Codex CLI does NOT merge global and project configs. When a project has .codex/, Codex only reads that directory. Global ~/.codex/ is ignored entirely.

Key format differences:

  • Uses TOML instead of JSON
  • command/args for stdio (same concept)
  • url for HTTP servers (no type field needed)
  • env is a TOML sub-table [mcp_servers..env]
[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

[mcp_servers.sentry]
url = "https://mcp.sentry.dev/mcp"

[mcp_servers.n8n-mcp]
command = "npx"
args = ["n8n-mcp"]

  [mcp_servers.n8n-mcp.env]
  N8N_API_KEY = "your-key"
  N8N_API_URL = "https://your-n8n.example.com"

Target: OpenCode

Write

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.