Agent Memory

by tverney

292 downloads
Not rated
GitHub

Description

MCP server that exposes agent-memory-daemon to any MCP-compatible client — Kiro (CLI & IDE), Claude Desktop, Cursor, and others. The daemon does the thinking (consolidation + extraction); this server is a thin filesystem bridge so agents can read, append, and search memory…

About

MCP server that exposes agent-memory-daemon to any MCP-compatible client — Kiro (CLI & IDE), Claude Desktop, Cursor, and others. The daemon does the thinking (consolidation + extraction); this server is a thin filesystem bridge so agents can read, append, and search memory through the Model Context Protocol.

Details

Author
tverney
Downloads
292
Categories
File Management, AI

- Exposes agent-memory-daemon via the Model Context Protocol
- Acts as a lightweight filesystem bridge for memory operations
- Supports reading, appending, and searching agent memory
- Compatible with Kiro, Claude Desktop, Cursor, and other MCP clients
- Separates memory storage (server) from consolidation and extraction (daemon)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Agent Memory
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "agent memory": {
            "memory": {
                "command": "npx",
                "args": [
                    "-y",
                    "mcp-agent-memory"
                ],
                "env": {
                    "MEMORY_DIRECTORY": "~/.agent-memory/memory",
                    "SESSION_DIRECTORY": "~/.agent-memory/sessions"
                },
                "disabled": false,
                "timeout": 30000
            }
        }
    }
}

McpServers

{
    "memory": {
        "command": "npx",
        "args": [
            "-y",
            "mcp-agent-memory"
        ],
        "env": {
            "MEMORY_DIRECTORY": "~/.agent-memory/memory",
            "SESSION_DIRECTORY": "~/.agent-memory/sessions"
        },
        "disabled": false,
        "timeout": 30000
    }
}

MCP server that exposesagent-memory-daemonto any MCP-compatible client —Kiro (CLI & IDE), Claude Desktop, Cursor, and others.

The daemon does the thinking (consolidation + extraction); this server is a thin filesystem bridge so agents canread,append, andsearchmemory through the Model Context Protocol.

┌──────────────┐ MCP/stdio ┌────────────────────┐ filesystem ┌────────────────────────┐ │ Kiro / Claude│ ◄───────────────► │ mcp-server-memory │ ◄─────────────────► │ agent-memory-daemon │ │ / Cursor │ │ (this package) │ ~/.agent-memory/ │ (runs in background) │ └──────────────┘ └────────────────────┘ └────────────────────────┘

- TheMCP serverreads/writes files under~/.agent-memory/
- Thedaemonwatches the same directory and runs consolidation + extraction passes
- They never talk to each other directly — the filesystem is the contract

Read the agent memory index (MEMORY.md) and optionally specific topic files. Call with no arguments to load only the lightweight index (cheap). Passtopicsonly when you need the full content of a specific topic file.

Append a session summary to the sessions directory. The daemon will later extract durable memories from it. Call this at the end of meaningful exchanges. Keep summaries focused on durable findings and decisions (target 300–800 tokens), not play-by-play — longer summaries cost more during consolidation.

Search memory files for a substring. Use this to recall specific facts without loading everything.

The fastest way to set everything up — memory directory, daemon, client configs, logs, and LaunchAgent — is the setup wizard:
- Memory directory— where.agent-memory/lives (default~/.agent-memory)
- Install the consolidation daemon?— say "no" for MCP-only mode (agents can read/write/search memory, but no automatic consolidation)
- LLM backendbedrock,openai, orkiro(skipped if you declined the daemon)
- Consolidation settingsmin_hours,min_sessions, extraction interval, max chars
- Run modestandalone(start manually) orlaunchagent(auto-start at login, macOS only)
- Logs directory + TTL— where to put logs, and how many days to keep them (0= forever)
- Client registration— auto-register the MCP server in Kiro, Claude Desktop, and/or Cursor configs (existing MCP entries are preserved)

When you select thekirobackend, the wizard also copies a lean agent to~/.kiro/agents/memconsolidate.jsonthat cuts token usage by ~7× (seeKiro backend).

When you selectlaunchagent, the wizard checks thatagent-memory-daemonis installed (and offers tonpm install -git if not), then registers and starts the plist.

mcp-agent-memory # run as an MCP server (normal mode — clients spawn it) mcp-agent-memory --setup # first-time interactive setup mcp-agent-memory --configure # re-run most steps; can add/remove the daemon later mcp-agent-memory --remove # interactive uninstall (backup memory, clean configs) # macOS LaunchAgent control: mcp-agent-memory --daemon status # is the daemon running? mcp-agent-memory --daemon start # load and start mcp-agent-memory --daemon stop # unload (keeps the plist) mcp-agent-memory --daemon restart # stop + start mcp-agent-memory --daemon remove # unload and delete the plist

--removepreserves other entries in client MCP configs — only thememorykey is deleted. By default it backs up~/.agent-memory/to a timestamped.bak-directory so you can restore your consolidated memories.

If you'd rather skip the wizard, here's how to do it by hand.

The MCP server works standalone — it just reads and writes files under~/.agent-memory/. Memories persist, but they won't be consolidated or extracted from sessions until you add the daemon.

npm install -g agent-memory-daemon # copy the example config mkdir -p ~/.agent-memory cp examples/memconsolidate.toml ~/.agent-memory/memconsolidate.toml # start the daemon agent-memory-daemon start ~/.agent-memory/memconsolidate.toml

Seeexamples/memconsolidate.tomlfor a ready-to-use config that matches the directory layout this MCP server expects.

Instead of starting the daemon manually, register it as a LaunchAgent:

./scripts/daemon.sh start # install plist, load it, start at login ./scripts/daemon.sh status # check if it's running ./scripts/daemon.sh stop # unload (keeps the plist) ./scripts/daemon.sh remove # unload and delete the plist

Pass a custom config path as a second arg:./scripts/daemon.sh start /path/to/config.toml. Logs land in~/.agent-memory/logs/daemon.{out,err}.log.removeleaves your config and memory files untouched.

If you have Kiro credits, you can run the daemon throughkiro-cliinstead of paying for Bedrock or OpenAI API calls. This requiresagent-memory-daemon≥ 2.7(branchfeat/kiro-backend) which adds akirobackend.

[llm_backend] name = "kiro" # optional overrides: # binary = "/custom/path/to/kiro-cli" # agent = "memconsolidate" # set to "" to use Kiro's default session context (not recommended) # model = "claude-sonnet-4-20250514" # timeoutMs = 300000

Use a lean agent to cut token usage by ~7×.By default, everykiro-cli chatcall loads Kiro's full system prompt plus every MCP tool schema from your global config — roughly 12–18K extra input tokens per call. Create a minimal agent that skips all of that:

cp examples/kiro-agent-memconsolidate.json ~/.kiro/agents/memconsolidate.json

The Kiro backend passes--agent memconsolidateautomatically, so no further config is needed. Measured on a trivial prompt:0.01 credits with the lean agent vs. 0.07 credits with the default(same output quality).

Seeexamples/kiro-agent-memconsolidate.json— the agent hasmcpServers: {},tools: [], anduseLegacyMcpJson: falseso it doesn't inherit anything from your global Kiro config.

The--setupand--configurewizards handle this for you. This section is for users who want to wire things up by hand.

{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "mcp-agent-memory"], "env": { "MEMORY_DIRECTORY": "~/.agent-memory/memory", "SESSION_DIRECTORY": "~/.agent-memory/sessions" }, "disabled": false, "timeout": 30000, "autoApprove": ["memory_read", "memory_search", "memory_append_session", "memory_daemon_status"] } } }

WhyautoApprove?All memory tools are local-only filesystem operations — they read/write markdown files under~/.agent-memory/and never make network calls. Adding them toautoApprovelets Kiro call them without prompting you for confirmation each time, which is essential for the seamless "read memory at session start" experience.

Then ask Kiro:"Read my memory index."or"Remember this: I prefer pnpm over npm."

Edit~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows):

{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "mcp-agent-memory"], "env": { "MEMORY_DIRECTORY": "~/.agent-memory/memory", "SESSION_DIRECTORY": "~/.agent-memory/sessions" }, "autoApprove": ["memory_read", "memory_search", "memory_append_session", "memory_daemon_status"] } } }

Restart Claude Desktop. Thememory_tools will appear.

Add to~/.cursor/mcp.jsonwith the same server block (includingautoApprove).

Both paths must match what youragent-memory-daemonconfig uses.

Tell your agent to callmemory_readat the start of a conversation andmemory_append_sessionat the end. Example steering rule for Kiro (~/.kiro/steering/memory.md):

At the start of every session, call memory_read (no arguments) to load my memory index. Only pass topics when the task genuinely needs the full content of a specific topic file. When you learn something durable about me, my projects, or my preferences, call memory_append_session with a concise markdown summary. Target 300-800 tokens, use structured headers and bullets (not prose), and focus on durable findings and decisions — not play-by-play. Verbose summaries cost more during the daemon's consolidation pass.

Each of the three tools has a different cost profile. A few practices keep inference + consolidation bills low:

- memory_readwith no argumentsreturns only theMEMORY.mdindex (typically <1 KB). Prefer this overtopicsunless you need full content.
- memory_searchis substring-based and returns ≤3 matching lines per file — cheaper than loading whole topic files.
- memory_append_sessioncosts nothing at call time, but every session gets processed by the daemon's LLM during consolidation. Keep summaries concise and structured.
- Consolidate or prune old topic files occasionally. Runmcp-agent-memory --configure— it now warns if your memory directory exceeds 25 files or 200 KB.
- Session pruning after extractionis handled by the daemon, not the MCP server. Seeagent-memory-daemon's config for options that archive or delete sessions after they're processed (prevents the daemon from re-scanning old sessions forever).

Persistent memory for AI agents. Store and retrieve files via 14 MCP tools with OAuth 2.0 auth. Free 10GB tier.

Your AI's memory shouldn't live on someone else's server — 12 MCP tools that give it persistent context from your local markdown, no cloud, no API keys, single binary.

An AI-powered MCP server for advanced file system operations, including search, comparison, and security analysis.

Kobel is a local Windows permission gateway that controls which files ChatGPT, Claude & other AI tools may access — 100% local, no cloud.

Create a memory journal from your local photos in the macOS Photos library.

The media memory layer for AI agents and their humans. Track books, movies, music, shows, and anime.

Engram is a hosted MCP server that provides reliable memory for AI agents:

Agent memory with git-like version control. Custom LLMs turn conversations into structured facts with automatic conflict detection - your agent sees how decisions evolved, not four contradictory text blobs. 80% token reduction vs RAG/graph systems. MCP + REST.

A self-hosted MCP server that gives AI Agents persistent memory across sessions, projects, and machines.

Decentralized persistent memory for AI agents — encrypted vault storage built on Walrus and Sui.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.