Token导航 LogoToken导航TokenDH.com
agentsync (Spyrae) logo
开发工具stdio官方级别未说明来源级核验

agentsync (Spyrae)

MCP Server

agentsync是一个用于同步多个AI编码代理(如Claude Code、Cursor、Codex等)的MCP服务器配置和规则的工具,支持JSON和TOML格式的自动转换及Markdown规则同步。

工具数

0

提示词数

0

GitHub Stars

3

资源数

0
开发工具PythonClaudeClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

spyrae

提供方

spyrae

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install agentsync-cli # pip

详细介绍

代理同步

跨AI编码代理同步MCP服务器配置和规则。

![CI](https://github.com/spyrae/agentsync/actions/workflows/ci.yml) ![PyPI](https://pypi.org/project/agentsync-cli/) ![License: MIT](https://opensource.org/licenses/MIT) ![Python 3.9+](https://www.python.org/downloads/)

______________________________________________________________________

问题

您使用多个AI编码代理——Claude Code、Cursor、Codex、Gemini。每个都以自己的格式(JSON、TOML)和自己的位置存储MCP服务器配置。手动保持它们同步是乏味且容易出错的。

解决方案

代理同步 获取单个真实源(您的Claude Code配置),并使用一个命令将其同步到所有代理。

┌──────────────┐
│  Claude Code │  Source of Truth
│  .claude.json│  ─── MCP Servers
│  .mcp.json   │  ─── Rules (CLAUDE.md)
│  CLAUDE.md   │
└──────┬───────┘
       │  agentsync sync
       ├──────────────────┐─────────────────┐
       ▼                  ▼                 ▼
┌──────────────┐  ┌──────────────┐  ┌──────────────┐
│    Cursor    │  │    Codex     │  │  Antigravity │
│  mcp.json   │  │ config.toml  │  │mcp_config.json│
│ project.mdc │  │  AGENTS.md   │  │              │
└──────────────┘  └──────────────┘  └──────────────┘

安装

pip install agentsync-cli     # pip
pipx install agentsync-cli    # pipx (recommended for CLI tools)
uvx agentsync-cli             # uv (run without installing)

快速开始

agentsync init       # Create agentsync.yaml config
agentsync sync       # Sync to all agents
agentsync validate   # Verify everything is correct

特性

  • MCP服务器同步 --JSON↔ TOML自动转换
  • 规则同步 --Markdown→ 使用frontmatter过滤Markdown/MDC
  • 不区分大小写的重复数据删除 --手柄 Notion 对比 notion 来自不同来源
  • 干运行模式 --编写前预览更改
  • 备份 --每次写入前自动备份
  • 验证 --结构检查、一致性、重复检测
  • 可扩展 --基于适配器的架构用于添加新代理

支持的代理

代理MCP格式规则格式状态
克劳德代码JSONMarkdown源代码
游标JSONMDC目标
CodexTOMLMarkdown目标
反重力(双子座)JSON--目标

配置

创建 agentsync.yaml 在项目根目录中:

version: 1

source:
  type: claude
  global_config: ~/.claude.json
  project_mcp: .mcp.json
  rules_file: CLAUDE.md

targets:
  cursor:
    type: cursor
    mcp_path: ~/.cursor/mcp.json
    rules_path: .cursor/rules/project.mdc
    exclude_servers: []

  codex:
    type: codex
    config_path: ~/.codex/config.toml
    rules_path: AGENTS.md
    exclude_servers: [codex]

  antigravity:
    type: antigravity
    mcp_path: ~/.gemini/antigravity/mcp_config.json
    protocols: [stdio]

rules:
  exclude_sections:
    - "MCP Servers"
    - "Context Management & Agents"

CLI参考

全局选项

选项描述
--config, -c PATHagentsync.yaml的路径(默认:自动发现)
--quiet, -q最小输出
--version显示版本并退出
--help显示帮助并退出

命令

# Sync — push source configs to targets
agentsync sync                  # Full sync (MCP + rules)
agentsync sync --dry-run        # Preview changes without writing
agentsync sync --mcp-only       # Only MCP server configs
agentsync sync --rules-only     # Only rules files
agentsync sync -t cursor        # Sync specific target only
agentsync sync --no-backup      # Skip creating backup files

# Validate — check target configs match source
agentsync validate              # Full validation
agentsync validate -v           # Verbose (show passed checks too)
agentsync validate -t codex     # Validate specific target only

# Init — create config
agentsync init                  # Create agentsync.yaml
agentsync init --force          # Overwrite existing config

# Status — show sync state
agentsync status                # Source info, target health, drift

退出代码

代码含义
0成功
1运行时错误(同步失败,验证失败)
2配置错误(缺少配置、YAML错误、适配器未知)

运作原理

agentsync sync
  │
  ├─ Load config (agentsync.yaml)
  ├─ Read source (Claude Code)
  │   ├─ ~/.claude.json         → global MCP servers
  │   ├─ .mcp.json              → project MCP servers
  │   └─ CLAUDE.md              → rules sections
  │
  ├─ Deduplicate (case-insensitive)
  ├─ Filter (exclude_servers, exclude_sections, protocols)
  │
  └─ Generate + Write per target
      ├─ Cursor:       mcp.json + project.mdc (MDC frontmatter)
      ├─ Codex:        config.toml (marker-based) + AGENTS.md
      └─ Antigravity:  mcp_config.json (stdio-only)

添加适配器

agentsync是为扩展而设计的。要添加对新AI代理的支持:

  1. 创建 src/agentsync/adapters/youragent.py --执行 TargetAdapter
  2. 在中注册 cli.py (create_targets)
  3. 将类型添加到 KNOWN_TARGET_TYPESconfig.py
  4. 在中编写测试 tests/test_adapter_youragent.py
  5. 更新此自述文件

贡献.md 了解详细的指南和完整的适配器接口。

贡献

欢迎投稿!看 贡献.md 作为指导方针。

请查看我们的 行为准则 在做出贡献之前。

更新日志

更改日志.md 发布历史。

许可证

麻省理工学院

目录标签

目录标签

开发工具PythonClaude配置同步本地部署AI编码工具自动化工具

支持客户端

ClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP