Token导航 LogoToken导航TokenDH.com
MCP Git Coord logo
办公协作未说明官方级别未说明来源级核验

MCP Git Coord

MCP Server

mcp-git-coord是一款智能代码协作工具,通过预构建的代码上下文文件和团队协调机制,减少AI编码会话中的令牌浪费和代码冲突。

工具数

10

提示词数

0

GitHub Stars

0

资源数

0
代码管理TypeScriptClaudeClaudeCursor

安装说明

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

作者 / 组织

OperatingSystem-1

提供方

OperatingSystem-1

最后核验

2026/5/17 20:20

快速接入

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

详细介绍

mcp git coord

将每月200美元的Claude Max代币使用量减半。 每次AI编码会话都会浪费令牌,重新探索您上一次会话已经理解的代码。 mcp-git-coord 修复了这个问题,并阻止了你团队的特工互相攻击。

](https://www.npmjs.com/package/mcp-git-coord)

两个问题,一个工具

1.代币浪费——代理每次会话都会重新探索相同的代码

每次启动新的Claude Code/Cursor会话时,代理都会读取数百个文件来理解您的代码库。这是在上一次会议中已经建立的知识上燃烧的数千个代币,然后被扔掉。

.mi 上下文文件 解决这个问题。每个子目录维护一个 .mi/ 具有预构建理解的文件夹:架构、数据流、关键文件、陷阱。您的代理读取200行上下文文档,而不是重新浏览50个源文件。钩子提醒代理在编码前阅读,更改后更新。

2.协调——各自为政的代理人制造冲突

当多个开发人员在同一个仓库上使用AI编码工具时,代理不知道彼此的工作。他们修改相同的文件,产生冲突的更改,并通过猜测来解决合并冲突——默默地删除其他人构建的功能。

协调工具 解决这个问题。代理在工作之前注册他们的意图,在编写代码之前检测冲突,并在完整的团队上下文中提供人工控制的合并解决方案。

安装

npm install -g mcp-git-coord

或者将此粘贴到Claude Code、Cursor或任何与MCP兼容的AI工具中:

Install mcp-git-coord by following the instructions at https://raw.githubusercontent.com/OperatingSystem-1/mcp-git-coord/main/llms-full.txt

Manual setup

添加到MCP服务器配置(.claude/settings.json 对于克劳德代码, .cursor/mcp.json 光标):

{
  "mcpServers": {
    "git-coord": {
      "command": "npx",
      "args": ["-y", "mcp-git-coord"]
    }
  }
}

快速入门--设置.mi上下文文件

安装后,在AI编码工具中运行以下命令:

Set up .mi context files for this project using mi_setup

这将:

  1. 扫描你的代码库 --查找包含有意义源代码的目录
  2. 创建 .mi/CONTEXT.md 在每一个中,都有文件列表和最近的git历史记录
  3. 安装挂钩 --SessionStart(提醒阅读)、PreToolUse on read(在更改前轻推)、PostToolUse on Edit(提醒更新)、Stop(警告过时文档)

然后填写 _TODO_ 每个生成的上下文文件中的部分。你在这些文档上投资越多,未来每次会话消耗的代币就越少。

.mi上下文文件的工作原理

your-project/
├── src/
│   ├── .mi/
│   │   └── CONTEXT.md          ← "src/ architecture: API routes, DB layer, auth..."
│   ├── auth/
│   │   ├── .mi/
│   │   │   └── CONTEXT.md      ← "auth: OAuth flow, session management, JWT..."
│   │   ├── middleware.ts
│   │   └── session.ts
│   └── billing/
│       ├── .mi/
│       │   └── CONTEXT.md      ← "billing: Stripe integration, credit system..."
│       ├── stripe.ts
│       └── credits.ts
└── .claude/
    ├── hooks/                   ← auto-installed by mi_setup
    │   ├── mi-session-start.sh
    │   ├── mi-read-context.sh
    │   ├── mi-doc-reminder.sh
    │   └── mi-stop-check.sh
    └── settings.json            ← hooks registered here

生命周期:

  1. 会话开始 → 钩子列表可用 .mi 文件,代理读取相关文件
  2. 代理读取文件 → 钩子提醒 .mi 该目录中的文档
  3. 代理编辑文件 → 钩子提醒更新 .mi 如果更改影响到它,请记录
  4. 会话结束 → 如果源文件发生更改,钩子会发出警告,但 .mi 文档未更新

回报: 而不是代理人花费2000多个代币进行探索 src/auth/ 从零开始,它读取一个150行的上下文文档,该文档告诉它所有内容:OAuth是如何工作的,会话存储在哪里,JWT结构是什么,以及不应该接触什么。对于每一次探索,这是大约10倍的代币减少。

协调是如何运作的

工作前登记意图

Agent → coord_register("Refactoring auth middleware", files: ["src/auth/middleware.ts"])
Server → "Registered. No conflicts."

在编写代码之前检测冲突

Agent → coord_register("Adding rate limiting to auth", files: ["src/auth/middleware.ts"])
Server → "⚠️ Conflict: cursor-alex is refactoring auth middleware in the same file."

围绕冲突制定计划

Agent → coord_plan(my_intent, conflict)
Server → "Start with non-overlapping files. Defer auth/middleware.ts until their session completes."

与完整的团队环境合并

Agent → coord_merge_check(target_branch: "dev")
Server →
  "2 file(s) have conflicting changes.
   src/auth/middleware.ts:
     Ours:   +15/-3 lines (refactored middleware signature)
     Theirs: +8/-2 lines (added rate limiter)
     Why:    cursor-alex was working on 'Adding rate limiting'

   Ask the user to resolve each conflict."

所有工具

上下文智能(.mi)

工具它做什么
mi_setup扫描代码库,创建 .mi/ 上下文文件,安装钩子。每个项目运行一次。
mi_scan列出全部 .mi 带有大小和最后修改时间的上下文文件。
mi_status检查哪个 .mi 文件已过时——源代码已更改,但文档未更新。

协调

工具它做什么
coord_register注册意图+文件。立即返回冲突。
coord_check检查文件或作用域是否有活动工作
coord_active列出仓库中的所有活动会话。
coord_complete将会话标记为已完成。
coord_plan考虑到冲突,建议采用非重叠的方法。

合并决议

工具它做什么
coord_merge_check分析与目标分支的冲突。返回具有团队上下文的人类可读摘要。
coord_merge_resolve解决一个冲突:保留我们的,接受他们的,或者应用自定义内容。

将协调规则添加到项目中

将此添加到您的 CLAUDE.md, .cursorrules,或同等产品:

## Coordination (mcp-git-coord)

Before starting work, always:
1. Call `mi_scan` to see available context files, read the relevant ones
2. Call `coord_register` with your intent and the files you plan to modify
3. If conflicts are returned, call `coord_plan` to find a non-overlapping approach
4. When done, call `coord_complete` with a summary
5. Update any .mi context files affected by your changes

Before merging, always:
1. Call `coord_merge_check` with the target branch
2. If conflicts exist, present each one to the user with the TL;DR
3. Do NOT resolve any conflict without explicit user approval
4. Use `coord_merge_resolve` for each file after the user decides

发展

git clone https://github.com/OperatingSystem-1/mcp-git-coord
cd mcp-git-coord
npm install
npm run dev

许可证

麻省理工学院

______________________________________________________________________

开源由 有丝分裂实验室 --持续、繁殖和进化的自主人工智能代理。

目录标签

目录标签

代码管理TypeScriptClaudeAI编码优化本地部署团队协作令牌节省

支持客户端

ClaudeCursor

接入字段

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

未说明

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

oauth

工具数量(toolCount,工具数)

10

资源数量(resourceCount,资源数)

0

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

0

权限和风险

未说明oauth部署方式未说明

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

安装前确认

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

仍需确认:installCommand

来源信息

继续浏览同类 MCP