Agent Memory
Ein Dateisystem-MCP für Agent-Speicher
MCP-Server, der agent-memory-daemon für jeden MCP-kompatiblen Client bereitstellt — Kiro (CLI & IDE), Claude Desktop, Cursor und andere.
Der Daemon übernimmt das Denken (Konsolidierung + Extraktion); dieser Server ist eine schlanke Dateisystem-Brücke, damit Agenten Speicher über das Model Context Protocol lesen, anhängen und durchsuchen können.
Funktionsweise
┌──────────────┐ MCP/stdio ┌────────────────────┐ filesystem ┌────────────────────────┐
│ Kiro / Claude│ ◄───────────────► │ mcp-server-memory │ ◄─────────────────► │ agent-memory-daemon │
│ / Cursor │ │ (this package) │ ~/.agent-memory/ │ (runs in background) │
└──────────────┘ └────────────────────┘ └────────────────────────┘Der MCP-Server liest/schreibt Dateien unter
~/.agent-memory/Der Daemon überwacht dasselbe Verzeichnis und führt Konsolidierungs- und Extraktionsdurchläufe aus
Sie kommunizieren nie direkt miteinander — das Dateisystem ist der Vertrag
Related MCP server: Recall
Verfügbare Tools
Tool | Zweck |
| Lädt den |
| Schreibt eine Sitzungszusammenfassung, aus der der Daemon später Erinnerungen extrahieren kann |
| Teilstring-Suche über Speicherdateien hinweg |
| Überprüft, ob der Konsolidierungs-Daemon läuft (nur macOS LaunchAgent) |
Installation
npm install -g mcp-agent-memorySchnellstart (interaktiver Assistent)
Der schnellste Weg, alles einzurichten — Speicherverzeichnis, Daemon, Client-Konfigurationen, Protokolle und LaunchAgent — ist der Einrichtungsassistent:
mcp-agent-memory --setupEr stellt sechs Fragen:
Speicherverzeichnis — wo
.agent-memory/liegt (Standard~/.agent-memory)Konsolidierungs-Daemon installieren? — wählen Sie "nein" für den reinen MCP-Modus (Agenten können Speicher lesen/schreiben/suchen, aber keine automatische Konsolidierung)
LLM-Backend —
bedrock,openaioderkiro(wird übersprungen, wenn Sie den Daemon abgelehnt haben)Konsolidierungseinstellungen —
min_hours,min_sessions, Extraktionsintervall, max. ZeichenAusführungsmodus —
standalone(manuell starten) oderlaunchagent(automatischer Start bei Anmeldung, nur macOS)Protokollverzeichnis + TTL — wo Protokolle gespeichert werden und wie viele Tage sie aufbewahrt werden sollen (
0= für immer)Client-Registrierung — automatisches Registrieren des MCP-Servers in Kiro-, Claude Desktop- und/oder Cursor-Konfigurationen (bestehende MCP-Einträge bleiben erhalten)
Wenn Sie das kiro-Backend auswählen, kopiert der Assistent außerdem einen schlanken Agenten nach ~/.kiro/agents/memconsolidate.json, der den Token-Verbrauch um ca. 7× senkt (siehe Kiro-Backend verwenden).
Wenn Sie launchagent auswählen, prüft der Assistent, ob agent-memory-daemon installiert ist (und bietet an, es per npm install -g zu installieren, falls nicht), registriert dann die plist und startet sie.
CLI-Referenz
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--remove bewahrt andere Einträge in Client-MCP-Konfigurationen — nur der memory-Schlüssel wird gelöscht. Standardmäßig wird ~/.agent-memory/ in ein mit Zeitstempel versehenes .bak-*-Verzeichnis gesichert, damit Sie Ihre konsolidierten Erinnerungen wiederherstellen können.
Manuelle Installation
Wenn Sie den Assistenten überspringen möchten, können Sie dies manuell tun.
Daemon installieren (optional)
Der MCP-Server funktioniert eigenständig — er liest und schreibt lediglich Dateien unter ~/.agent-memory/. Erinnerungen bleiben bestehen, werden aber nicht konsolidiert oder aus Sitzungen extrahiert, bis Sie den Daemon hinzufügen.
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.tomlSiehe examples/memconsolidate.toml für eine sofort einsatzbereite Konfiguration, die dem Verzeichnislayout entspricht, das dieser MCP-Server erwartet.
Daemon bei Anmeldung ausführen (macOS)
Anstatt den Daemon manuell zu starten, registrieren Sie ihn als 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Übergeben Sie einen benutzerdefinierten Konfigurationspfad als zweites Argument: ./scripts/daemon.sh start /pfad/zu/config.toml. Protokolle landen in ~/.agent-memory/logs/daemon.{out,err}.log. remove lässt Ihre Konfigurations- und Speicherdateien unberührt.
Kiro als LLM-Backend verwenden
Wenn Sie Kiro-Guthaben haben, können Sie den Daemon über kiro-cli ausführen, anstatt für Bedrock- oder OpenAI-API-Aufrufe zu bezahlen. Dies erfordert agent-memory-daemon ≥ 2.7 (Branch feat/kiro-backend), der ein kiro-Backend hinzufügt.
[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 = 300000Verwenden Sie einen schlanken Agenten, um den Token-Verbrauch um ca. 7× zu senken. Standardmäßig lädt jeder kiro-cli chat-Aufruf den vollständigen System-Prompt von Kiro sowie jedes MCP-Tool-Schema aus Ihrer globalen Konfiguration — etwa 12–18K zusätzliche Eingabe-Token pro Aufruf. Erstellen Sie einen minimalen Agenten, der all das überspringt:
cp examples/kiro-agent-memconsolidate.json ~/.kiro/agents/memconsolidate.jsonDas Kiro-Backend übergibt automatisch --agent memconsolidate, daher ist keine weitere Konfiguration erforderlich. Gemessen an einem trivialen Prompt: 0,01 Credits mit dem schlanken Agenten gegenüber 0,07 Credits mit dem Standard (gleiche Ausgabequalität).
Siehe examples/kiro-agent-memconsolidate.json — der Agent hat mcpServers: {}, tools: [] und useLegacyMcpJson: false, sodass er nichts von Ihrer globalen Kiro-Konfiguration erbt.
Clients manuell konfigurieren
Die Assistenten
--setupund--configureerledigen dies für Sie. Dieser Abschnitt ist für Benutzer gedacht, die die Dinge manuell verbinden möchten.
Kiro (CLI und IDE)
Bearbeiten Sie ~/.kiro/settings/mcp.json:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "mcp-agent-memory"],
"env": {
"MEMORY_DIRECTORY": "~/.agent-memory/memory",
"SESSION_DIRECTORY": "~/.agent-memory/sessions"
},
"disabled": false,
"timeout": 30000
}
}
}Fragen Sie dann Kiro: "Lies meinen Speicherindex." oder "Merk dir das: Ich bevorzuge pnpm gegenüber npm."
Claude Desktop
Bearbeiten Sie ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) oder %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"
}
}
}
}Starten Sie Claude Desktop neu. Die memory_*-Tools werden erscheinen.
Cursor
Fügen Sie den gleichen Server-Block zu ~/.cursor/mcp.json hinzu.
Umgebungsvariablen
Variable | Standard | Beschreibung |
|
| Wo der Daemon konsolidierte Speicherdateien speichert |
|
| Wo vom Agenten geschriebene Sitzungszusammenfassungen landen |
Beide Pfade müssen mit denen in Ihrer agent-memory-daemon-Konfiguration übereinstimmen.
Empfohlener Agent-Prompt
Weisen Sie Ihren Agenten an, zu Beginn eines Gesprächs memory_read und am Ende memory_append_session aufzurufen. Beispiel-Steuerungsregel für 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.Tipps zum Token-Verbrauch
Jedes der drei Tools hat ein anderes Kostenprofil. Ein paar Praktiken halten die Kosten für Inferenz + Konsolidierung niedrig:
memory_readohne Argumente gibt nur denMEMORY.md-Index zurück (normalerweise <1 KB). Bevorzugen Sie dies gegenübertopics, es sei denn, Sie benötigen den vollständigen Inhalt.memory_searchbasiert auf Teilstrings und gibt ≤3 übereinstimmende Zeilen pro Datei zurück — günstiger als das Laden ganzer Themen-Dateien.memory_append_sessionkostet zum Zeitpunkt des Aufrufs nichts, aber jede Sitzung wird während der Konsolidierung vom LLM des Daemons verarbeitet. Halten Sie Zusammenfassungen prägnant und strukturiert.Konsolidieren oder bereinigen Sie alte Themen-Dateien gelegentlich. Führen Sie
mcp-agent-memory --configureaus — es warnt jetzt, wenn Ihr Speicherverzeichnis 25 Dateien oder 200 KB überschreitet.Sitzungsbereinigung nach der Extraktion wird vom Daemon gehandhabt, nicht vom MCP-Server. Siehe die Konfiguration von
agent-memory-daemonfür Optionen zum Archivieren oder Löschen von Sitzungen nach deren Verarbeitung (verhindert, dass der Daemon alte Sitzungen für immer erneut scannt).
Lizenz
MIT
Available Tools
4 toolsmemory_append_sessionA
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.
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Markdown-formatted session summary. Use structured headers and bullets for better extraction; avoid verbose prose. | |
| source | No | Origin tag, e.g., "kiro", "claude-desktop" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses that the daemon will later extract memories and that longer summaries incur higher cost. This adds useful behavioral context beyond the simple append.
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 compact sentences, each serves a purpose: action, timing, and content guidelines. No redundancy, front-loaded with core function.
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 simple tool with two parameters and no output schema, the description provides complete guidance: what, when, how, and cost implications. No gaps.
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 has 100% description coverage, but description adds significant value by advising on summary focus, token target (300-800), and avoiding verbose prose. This guides the agent beyond schema definitions.
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?
Description clearly states 'Append a session summary to the sessions directory' with a specific verb and resource. It distinguishes from sibling read tools (memory_read, memory_search) by being a write operation.
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?
Explicitly advises 'Call this at the end of meaningful exchanges' and provides guidelines on summary length and content. No exclusion criteria or alternatives mentioned, but context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_daemon_statusA
Check whether the memory consolidation daemon is running. Reports if the daemon is not installed or not available on this platform.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Since no annotations are provided, the description carries the full burden. It discloses that the tool reports if the daemon is not installed or not available, indicating it can return multiple status outcomes. No contradictions with annotations (none provided).
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 sentences, no wasted words. The core purpose is front-loaded in the first sentence, and the second adds extra detail concisely.
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?
Given no parameters and no output schema, the description covers the tool's purpose effectively. It explains what the tool does and the possible outcomes (daemon running, not installed, not available). No obvious gaps.
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?
The tool has zero parameters and schema description coverage is 100% (trivially). The description does not need to add parameter information. Baseline for 0 params is 4.
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?
Description clearly states the tool checks the running status of the memory consolidation daemon, and also reports if the daemon is not installed or not available on the platform. This distinguishes it from sibling tools (memory_append_session, memory_read, memory_search) which perform different memory operations.
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?
The description implies usage context (checking daemon status) but does not explicitly state when to use this tool versus alternatives. No exclusions or alternatives are mentioned, though sibling tools have different purposes.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_readA
Read the agent memory index (MEMORY.md) and optionally specific topic files. Call with no arguments to load only the lightweight index (cheap). Pass topics only when you need the full content of a specific topic file.
| Name | Required | Description | Default |
|---|---|---|---|
| topics | No | Optional topic file names to load in full (e.g., ["preferences", "projects"]). Omit to return the index only. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavior. It reveals that calling without arguments is 'cheap' (lightweight), implying topic file retrieval is more expensive. This adds useful context beyond the schema, though it could further clarify error handling or return format.
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 sentences, front-loaded with the core purpose, then a follow-up sentence with usage details. No filler or redundancy.
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 simple read tool with one optional parameter, the description covers the main usage. However, without an output schema, it lacks details on the return format (e.g., structure of the index or topic file content). This is a minor gap.
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%, but the description adds meaning: it explains that the topics parameter triggers full content retrieval, while omitting it returns the index. This informs the agent of the parameter's purpose beyond data typing.
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 clearly states 'Read the agent memory index (MEMORY.md) and optionally specific topic files.' It identifies the action (read) and resource (memory index/topic files), and distinguishes from siblings by specifying the no-arguments vs. topics usage.
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?
Explicit guidance: 'Call with no arguments to load only the lightweight index (cheap). Pass topics only when you need the full content of a specific topic file.' This tells the agent when to use each mode, effectively differentiating between lightweight and full retrieval.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_searchA
Search memory files for a substring. Use this to recall specific facts without loading everything.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Substring to search for across all memory files (case-insensitive) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must fully disclose behavior. It specifies case-insensitive substring search but omits what the response contains (e.g., matching lines, file paths) and any performance implications.
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 sentences, front-loaded with purpose, no redundant information.
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?
Despite low complexity, the lack of output schema and omission of response format leaves the agent guessing about what will be returned, reducing completeness.
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% with full parameter description; the tool description adds no extra semantics beyond restating the schema's content.
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 clearly states the tool searches memory files for a substring, distinguishing it from sibling 'memory_read' which presumably loads entire files.
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?
Explicitly advises use for 'recall specific facts without loading everything,' providing clear context for when to use, though it could name the alternative sibling directly.
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.
2 tool updates
v1.0.3- Added
memory_daemon_status - Changed
memory_search1 field changed- added
Input schema / properties / query / descriptionAdded value: +"Substring to search for across all memory files (case-insensitive)"
3 tool updates
v1.0.0- First observed
memory_append_session - First observed
memory_read - First observed
memory_search
TDQS
Scored across 4 tools
Each tool serves a distinct purpose: appending sessions, checking daemon status, reading memory index, and searching. No overlaps or ambiguities.
All tools follow a consistent pattern: 'memory_' prefix followed by a descriptive verb or verb_noun (append_session, daemon_status, read, search). Naming is predictable and clear.
With 4 tools, the surface is concise and well-scoped for a memory management server. Each tool addresses a core operation without redundancy.
The tools cover essential operations (append, read, search, status). Missing update/delete might be a minor gap, but the memory consolidation daemon likely handles lifecycle, making this acceptable.
Maintenance
Related MCP Connectors
Shared memory and actions for Claude, Kiro, OpenAI, Cursor, and other MCP-compatible AI clients.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI agents with persistent memory capabilities through Mem0, allowing them to store, retrieve, and semantically search memories.684MIT

Recallofficial
AlicenseNot gradedqualityCmaintenanceOpen-source MCP memory server for AI agents — persistent, searchable, tiered memory across sessions. Works over stdio (Cursor, Claude Desktop) or HTTP+SSE. MIT licensed.8MIT- AlicenseAqualityBmaintenanceGives your AI persistent memory across conversations. Stores facts automatically, finds them by meaning using hybrid search with query expansion, and organizes everything into topics without manual tagging.181MIT

@memofs/mcp-serverofficial
AlicenseNot gradedqualityAmaintenance@memofs/mcp-server lets AI coding agents (Claude Code, Claude Desktop, Codex, Cursor, opencode, Gemini CLI, GitHub Copilot, Zed, and any other MCP client) securely read and write MemoFS memory through standard Model Context Protocol tools.6MIT