Markdown memory for AI agents. Files you can read, edit, grep, and commit. Not a database.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Guardrails for AI coding agents β write the rule once, every tool obeys, destructive actions get blocked.
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:
AGENTS.md, CLAUDE.md, .cursor/rules/, and .gemini/ automatically β Claude Code, Cursor, Cline, Copilot, Gemini and Windsurf read the same rules, no plugin.cat it, grep it, edit it in vim, commit it to git, sync it across machines with agent-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.
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.)
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.
| Target | Path | Auto-loaded by |
|---|---|---|
agents | AGENTS.md | Claude Code, Codex CLI, Cursor, Aider, Devin, Copilot, Gemini CLI, Windsurf, Amazon Q |
claude | CLAUDE.md | Claude Code (5-level hierarchy Β· managed/global/project/local/subdir) |
cursor | .cursor/rules/operator-hard.mdc (alwaysApply: true) + operator-conventions.mdc (agent-requested) | Cursor (MDC format) |
gemini | .gemini/instructions.md | Gemini CLI |
Set AGENT_MEMORY_AUTO_EMIT_DIR=/path/to/project and the server re-emits all four files automatically on every rule save.
check_action Β· the protocol enforcement pointMCP 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.
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.
audit Β· operational health for the rule storeSurfaces:
last_verified > 90 days, or never verifiedenforce_on AND an identical regex in matchescheck_action calls that blocked an action (spot over-aggressive rules)delete_memory without going through check_actionThe healthy flag is true iff no stale rules, no conflicts, no unreceipted ops.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/agent-memory-mcp-3)<a href="https://allmcps.com/mcp/agent-memory-mcp-3"><img src="https://allmcps.com/api/badge/agent-memory-mcp-3?style=directory" alt="Agent Memory MCP on AllMCPs" /></a>