
Agent Memory Mcp
io.github.xultrax-web由 GitHub 账号 xultrax-web 发布v0.15.0更新于 Oct 24, 2026
Markdown memory for AI agents. Files you can read, edit, grep, and commit. Not a database.
发布方自己的服务:Memory.fit
概览
为 AI 编程助手提供基于 Markdown 的记忆存储,以及可强制执行、能拦截破坏性操作的规则。
- 可以做什么
- 把记忆保存为带 YAML frontmatter 的纯 Markdown 文件,按类型划分(user、feedback、project、reference、rule)。工具涵盖保存、模糊搜索、检索、列表、软删除与恢复、完整性检查、统计、审计日志、反向链接与关联记忆发现,以及 git 同步推送/拉取。规则类记忆带有严重级别、作用范围、正则匹配与执行类别,并可投射到 AGENTS.md、CLAUDE.md、.cursor/rules 和 .gemini 文件。check_action 工具会依据这些规则评估拟执行的操作,并可签发短期有效的签名凭据,delete_memory 必须提供该凭据。
- 适用场景
- 当你希望记忆能跨会话、跨工具持久保存且人类可读,或希望写下的规则真正拦截破坏性操作而不是停留在配置文件里时,适合使用。它适合偏好用 grep、编辑器和版本控制管理记忆文件的开发者。若需要向量相似度检索或图查询,数据库型记忆服务器更合适。
- 运行要求
- 通过 stdio 在本地运行,由 MCP 客户端启动;可用 npx @xultrax-web/agent-memory-mcp 或全局 npm 安装,因此需要 Node.js。可选环境变量:AGENT_MEMORY_DIR 指定自定义存储路径,AGENT_MEMORY_SCOPE=global 使用 ~/.agent-memory/,AGENT_MEMORY_LOG 设置日志级别。未声明认证或 API 密钥。git 同步需要已配置的远程仓库。
安装
在 SourceWeft 中
- 打开 控制台中的 Agent Memory Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agent-memory-mcp
Guardrails for AI coding agents — write the rule once, every tool obeys, destructive actions get blocked.
[Add to Cursor] [Install on Smithery]
Your AI coding agent will eventually try to rm -rf the wrong folder, force-push to main, or delete the file you actually needed. agent-memory-mcp is the memory layer where you write the rule once, in plain markdown — and it enforces itself:
- Blocks destructive actions at the protocol layer. The agent proposes an action; the server checks it against your rules and either refuses it or issues a short-lived, signed Compliance Receipt it must present to act. Soft rules in a config file get ignored — this doesn't.
- One rule, every tool. Save it once and it emits to
AGENTS.md,CLAUDE.md,.cursor/rules/, and.gemini/automatically — Claude Code, Cursor, Cline, Copilot, Gemini and Windsurf read the same rules, no plugin. - Plain files you own.
catit,grepit, edit it in vim, commit it to git, sync it across machines withagent-memory sync. No database, no daemon, no cloud — and if the AI gets it wrong, you fix it in a text editor.
Memory — the rules, recipes, decisions, and context that survive every session and every tool — is the substrate. Enforcement is the point. Reference implementation of the Compliance Receipt Protocol 1.0, so other MCP servers can adopt the same receipts and interoperate.
Quickstart · guarded in 60 seconds
Your agent is now guarded across every tool. Write your own rules with save_rule — they enforce and emit to AGENTS.md / CLAUDE.md / .cursor/rules / .gemini. (CLI commands assume a global install — npm i -g @xultrax-web/agent-memory-mcp — or prefix with npx -y.)
Memory as constraint · the v0.11 → v0.13 arc
What v0.10 and below shipped: a great file-based memory store. What v0.11+ added: rules that enforce themselves. A rule memory type carries severity (hard / soft), scope, applies_when, matches regex patterns, enforce_on categories, and last_verified date. From those, the server projects companion files out to every AI tool and gates destructive operations via cryptographic receipts.
1. Rule memories project to every tool
Set AGENT_MEMORY_AUTO_EMIT_DIR=/path/to/project and the server re-emits all four files automatically on every rule save.
2. check_action · the protocol enforcement point
MCP shape:
Tier 1 (deterministic, every client): action matched against rule.matches regex, filtered by rule.enforce_on. Hard violations block. Soft violations warn. Approved actions get a fresh receipt with 60s TTL.
Tier 2 (Sampling-enriched, shipped v0.11.7): for rules with applies_when natural-language conditions, the server uses MCP Sampling to ask the client's LLM whether the proposed action triggers the rule. Falls back to Tier 1 only if the client doesn't advertise Sampling capability. Works on Claude Desktop and VS Code Copilot; on Claude Code, Cursor, Cline, and Codex CLI you get Tier 1 only — which is enough to enforce the rules you've written.
But check_action only gates this server's own tools. To enforce your rules on the agent's real actions — the shell commands and file writes it runs — agent-memory install-hooks wires a PreToolUse hook into Claude Code: a hard rule denies the matching tool call, a soft rule asks you. Now an rm -rf or a force-push to main is actually blocked, not just advised. Run agent-memory init first for a starter ruleset.
3. Compliance Receipts · the cryptographic primitive
Receipts are short-lived, signed bearer tokens with caveats (Macaroon pattern · Birgisson et al., NDSS 2014). The novel protocol primitive: server-issued tokens that bind to action + session + rules-version-hash + expiry. Tampering breaks the signature. Rule changes invalidate every outstanding receipt (because rules_version is part of the signed payload).
Receipt-required delete_memory (v0.12.0 breaking change): calling delete_memory without a valid receipt is refused. The two-step pattern is check_action → delete_memory(name, receipt). The signing-key file lives at <MEMORY_DIR>/.keyring/hmac-key (CRP 1.0) or <MEMORY_DIR>/.keyring/ed25519-priv (CRP 1.1), 0600 perms on POSIX. Receipts are bound to their specific target (the action_hash caveat for delete memory <name>) and are single-use; the .keyring/ is never committed or synced, and rotate_key regenerates it after a suspected leak.
CRP 1.1 · Ed25519 federation (v0.13.0): flip CRP_SIGNING_MODE=ed25519 and the server signs with an asymmetric keypair instead of HMAC. The public key gets published at <MEMORY_DIR>/.keyring/ed25519-pub, so other MCP servers can validate your receipts without sharing a secret. The protocol allows cross-server enforcement: server A issues a receipt for "delete X", server B validates and honors it.
4. audit · operational health for the rule store
Surfaces:
- Rule count by severity (hard / soft / unspecified)
- Stale rules ·
last_verified> 90 days, or never verified - Pattern conflicts · two rules sharing an
enforce_onAND an identical regex inmatches - Recent denials ·
check_actioncalls that blocked an action (spot over-aggressive rules) - Unreceipted destructive ops · should be empty in v0.12+; non-empty means a client is calling
delete_memorywithout going throughcheck_action
The healthy flag is true iff no stale rules, no conflicts, no unreceipted ops.
5. CRP 1.0 / 1.1 as a portable spec
The receipt protocol is documented standalone at docs/compliance-receipt-protocol-1.0.md. Other MCP servers can adopt the same format + validation rules to interoperate · agent-memory-mcp is the reference implementation. The spec covers: receipt structure, canonical encoding, signing (HMAC-SHA256 for 1.0, Ed25519 for 1.1), validation order, rules-version hashing, reserved caveat types, MCP integration patterns, security considerations, cross-server adoption, and test vectors.
What you get
A memory file is just markdown with YAML frontmatter:
That's the whole format. No magic. Read it, edit it, ship it.
Why this exists
Most MCP clients have no persistent memory. The ones that do (Claude Code) store it where only that client can see it. The official server-memory and every community alternative use opaque structured backends. That's fine for some workflows — but it puts your data behind a layer you can't read with cat.
We chose markdown because:
- Universal. Every developer can read markdown. Every editor handles it. Every diff tool understands it.
- Portable. Memories travel with the project (per-project default) or with you (global mode). Move them, copy them, fork them — they're just files.
- Inspectable. You can audit what your AI assistant "knows" by opening a folder.
- Repairable. When a memory is wrong, you fix it the way you fix any text file. No SDK, no API, no SQL.
- Versionable. Git understands every change. No JSON merge conflicts. No binary blobs.
If you want vector similarity search, semantic recall, or auto-relation extraction — use one of the database-backed memory MCPs. They're great at that. If you want memory that you can still read after a power outage, this is for you.
Install
From npm (recommended)
Listed in the MCP Registry
io.github.xultrax-web/agent-memory-mcp · browse at https://registry.modelcontextprotocol.io
Build locally
The server speaks MCP over stdio. You don't run it directly — your MCP client launches it.
Client configuration
Same JSON, slightly different paths per client.
Cursor
~/.cursor/mcp.json (or .cursor/mcp.json in your project):
Cline (VS Code extension)
Cline → MCP Servers → Add:
VS Code (Copilot Chat)
Two VS Code paths. The Cline section above is for the Cline extension specifically (its own MCP server UI). This section is for VS Code's native MCP support — GitHub Copilot Chat reads it directly. Pick whichever matches your assistant; both coexist fine.
.vscode/mcp.json (workspace) or via User Settings → Edit mcp.json:
Claude Desktop
%APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
Windows note: if
npxdoesn't resolve cleanly, wrap withcmd /c:
Continue.dev
~/.continue/config.json:
Storage scope
Per-project (default): memories live in ./.agent-memory/ relative to wherever the client launched the server. Usually that's the project root.
Personal / global pool:
Global memories live at ~/.agent-memory/.
Custom path:
Tools
Prompts
The server exposes 4 built-in MCP prompts that clients (Claude Desktop, Cursor, etc.) surface as slash-commands. These turn memory into an active workflow layer, not just a passive store:
Memory types
Five built-in types. The first four match the Claude Code convention; rule is what v0.11 added:
- user — facts about the person (role, preferences, expertise level)
- feedback — soft guidance for the assistant (prefer this style, lean toward that approach)
- project — current-state context that isn't in the code (deadlines, in-flight work)
- reference — pointers to external systems (Linear board URL, monitoring dashboard)
- rule — constraints to enforce, not just facts to recall. Carries
severity,scope,matches,enforce_on,applies_when,last_verified. Projects to companion files; gatescheck_action.
Tags + wiki-links
Beyond types, two cross-cutting organization features:
Tags — optional tags: [a, b, c] array in frontmatter. Queryable via list_memories({tags: [...]}) and the agent-memory list --tags "a,b" CLI. Filter is intersection — memories must have all listed tags. Tag names are lowercase a-z + digits + hyphen/underscore, max 40 chars.
Wiki-links — write [[memory-name]] anywhere in a memory body and it becomes a link. find_backlinks returns memories that reference a given one; find_related ranks the full graph (outbound links, inbound backlinks, shared tags, content similarity) for discovery navigation.
CLI
The same binary is also a command-line tool. Useful in shell scripts, git hooks, cron, or just for quick lookups outside your editor.
Multi-machine memory (git sync)
The killer feature for file-based memory: every dev machine has git, and markdown merges cleanly. agent-memory sync turns .agent-memory/ into a git repo pointed at a (private) remote, and your memories follow you across desktop/laptop/server.
What's NOT synced (per-machine state, kept local):
.lock— per-process file lock.events.jsonl— per-machine audit trail.trash/— soft-delete staging
What IS synced: every memory file, the MEMORY.md index, and any .gitignore you add.
Commits use the identity agent-memory <agent-memory@local> by default — set GIT_AUTHOR_EMAIL / GIT_COMMITTER_EMAIL in your environment if you want per-machine attribution.
Audit log + structured logging
Every mutation appends one JSON line to .agent-memory/.events.jsonl:
Read it any way you want: cat, jq, the log / log_events tool, or a sidecar that ships it to your observability stack.
Operational logging is separate. Set AGENT_MEMORY_LOG=debug|info|warn|error (default info) and structured lines stream to stderr — won't pollute the MCP stdio channel.
Color output is on by default in TTYs. Set NO_COLOR=1 to disable, FORCE_COLOR=1 to force-enable in pipes.
Multi-line content can come from a file or stdin:
Importing from Claude Code
If you've been using Claude Code's built-in memory, bring it over:
The importer walks ~/.claude/projects/*/memory/, parses each memory's YAML frontmatter (tolerantly — malformed files don't kill the run), flattens Claude Code's metadata.type field to top-level type, and writes to your current store. Existing memories with the same name are skipped unless you pass --overwrite.
Why files, not a database
You give up native semantic similarity search and structured entity-relation queries. You get a memory store that survives every tool change, every machine swap, every "wait, what was that AI telling me about this codebase six months ago?" — and that you can still read after a power outage.
The trade is real. For workflows that need vector recall or graph queries, a database-backed memory is the right tool. For workflows where memory is something you want to grep, edit, version-control, and audit by hand, this is.
Operator-grade by design
This server is built to be used daily, not to demo well once.
Shipped in v0.3:
- Atomic writes — tmp-file + rename pattern. Power-loss never leaves a half-written file.
- File locking —
proper-lockfilearound every mutation. Concurrent MCP server + CLI access can't corrupt the index. - Soft delete —
delete_memorymoves to.trash/<timestamp>-<name>.md.restore_memorybrings it back. - Index recovery —
agent-memory doctorreports orphan files, dangling entries, and parse errors.--rebuild-indexrewritesMEMORY.mdfrom disk. - Schema versioning — every memory file gets a
schema: 1field so future format changes can migrate cleanly. - Spec-compliant Resources —
agent-memory://index+agent-memory://memory/{name}; clients can pin them as always-visible context.
Shipped in v0.4:
- Append-only event log at
.events.jsonl— every mutation timestamped + JSON-structured for audit. agent-memory stats— dashboard of counts per type, total/avg/largest size, audit + trash counts.agent-memory log— paginated browser of the event log, filterable by action.- Structured stderr logging —
AGENT_MEMORY_LOG=debug|info|warn|error; safe to use alongside MCP stdio. - Color output — auto-detected via TTY, respects
NO_COLOR/FORCE_COLOR.
Shipped in v0.5:
- Fuse.js fuzzy search with field weights (name×3, description×2, body×1). Typo, partial, and word-order tolerant.
- Snippet highlighting — body-context excerpts shown under each match with
...markers. - Relevance scoring — Fuse score inverted + scaled to 0-100 for human readability.
relevant_memories(query, max=5)— sister tool to search that returns FULL memory bodies as a single markdown doc, built for LLM auto-context loading.- Pagination —
offset+limitonlist_memoriesandlimitonsearch_memories.
Shipped in v0.6:
- Vitest test suite — 25+ blackbox tests covering CLI + MCP server paths.
- GitHub Actions CI — runs tests on every push/PR across Node 20/22/24.
- COMPATIBILITY.md — known-working client matrix + quirks.
Shipped in v0.7 · the active context layer:
- MCP Prompts capability — 4 built-in workflows (
extract_memories,summarize_topic,prepare_handoff,audit_stale) that the client surfaces as slash-commands. verify_memorytool — static analysis of a memory's URLs/dates/file refs with type-specific staleness heuristics. Plus the matchingagent-memory verify <name>CLI.- Conflict detection on save — fuzzy-matches new memories against existing ones; warns on near-duplicates without blocking the save (so the LLM can decide whether to merge, rename, or proceed).
Shipped in v0.8 · organization at scale:
- Tags — optional
tags: [...]array in frontmatter. Queryable vialist_memoriesandagent-memory list --tags "a,b". Intersection filter. [[wiki-links]]— write[[memory-name]]in any memory body, auto-detected.find_backlinkstool +agent-memory backlinks <name>CLI — "what links to this".find_relatedtool +agent-memory related <name>CLI — combines outbound + inbound links, shared tags, type match, and content similarity into a ranked discovery view.
Shipped in v0.9 · the moat — multi-machine memory via git:
agent-memory sync init <remote-url>— convert.agent-memory/into a git repo, push to remote.agent-memory sync push— auto-commit local changes + push.agent-memory sync pull— fast-forward from remote.agent-memory sync status— local state + commits ahead/behind origin.agent-memory sync log— history of cross-machine memory changes.sync_status/sync_push/sync_pullMCP tools — the LLM can do this too.- Per-machine state (
.lock,.events.jsonl,.trash/) auto-excluded from sync. - Default commit identity injected (
agent-memory@local) so machines withoutgit config --global user.emailwork without setup.
Shipped in v0.10 · the visual identity (TUI):
agent-memory ui— Ink-based terminal UI for browsing, filtering, searching, and editing memories without leaving the terminal.- Type-filter quick-keys (0-4 cycle through all/user/feedback/project/reference)
- Fuzzy live search with
/ eopens the highlighted memory in$EDITOR(vim/notepad/nano/whatever) — saves back to diskdsoft-deletes withy/nconfirmation- Detail pane previews the body of the selected memory
- Color-coded by type, tag chips inline
Shipped in v0.11 · memory as constraint:
rulememory type withseverity/scope/matches/enforce_on/applies_when/last_verifiedsave_rule+list_rulestools and CLI commandsemit_companionsprojects rules toAGENTS.md+CLAUDE.md+.cursor/rules/*.mdc+.gemini/instructions.mdAGENT_MEMORY_AUTO_EMIT_DIRtriggers re-emission on every rule save- Compliance Receipts (
issueReceipt/validateReceipt) — HMAC-SHA256 bearer tokens with Macaroon-style caveats, bound torules_versionso rule changes invalidate outstanding tokens check_actionMCP tool (Tier 1 deterministic; Tier 2 Sampling-enriched on v0.11.7 for clients that advertise the capability)auditcommand — stale rules, pattern conflicts, recent denials, unreceipted destructive ops- CRP 1.0 protocol spec — portable, vendor-neutral
Shipped in v0.12 · the wedge made teeth (breaking change):
delete_memoryREQUIRES a valid receipt. Calling without one is refused at the tool boundary.- Two-step pattern is canonical:
check_action→ receipt →delete_memory(name, receipt) - Audit log no longer needs an "unreceipted ops" warning class to surface escapes — there are none
Shipped in v0.13 · cross-server federation:
- CRP 1.1 · Ed25519 asymmetric signing (set
CRP_SIGNING_MODE=ed25519) - Public key published at
<MEMORY_DIR>/.keyring/ed25519-pubso other servers can validate without sharing a secret - 9 dedicated Ed25519 tests verifying keypair generation, signing, and cross-server validation paths
Roadmap
Released
Coming next
- Receipt-gated
restore_memoryanddoctor --rebuild-index(samecheck_actionflow) - Federation example · a second reference MCP server that issues + validates CRP 1.1 receipts
- Auto-context loading — server hook that auto-fires
relevant_memoriesbefore each LLM turn - Folder support inside the store (
.agent-memory/work/,.agent-memory/personal/) - Memory packs — export/import shareable
.tar.gzbundles of curated memories - Browser companion UI (
agent-memory web) - TUI polish — file-watching for auto-refresh, inline editing, sync as keybindings
Beyond
Optional local-embeddings sidecar (transformers.js, no API), team mode with diff/merge, browser extension to capture from chatgpt.com / claude.ai → memory, mobile companion.
Open an issue if you want one of these before I get to it.
License
MIT. Use it for whatever.
Author
@xultrax-web · built for the cross-client memory problem I kept running into. Part of Peach & Madison Design.
Inspired by the file-based memory system in Anthropic's Claude Code.
来源:README.md,提交 786313c
工具
0版本历史
1- v0.15.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Memory 集成

Memory.fit
fit.memory官方发布者
托管式 Memory.fit 服务器,让 AI 读取你的训练、睡眠、恢复与饮食数据,并写回每周计划、每日目标和饮食计划。
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pg官方发布者
pg.ddx.io: the PostgreSQL community's memory 的托管 MCP 服务,由 pg.ddx.io 发布;无需登录;Streamable HTTP;29 个工具。
var.gg Naming Memory
gg.var官方发布者
远程 MCP 服务器,可根据领域概念推荐并检索韩、日、中、越、英多语言的代码标识符名称,并提供 ERD 结构查询。

Counterparts
ai.counterparts
面向 Claude Code 与 Claude Desktop 的本地优先长期记忆:助手自行写下关于你和项目的笔记,并在之后的会话中回忆起来。

LAHZE - Persian AI Memory Platform
由 GitHub 账号 pedramgholizadeh 发布
以波斯语为先的地理记忆平台:发现地点,起草并发布仅限波斯语的记忆。AI 翻译