memfed
Federated, privacy-first shared memory for AI coding assistants that lets you capture, review, and share team knowledge via git without a central server.
README
memfed
Federated, privacy-first shared memory for AI coding assistants.
Your assistants (Claude Code, Codex, Crush, Cursor, …) each remember things — but only for you, and only in their own format. memfed turns those memories into team knowledge without a server, without accounts, and without ever sharing anything you didn't explicitly approve:
- Private by default. Every capture lands in a local store (
~/.memfed). Nothing leaves your machine except by an explicit, reviewed, redaction-gated action. - Federation = git. Shared memory lives in spaces — plain git repos. Auth is repo permissions, review is a PR, audit is git history. Any CLI user can create org memory with nothing but git.
- Tool-neutral. One record format, one MCP server, one managed
AGENTS.mdblock. Anything that speaks MCP or reads AGENTS.md participates. - Machines stage, humans publish. Assistants can propose sharing a memory; only you can publish it — after seeing the full body, the destination's readership, and every redaction finding.
- Collision awareness without surveillance. A session brief tells you which teammates were recently active in your areas and which decisions were just published — derived from metadata, honestly labeled "recent activity", never "live presence".
Spec: RFC-0001 · Status: v0.1 (working MVP) · License: Apache-2.0
The five pains this answers
| Pain (from market research) | memfed's answer |
|---|---|
| "I want to share some memories, never all" | Private-by-default store; per-record consent ceremony; MCP writes are staging-only |
| "My local memory never becomes org knowledge" | Candidate suggestions → review queue → publish; promote to org spaces via PR gate |
| "Desktop users get org memory, CLI users don't" | Pure CLI + git; an org space is memfed space init <git-url> away |
| "Privacy, but I don't want us colliding on work" | Metadata-only activity brief (memfed brief) with an OVERLAP section |
| "We use Claude Code AND Codex AND Crush" | Neutral records + MCP server + AGENTS.md projection; importers for existing stores |
Quickstart
npm install -g memfed-cli # installs the `memfed` command (npm package is memfed-cli;
# the unscoped name 'memfed' collides with npm's memfs similarity guard)
memfed init # private store at ~/.memfed
memfed doctor # check runtime, git identity, assistants on PATH
# --- create (or join) a team space: any git repo you can push to ---
memfed space init git@github.com:acme/platform-memory.git --name platform --kind team
# teammates: memfed space add git@github.com:acme/platform-memory.git
# --- capture privately (or let your assistant do it via MCP mem_add) ---
memfed add --project payments-api --type decision \
--title "Rotate refresh tokens on every exchange" \
--body "Reuse of a rotated token revokes the whole grant chain."
# --- share by consent: redaction gate -> full-body preview -> publish ---
memfed share <id> --to platform
# --- teammates pull it into every assistant ---
memfed sync # fetch/rebase/push + refresh projections
memfed search "refresh token" # your memory + the team's, labeled
# --- wire your assistants (per project, needs a .memfed.yaml marker) ---
printf 'project: payments-api\nspaces:\n - platform\n' > .memfed.yaml
memfed connect claude # .mcp.json + AGENTS.md managed block
memfed connect codex # codex mcp add + AGENTS.md
memfed connect cursor # .cursor/mcp.json + AGENTS.md
memfed connect crush # crush.json (experimental)
# --- start-of-session awareness ---
memfed brief --paths 'src/billing/**' # who's been in your areas + fresh decisions
memfed suggest --propose # deterministic share candidates -> review queue
memfed status # store, queue, spaces, promotion drift
# --- bring your existing memory along (lands private, as candidates) ---
memfed import claude-mem # decisions from ~/.claude-mem (read-only)
memfed import claude-native # Claude Code's per-project memory files
Run the whole story end-to-end on one machine (two personas, a bare remote, a planted fake AWS key that gets blocked, headless Claude Code retrieving the record via MCP):
demo/two-user-demo.sh --isolated
How sharing actually works
capture ──▶ suggest ──▶ propose ──▶ review ──▶ publish
(always (local (stages (human (direct push, or a
local) heuristics) only, even ceremony, memfed/proposals/<id>
for agents) full body) branch on pr-policy spaces)
- The publish boundary re-validates everything: policy re-read from the space's own manifest, redaction re-run on the exact bytes committed, authorship re-stamped from git config. Approving an incoming proposal re-runs the gate on the reviewer's machine too.
- Redaction: 23 deterministic secret rules (AWS/GitHub/Stripe/OpenAI/Anthropic/PEM/JWT/connection-strings/…) that block, keyword-gated entropy, and PII warnings with one-key fixes. Overrides are per-finding, typed, reasoned, and audited. It is a seatbelt, not a guarantee — a pushed secret is fixed by rotation, and the CLI says so.
- Lifecycle: published bodies are immutable — corrections
supersede, mistakesretract(tombstone), poison getsquarantined locally (kill-switch). Stale records age out of projections viareview_after. - Integrity: TOFU commit pinning makes a rewritten space history loud on every member's machine (
--accept-rewriteto adopt deliberately).
Security model in one paragraph
A record's scope is the set of git repos it's published to — there is no scope field to lie. Nothing on your machine is ever transmitted by search, dedup, or briefs (testable invariant); the first network act in a record's life is its publish commit. Agents can read team memory and stage proposals, but no MCP code path reaches git push. Projections into AGENTS.md are an index (attributed one-liners, hard token budget, style-sanitized), not a payload — one poisoned record has a one-line, attributed blast radius, and memfed quarantine kills it locally. Full threat model: RFC-0001 §16.
Development
npm ci
npm test # 74 tests: unit + git integration + MCP contract (incl. INV-2 security test)
npm run typecheck && npm run lint
npm run build # tsup -> dist/cli.js
./demo/two-user-demo.sh --cli-only --isolated # the CI demo subset
Works on Node ≥ 22.13 (node:sqlite) and Bun (bun:sqlite) through a driver seam. No native dependencies; git is shelled out to on purpose — your credential helpers and SSH agents are the auth model.
Status & roadmap
Implemented: records/store/index, spaces, direct + PR publish flows, redaction gate, sync with TOFU pinning, MCP server (5 tools), AGENTS.md projections, connect (claude/codex/cursor/crush*, --hook for a SessionStart brief), retract/supersede/quarantine/promote/gardening, importers (claude-mem, claude-native), activity briefs plus opt-in presence files (memfed presence set/show/off, TTL'd, hour-rounded, history-squashable via space prune-presence), space-side CI lint (memfed lint-space, workflow shipped by space init), gh pr sugar on GitHub remotes.
Also in: field-wise conflict auto-resolution during sync (status by safety precedence, lists unioned, remote body wins with your local body parked as a private draft), suggest (RFC §7.3 candidate detection), status (RFC §6.4 promotion drift), and in-repo spaces — memfed space init <url> --root .memory puts a space inside an existing code repo (audience = the repo's audience); joins auto-discover the root and use sparse checkouts, and memfed never touches files outside its root.
Not yet: embeddings, encrypted spaces (deliberately rejected for v1). See RFC-0001 §17.
* Crush stanza is spec-based but untested (not installed on the dev machine).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。