Cohort Mcp

io.github.magnusmage由 GitHub 账号 magnusmage 发布v0.1.0更新于 Oct 30, 2026

Shared AI memory for teams: a git vault of markdown, human-approved, injection-safe, local-only.

概览

AI 生成的概览

本地 stdio MCP 服务器,让团队成员的 AI 助手共用一份存放在 git 仓库中、经人工批准的 markdown 记忆库。

可以做什么
  • 加载有长度上限、优先已验证内容的团队上下文,并作为数据而非指令隔离
  • 通过服务端强制写入闸门提交新记录,闸门会扫描密钥、个人隐私信息、注入与矛盾
  • 在可读范围内搜索记忆库,默认只返回已验证记录
  • 报告生效策略、记录数量、隔离队列与过期记录
  • 从 git 历史读取某条记录的来源(谁、哪个模型、何时)
适用场景
适合这样的团队:助手每次会话都要重新学习同样的决策、事实和未完成事项,希望把共享记忆放在自己的 GitHub 仓库里。适用于能访问磁盘和 git 的客户端,如 Claude Code、Kimi Code CLI、Kimi Work 或 ZCode,不适用于网页聊天。
运行要求
通过 npx cohort-mcp 在本地运行(需要 Node.js),或使用桌面扩展;需要能访问磁盘和 git 的 AI 客户端,以及一个 GitHub 仓库作为记忆库。安装通过连接器技能或 cohort init 命令行完成;未声明任何 API 密钥或环境变量。
安装前请注意
共享记忆本身就是攻击面,因此存储的记录被视为不可信,并以数据形式隔离。模型只能读取和提议,不能批准或退役记录,批准需由人在终端完成。提议的写入在落地前会扫描密钥和个人隐私信息。无遥测,除自己的 git 远端外无其他网络请求。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Cohort Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Cohort: shared memory for your team's AI]

[License: Apache-2.0] [Docs: CC BY 4.0] [CI] [Release] [Roadmap: Phases 1 to 5 shipped]

One markdown vault on GitHub. Every teammate's AI reads and writes the same memory,
regardless of account, plan, or platform, and a human approves every change.

Quickstart · How it works · What's inside · The engine · Security · Full docs


Why Cohort

Your team's AI assistants each start every session blank. What one teammate's assistant learned (the decision you made, the fact you pinned, the thread you left open) is invisible to everyone else's. Paste the same context again and again, or lose it.

Cohort gives the team one shared memory. A single git repository holds your facts, decisions, and open threads in plain markdown. Each teammate's AI reads a bounded slice at the start of a session and proposes updates at the end, and a human approves every change before it lands. There is no hosted server and no account with us: the repo is the product, and it lives in your own GitHub.

How it works

[Teammates' AI clients load bounded context from a shared git vault and propose writebacks back through a local redaction gate, human approval, and a review-gated pull request.]

  1. Load. At session start, your AI pulls a bounded, verified-first slice of the vault, fenced as data and never as instructions.
  2. Propose. At session end, it proposes new records. Every write passes a local gate (secret and PII scan, injection linter, contradiction check) and is held for a human.
  3. Approve. A human verifies the record from the terminal. Only then does it become trusted memory. Git is the only transport, and the vault stays yours.

See it

[A terminal session: an AI client loads verified-first context under a token budget, a teammate proposes a fact that is held for human approval as a pull request, and a human verifies and inspects the record from the command line.]

What's inside

[Cohort has two parts: the engine (the cohort-mcp server, its tools, the write gate, and the CLI) and the retrieval and review intelligence that makes up the moat. Both run fully on your own machine with no hosted service.]

The vault, the engine, and the moat are free and open under Apache-2.0 and run fully on your own machine. Cohort runs entirely against your own GitHub repo: the maintainers never receive your vault, your sessions, or any telemetry. Cohort reads and writes your vault locally, under your control, with a human approving every write, and that processing happens on your machine, not ours.

The engine

cohort-mcp is a local stdio Model Context Protocol server, the client-neutral engine any MCP client can run. It loads bounded, fenced context and runs human-approved writebacks through a server-enforced gate.

MCP toolWhat it does
cohort_loadReturn bounded team context, fenced as data, verified-first, under a token budget.
cohort_proposeRun proposed records through the server-enforced write gate.
cohort_statusReport effective policy, record counts, the quarantine queue, and stale records.
cohort_policy_getReturn the caller's effective, read-only policy limits.
cohort_searchSearch the vault, honoring readable scope; verified-only by default.
cohort_whyReturn a record's provenance (who, which model, when) read from git history.

Some actions are human-run on the terminal by design, so the model can propose and read but never promote or retire a record:

CLIWhat it does
cohort initSeed policy, wire your client, print next steps.
cohort verifyPromote a record from quarantined to verified (human only).
cohort supersedeMark a record replaced; it leaves load but stays in git history.
cohort indexBuild the committed, diffable retrieval index (--check to verify).
cohort statsReport record counts, writebacks, stale records, and current load size.
cohort bridge / reabsorbGenerate AGENTS.md, CLAUDE.md, Cursor rules, and fold hand-edits back as gated proposals.
cohort export / importMove a whole vault losslessly on a portable schema.

The engine and CLI live in cohort-mcp/. It is published to npm as cohort-mcp and listed in the MCP Registry as io.github.magnusmage/cohort-mcp, so you can run it in one command:

sh
claude mcp add cohort -- npx -y cohort-mcp     # register with Claude Code# or just run it: npx -y cohort-mcp

For Claude Desktop there is a one-click extension: build a .mcpb from desktop-extension/ and double-click it to install. Or add this repo as a plugin marketplace and install the bundled plugin:

sh
claude plugin marketplace add magnusmage/cohortclaude plugin install cohort@cohort

Quickstart

Cohort runs inside an AI client that can reach your disk and git: Kimi Code CLI, Kimi Work desktop, ZCode, or Claude Code (CLI, desktop, or IDE extension). A web chat with no disk access cannot run it.

Install the connector (under a minute):

sh
curl -fsSL https://raw.githubusercontent.com/magnusmage/cohort/v0.3.0/install.sh | sh

The installer verifies the release checksum, then copies the connector skill into each client's skill folder on your machine. Prefer to read it first? Run curl -fsSLO .../install.sh, read it, then sh install.sh.

Then, in your client's chat input (not the terminal): type /cohort (/skill:cohort in Kimi Code CLI; the / Skills menu in Kimi Work desktop), or just say "set up my team vault". The connector explains what it does with your data and waits for your yes, walks you through GitHub sign-in and vault creation, and asks three consent choices. Every step waits for you.

Client support, step-by-step setup, and the developer path

Which client is this for?

ClientWorks with Cohort?
Kimi Code CLIYes, full setup and daily use.
Kimi Work desktopYes. Attach your vault folder as the workspace, then follow the same steps.
ZCodeYes, full setup and daily use.
Claude Code (CLI, desktop, or IDE extension)Yes, full setup and daily use.
Kimi Chat, Claude.ai web, other chats without disk accessNo. They cannot reach your disk or git. A teammate can export vault files into a chat project as read-only reference, with no sync back.

Step by step

  1. Open a terminal. Windows: use the terminal inside your client, or Git Bash. Mac: the Terminal app. Linux: your terminal app.
  2. Install: paste the curl line above and press Enter. You will see one installed cohort skill to ... line per client.
  3. Check it landed (optional): ls ~/.claude/skills/cohort (or ~/.kimi-code/skills/cohort, ~/.zcode/skills/cohort).
  4. Start your client in any project folder and load the skill as above.
  5. Answer the connector's questions in chat. It creates your vault repo (or links an empty one you made in the browser), then asks when it loads context, when it proposes updates, and what content it reads.

No curl or sh? Download the skill zip from the latest release, unzip it, and upload the cohort folder in your client's skill settings (use the skill zip under Assets, not Source code).

Developer path

sh
git clone https://github.com/magnusmage/cohort.gitsh cohort/scripts/setup.sh                              # seed a vault, ask consent, install the redaction hookcp -R cohort/connectors/claude ~/.claude/skills/cohort  # or connectors/kimi, connectors/zcode

Register the MCP engine with one command: cohort init --vault <dir> --agent <id>.

Daily use

You wantYou do
Team context at session startLoad the skill, or ask "load team context" (auto-loads with project scope)
Save a decision, fact, or open threadAsk the connector to propose a writeback; edit and approve the draft
Add a teammateAdd them as a GitHub collaborator on the vault repo. That is the whole sharing mechanism

Roadmap

Phases 1 to 5 are built, tested, and shipped on main. They are the whole product: the vault, the engine, and the moat, all running on your own machine.

  • Phase 1: Walking skeleton. Policy engine, record schema, git transport, write gate, and the first four tools.
  • Phase 2: Trust and safety spine. Trust tiers, human-only verification, the adversarial suite.
  • Phase 3: Session capture and search. Turn session notes into gated drafts; search the vault.
  • Phase 4: Adoption bridge. Generate and reabsorb AGENTS.md / CLAUDE.md / Cursor rules; portable export and import.
  • Phase 5: The moat. Git-native index, token-budgeted verified-first retrieval, contradiction detection, staleness and supersession, deterministic merge, and cohort_why.
  • Phase 6: Enterprise (in progress, parked). A review and audit dashboard with SSO, plus multi-vault access, at-rest encryption, and retention. It is intentionally not part of the released product and is kept on the phase-6-control-plane branch. If released later, the dashboard will be optional and run on your own infrastructure with its own privacy statement; the maintainers still never receive your data.

The full plan lives in docs/planning.

Security

Cohort is shared memory that many agents read and write, so the memory itself is an attack surface: a poisoned record could read back as an instruction to another teammate's agent. The project treats security as a property of every change. Stored memory and the model are untrusted; only approved, scanned writes land; loaded memory is fenced as data, never instructions; a contradicting fact is held for a human instead of overriding a verified one; and the server is the only component that ever commits. There is no telemetry and no network call beyond your own git remote, so the maintainers never receive your vault, your sessions, or anything else.

See the security model for the threat model, the redaction rules, and the consent model. Found a vulnerability? Please report it privately through GitHub's private vulnerability reporting on this repository, not as a public issue.

Where to read more

Repository layout

├── cohort-mcp/          The MCP server and CLI: the engine and the moat├── connectors/          Kimi, ZCode, and Claude connectors (Agent Skills standard)├── vault-template/      Blank vault scaffold (copied into your own repo)├── example-vault/       Synthetic demo vault (CC0, all content fictional)├── scripts/             Setup wizard and vault validator├── security/            Versioned gitleaks redaction rules├── install.sh           Pinned-tag installer for the connector skill└── docs/                The public spec, decision records, and diagrams

Contributing

See CONTRIBUTING.md. Commits use Conventional Commits and DCO sign-off (git commit -s). Security issues: please report privately via GitHub private vulnerability reporting, not public issues.

License and authorship

Apache-2.0 for code, CC BY 4.0 for docs, CC0 for example vault content. Created and maintained by Sarmad. See CITATION.cff for citation metadata.

来源:README.md,提交 28566a1

工具

6

cohort_load

Load team context

Return bounded team context from the vault, fenced as data not instructions.

输入参数scopetopics

cohort_propose

Propose a writeback

Run proposed records through the server-enforced write gate.

输入参数items必填

cohort_status

Vault and policy status

Report the effective policy summary and record counts from the vault.

无需输入参数。

cohort_policy_get

Read effective policy

Return the caller's effective, read-only policy limits. The model cannot write policy.yml.

无需输入参数。

cohort_why

Explain a record's provenance

Return who, which model, when, and why a record exists, read from git history. Read-only forensics.

输入参数id必填

版本历史

1
  1. v0.1.0最新Oct 29, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分