agentsmd-memory
An MCP server for project memory in AGENTS.md that returns merge/removal instructions for the agent to apply with its own edit tools.
Save durable, non-inferable project facts (decisions, conventions, gotchas, tooling quirks) via
memory_save, merging into the nearestAGENTS.md; creates it if missing.Forget outdated or wrong facts via
memory_forgetusing fuzzy natural-language matching, leaving other notes intact.Review and clean up existing notes via
memory_reviewwhen requested or after major changes.Select the target project with an optional absolute
cwd; default resolution checksAGENTS.mdthenCLAUDE.mdup to the Git root.Report word count against a soft
MEMORY_MAX_WORDSbudget; configure file name viaMEMORY_FILEand reminder viaMEMORY_NUDGE.
Integrates with GitHub Copilot coding agents to maintain project memory in AGENTS.md, allowing agents to record and remove facts like architecture decisions and commands.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agentsmd-memorysave that the project uses TypeScript with strict mode"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agentsmd-memory
MCP server for project notes in AGENTS.md. No dependencies. Requires Node.js 24+.
Tools return a file path and editing instructions. The agent makes the edits with its own tools, so changes appear in your Git diff.
Install
Codex
codex plugin marketplace add https://github.com/jryom/agentsmd-memory.git
codex plugin add agentsmd-memory@agentsmd-memoryRestart Codex, then review and trust the plugin hook with /hooks.
Claude Code
claude plugin marketplace add jryom/agentsmd-memory
claude plugin install agentsmd-memory@agentsmd-memoryBoth plugins install the MCP tools and a reminder hook. Node.js must already be installed.
opencode
Plugin supports OpenCode V2 and V1 1.18.29+. Configuration below is for V2; V1 configuration.
opencode plugin add github:jryom/agentsmd-memoryOr add the GitHub package reference to ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["github:jryom/agentsmd-memory"]
}Restart opencode after editing. Setup for Cursor, Claude Desktop, and Copilot.
V2 plugin provides native memory tools and the reminder; no separate MCP server is needed. Remove an existing memory MCP entry to avoid duplicate tools. Native tools require an explicit absolute cwd on every call, avoiding reliance on the plugin instance's directory when sessions move. Other clients and V1 continue to use MCP.
Related MCP server: mcp-memory-vault
Tools
Tool | Purpose |
| Assess and merge a fact or small batch of related facts |
| Correct or remove outdated guidance |
| Clean up existing notes when requested or after a major change |
The reminder asks the agent to consider saves at task completion. Most tasks should leave memory unchanged. Save decisions and gotchas that prevent future mistakes or expensive rediscovery; skip task summaries, duplicates, and facts already clear from code or docs.
For example, keep the reason a migration must use an API instead of direct database edits. Skip a note that npm test runs tests.
Saves report the file's word count against a soft budget. The budget does not truncate files or override essential instructions. The agent still decides what to keep. Existing project rules that demand saving every discovery need updating too.
Configuration
Environment variable | Default | Purpose |
| unset | Use one file name, such as |
|
| Soft file budget in whitespace-delimited words; positive integer |
| built-in reminder | Replace the plugin reminder; tool guidance still applies |
For MCP clients, set file and budget options in the server environment. For native OpenCode V2 tools, set them in the OpenCode process environment. Set the reminder override in the client environment. Disable the plugin hook to stop reminders.
By default, resolution checks AGENTS.md, then CLAUDE.md, at each directory up to the nearest Git root. The nearest file wins, including a nearer CLAUDE.md. Without Git, the search reaches the filesystem root. If no file exists, the tool proposes a file at the Git root or starting directory; the agent can skip creating it.
Pass an absolute cwd to select a project within an advertised MCP root. Invalid paths and paths outside advertised roots return errors. With multiple distinct roots, cwd is required; with one root it is optional. Without roots, selection uses cwd or the server's working directory. Symlinks are resolved before checking containment. Invalid path-like MEMORY_FILE values return errors rather than being shortened to a file name.
Development
Node.js LTS is pinned in .tool-versions. Use asdf install, mise install, or install that version directly.
npm test
npx @modelcontextprotocol/inspector node src/index.mjsLocal testing and releases. Changelog.
License
MIT
Available Tools
3 toolsmemory_forgetA
Correct or remove stored facts promptly when evidence shows they are wrong, superseded, or obsolete. Describe the facts in natural language; the agent checks evidence and edits them, with no automated fuzzy matching. Returns instructions for your own editing tools; preserves unrelated content and never writes files.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute existing project directory within advertised workspace roots. Required when multiple roots are available. | |
| description | Yes | Natural-language description of the fact(s) to remove. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses there is no automated fuzzy matching, that the agent must check evidence itself, that unrelated content is preserved, and crucially that it 'returns instructions for your own editing tools' and 'never writes files'. It omits permissions, concurrency, or reversibility details, but the non-destructive, advisory nature is clearly established.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two dense sentences that lead with the action and the trigger before the mechanics. Every clause carries information (no fuzzy matching, returns instructions, preserves content), though the second sentence stacks several clauses and could be split for readability.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-parameter mutation-adjacent tool with no output schema and no annotations, the description covers the important unknowns: what it returns ('instructions for your own editing tools'), that it is advisory rather than destructive, and that unrelated content is safe. Only minor gaps remain around cwd semantics and error behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is already 100% for both parameters, so the schema carries the semantics. The description reinforces the 'describe the facts in natural language' contract for the description parameter but adds no syntax or format guidance for cwd. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a concrete action on a concrete resource ('Correct or remove stored facts') and the trigger condition. However, the name says 'forget' while the description broadens the scope to 'correct', and it later reveals it does not actually delete anything — creating a slight mismatch an agent must reconcile. Sibling tools memory_save/memory_review are not explicitly contrasted.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear triggering conditions ('when evidence shows they are wrong, superseded, or obsolete') and an imperative ('promptly'), which tells the agent when this tool is appropriate. It does not name the alternatives (memory_save, memory_review) or state when NOT to use it, so routing between siblings is left implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_reviewA
Review and trim project memory when the user requests cleanup or a major project change makes guidance obsolete. Do not call every turn or after routine tasks. Returns the resolved file, word count, soft budget, and evidence-based cleanup instructions; never edits or deletes files itself.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute existing project directory within advertised workspace roots. Required when multiple roots are available. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations present, the description carries the full burden and does so: it discloses the return payload (resolved file, word count, soft budget, evidence-based cleanup instructions) and explicitly states the tool never edits or deletes files itself. That side-effect profile is the single most important behavioral fact for a memory-management tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, each with a distinct job: purpose, usage boundaries, behavior/return contract. Nothing is redundant and the triggering condition is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-annotation, one-parameter tool with no output schema, the description covers what the tool does, when to call it, what it returns, and what it will not do. No material gap remains for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is one parameter (cwd) with 100% schema description coverage, so the schema already explains its meaning and the multi-root requirement. The description adds no syntax or format detail beyond that, which is the expected baseline when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description pairs a specific verb ('review and trim') with a specific resource ('project memory') and clarifies the tool's role: it inspects and produces cleanup instructions rather than mutating. This distinguishes it from the sibling tools memory_save and memory_forget, which is exactly the routing signal an agent needs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives both positive triggers ('when the user requests cleanup or a major project change makes guidance obsolete') and explicit exclusions ('Do not call every turn or after routine tasks'). This is textbook when/when-not guidance and leaves nothing to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_saveA
Consider saving non-obvious project decisions or gotchas at task completion only when they prevent a likely future mistake or substantial repeated work. Skip facts cheaply discoverable from code or docs, task summaries, temporary state, and duplicates. Batch related learnings; no update is usually needed. Returns a resolved memory path, size guidance, and instructions to assess and merge with your own editing tools; never writes files or requires saving a low-value candidate.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute existing project directory within advertised workspace roots. Required when multiple roots are available. | |
| learning | Yes | Concise candidate fact, or a small batch of related facts, that would prevent future mistakes or substantial repeated work. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses that the tool returns a resolved path, size guidance, and merge instructions, and that it never writes files. The somewhat ambiguous final clause ('never writes files or requires saving a low-value candidate') muddies whether a write occurs, leaving a small gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The usage guidance is front-loaded well, but the passage is a dense run-on paragraph whose final clause ('never writes files or requires saving a low-value candidate') is grammatically tangled and could mislead. Tightening would improve it without losing content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, and the description compensates by describing what is returned (resolved memory path, size guidance, merge instructions). For a 2-parameter tool with full schema coverage, little is missing; only the write-vs-resolve semantics could be stated more crisply.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for both parameters, so the baseline is 3. The description adds only marginal meaning (batching 'related' learnings maps to the learning param), but cwd and learning syntax are fully covered by the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description makes clear this is about capturing non-obvious project decisions/gotchas as memories and resolves them to a memory path, and the closing clause distinguishes its behavior from a plain file-writing save. It does not explicitly name memory_review or memory_forget, so sibling differentiation is only implicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit when-to-use ('at task completion only when they prevent a likely future mistake or substantial repeated work'), explicit when-not (cheaply discoverable facts, task summaries, temporary state, duplicates), and batching guidance. This is close to ideal routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.7.0- Changed
memory_forget1 field changed- changed
Input schema / properties / cwd / descriptionPrevious value: -"Absolute path of the current project directory."New value: +"Absolute existing project directory within advertised workspace roots. Required when multiple roots are available."
- Added
memory_review - Changed
memory_save2 fields changed- changed
Input schema / properties / cwd / descriptionPrevious value: -"Absolute path of the current project directory."New value: +"Absolute existing project directory within advertised workspace roots. Required when multiple roots are available." - changed
Input schema / properties / learning / descriptionPrevious value: -"The durable fact to remember, stated concisely."New value: +"Concise candidate fact, or a small batch of related facts, that would prevent future mistakes or substantial repeated work."
2 tool updates
v1.1.0- First observed
memory_forget - First observed
memory_save
TDQS
Scored across 3 tools
memory_save (add facts), memory_forget (fix/remove wrong facts), and memory_review (bulk cleanup on request) target largely distinct actions, and the descriptions explicitly distinguish the triggers. There is mild overlap between forget and review since both edit existing content, but the conditions (evidence-based correction vs. user-requested cleaning) keep them separable.
All three tools follow an identical memory_<verb> pattern with clear, action-oriented verbs (save, forget, review). The convention is fully consistent and readable.
Three tools is on the thin side but each maps to a distinct memory lifecycle action (add, correct, clean), so none feel redundant. It sits at the low end of the ideal range but is defensible for this narrow purpose.
Save, correct/forget, and prune are covered, but there is no explicit read/list/recall tool to surface stored memory, and none of the tools actually writes files (all return instructions for the agent's own editing tools). The lifecycle is mostly present but has a notable retrieval gap.
Maintenance
Related MCP Connectors
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
An MCP memory server. One memory your agents share — across models, devices and apps.
Long-term memory for AI coding agents: durable project facts, recalled by every MCP client.
Cloud-hosted MCP server for durable AI memory
Related MCP Servers
AlicenseNot gradedqualityAmaintenanceMCP server providing cognitive memory tools (remember, recall, think, etc.) for AI agents, enabling forgetting, consolidation, and contradiction detection.176Apache 2.0- AlicenseAqualityBmaintenanceAn MCP server that gives agents persistent memory with namespaced facts, tags, full-text search, and TTL expiry, all running locally on SQLite with zero external dependencies.83MIT
- AlicenseAqualityCmaintenanceMCP server providing persistent memory for AI agents, enabling them to read, write, and query memories across sessions.94 npmMIT
- AlicenseAqualityAmaintenancePersistent project context (AGENTS.md), cross-session memory, and identity — discoverable by any MCP client.10792 npm3MIT