agentsmd-memory
The agentsmd-memory server enables AI agents to maintain durable project memory in markdown files (AGENTS.md with fallback to CLAUDE.md) by providing two tools:
memory_save: Persist a concise, durable fact (e.g., decisions, conventions, commands, gotchas, lessons learned) to the nearest memory file. Call proactively when learning something non-inferable or when wrapping up a task. It returns merge instructions; if no file exists, it creates one at the git root.memory_forget: Remove outdated or incorrect facts using a natural-language description. Fuzzy matching locates the relevant entry, and instructions are returned for editing.
Key features:
Non-destructive: Tools never write directly—the agent applies changes with its own Read/Edit tools, so every modification appears as a reviewable git diff.
Auto-location: Resolves the nearest memory file by walking up to the git root, preferring
AGENTS.mdoverCLAUDE.md. Configuration viaMEMORY_FILEandMEMORY_NUDGEenvironment variables.Proactive reminders: Integrates with platforms like Claude Code, OpenAI Codex, opencode, GitHub Copilot, and more to inject per-turn nudges, encouraging timely use of memory tools.
This approach ensures that project knowledge persists across sessions, avoids rediscovery, and stays accurate.
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 "Install 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 keeping project memory in AGENTS.md. Zero dependencies.
The tools don't edit files. They resolve the nearest memory file and return instructions the agent carries out with its own Write/Edit tools, so every change — even creating the file — shows up as a reviewable git diff.
Tools
memory_save— record a durable fact (decision, convention, gotcha, non-obvious command).memory_forget— remove a stale fact.
Related MCP server: Agent Memory MCP
Install
Published on npm as agentsmd-memory. Runs via npx — no global install needed. The config schema differs per client; expand yours below. On Windows, wrap the command as cmd /c npx -y agentsmd-memory.
Installs the MCP tools and same per-turn UserPromptSubmit nudge used by Claude Code:
codex plugin marketplace add https://github.com/jryom/agentsmd-memory.git
codex plugin add agentsmd-memory@agentsmd-memoryRestart Codex after installation. Review and enable the plugin hook with /hooks; Codex requires explicit trust for plugin hooks. Override reminder text with MEMORY_NUDGE.
Installs the MCP tools and a per-turn nudge in one step (see why the nudge helps; Claude Code delivers it via a UserPromptSubmit hook):
claude plugin marketplace add jryom/agentsmd-memory
claude plugin install agentsmd-memory@agentsmd-memoryOverride the reminder text with the MEMORY_NUDGE env var. No file config needed: the tools prefer AGENTS.md and fall back to CLAUDE.md, which Claude Code auto-loads (see Config).
Tools without the nudge:
claude mcp add --transport stdio memory -- npx -y agentsmd-memoryclaude_desktop_config.json or .cursor/mcp.json:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "agentsmd-memory"]
}
}
}~/.config/opencode/opencode.json. Note the differences: top-level mcp (not mcpServers), command is a single array, env goes in environment (not env).
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"memory": {
"type": "local",
"command": ["npx", "-y", "agentsmd-memory"],
"enabled": true
}
},
"plugin": ["agentsmd-memory"]
}The plugin line is recommended — see per-turn reminder. It loads from npm by name, so it requires agentsmd-memory >= 1.2.0; restart opencode after editing.
.vscode/mcp.json (project) or your user mcp.json. Top-level key is servers and the type is stdio:
{
"servers": {
"memory": {
"type": "stdio",
"command": "npx",
"args": ["-y", "agentsmd-memory"]
}
}
}copilot mcp add memory -- npx -y agentsmd-memoryOr edit ~/.copilot/mcp-config.json directly. Copilot CLI requires type: "local" and a tools field:
{
"mcpServers": {
"memory": {
"type": "local",
"command": "npx",
"args": ["-y", "agentsmd-memory"],
"tools": ["*"]
}
}
}Repo → Settings → Copilot → MCP servers. Same shape as the CLI (type: "local", tools required). Any env vars must be prefixed COPILOT_MCP_.
{
"mcpServers": {
"memory": {
"type": "local",
"command": "npx",
"args": ["-y", "agentsmd-memory"],
"tools": ["*"]
}
}
}Per-turn reminder
The tools are prompt-driven — the agent only calls them if it decides to, which rarely happens mid-task. The package ships integrations for opencode, Claude Code, and Codex that inject a short reminder every turn (opencode via the system prompt; Claude Code and Codex via a UserPromptSubmit hook), so the agent reliably reaches for memory_save/memory_forget. The opencode plugin is enabled via the "plugin": ["agentsmd-memory"] line in the config above. Override reminder text with MEMORY_NUDGE.
Config
Env | Default | Purpose |
| (unset) | Pin the target to a single file name, e.g. |
| built-in reminder | opencode/Claude Code/Codex plugin only. Overrides the per-turn reminder text. To skip injection, don't load or enable the plugin hook. |
When MEMORY_FILE is unset the tools prefer AGENTS.md, then fall back to CLAUDE.md. So a Claude Code repo that only has CLAUDE.md (which Claude auto-loads; it doesn't read AGENTS.md) is found without any config, while AGENTS.md stays preferred for cross-tool sharing when present.
Notes
Claude Code and Codex plugin installs launch the MCP server through unpinned
npx -y agentsmd-memory, intentionally following npm'slatesttag. npm may download package code on startup and caches fetched packages.Workspace dir is resolved from MCP roots, else a
cwdarg, elseprocess.cwd(). From there it walks up to the git root; the nearest existing file wins, and at a given levelAGENTS.mdbeats theCLAUDE.mdfallback. When nothing exists,AGENTS.mdis created at the git root.The tools never write files. When no memory file exists,
memory_savereturns instructions to create one; the agent authors it with its own Write tool, so even bootstrapping shows up as a reviewable diff.Saves are prompt-driven; the agent decides when to call them. Bundled integrations nudge it every turn.
Develop
npm test
npx @modelcontextprotocol/inspector npx -y agentsmd-memorySource: github.com/jryom/agentsmd-memory.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
Alicense-qualityAmaintenanceMCP server providing cognitive memory tools (remember, recall, think, etc.) for AI agents, enabling forgetting, consolidation, and contradiction detection.171AGPL 3.0- AlicenseBqualityAmaintenanceMCP server for agent-maintained memories, allowing creation, reading, updating, deletion, and listing of memories with global or repo scopes.691MIT
- Alicense-qualityCmaintenanceMCP server for long-term project memory management, allowing AI agents to store and semantically search project milestones, decisions, and architecture specs via Supermemory vector store.MIT
- Alicense-qualityCmaintenanceAn 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.1MIT
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Person-owned, portable AI memory as a remote MCP server, readable and writable by any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jryom/agentsmd-memory'
If you have feedback or need assistance with the MCP directory API, please join our Discord server