Skip to main content
Glama
agentsmd-memory

agentsmd-memory

by jryom

agentsmd-memory

npm ci license

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-memory

Restart 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-memory

Both 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-memory

Or 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

memory_save

Assess and merge a fact or small batch of related facts

memory_forget

Correct or remove outdated guidance

memory_review

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

MEMORY_FILE

unset

Use one file name, such as GEMINI.md, instead of the default candidates

MEMORY_MAX_WORDS

1000

Soft file budget in whitespace-delimited words; positive integer

MEMORY_NUDGE

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.mjs

Local testing and releases. Changelog.

License

MIT

Available Tools

3 tools
memory_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.

Inputs: description (required), cwd.

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.

Inputs: cwd.

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.

Inputs: learning (required), cwd.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 3 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    All three tools follow an identical memory_<verb> pattern with clear, action-oriented verbs (save, forget, review). The convention is fully consistent and readable.

    Tool Count4/5

    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.

    Completeness3/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server providing cognitive memory tools (remember, recall, think, etc.) for AI agents, enabling forgetting, consolidation, and contradiction detection.
      180
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      An 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.
      8
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server providing agents with persistent working, episodic, and semantic memory backed by CockroachDB, exposed via tools to store, recall, list, and forget memories.
      MIT