Skip to main content
Glama

Ein Dateisystem-MCP für Agent-Speicher

mcp-agent-memory MCP server

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

memory_read

Lädt den MEMORY.md-Index (und optionale Themen-Dateien) in den Kontext des Agenten

memory_append_session

Schreibt eine Sitzungszusammenfassung, aus der der Daemon später Erinnerungen extrahieren kann

memory_search

Teilstring-Suche über Speicherdateien hinweg

memory_daemon_status

Überprüft, ob der Konsolidierungs-Daemon läuft (nur macOS LaunchAgent)

Installation

npm install -g mcp-agent-memory

Schnellstart (interaktiver Assistent)

Der schnellste Weg, alles einzurichten — Speicherverzeichnis, Daemon, Client-Konfigurationen, Protokolle und LaunchAgent — ist der Einrichtungsassistent:

mcp-agent-memory --setup

Er stellt sechs Fragen:

  1. Speicherverzeichnis — wo .agent-memory/ liegt (Standard ~/.agent-memory)

  2. Konsolidierungs-Daemon installieren? — wählen Sie "nein" für den reinen MCP-Modus (Agenten können Speicher lesen/schreiben/suchen, aber keine automatische Konsolidierung)

  3. LLM-Backend — bedrock, openai oder kiro (wird übersprungen, wenn Sie den Daemon abgelehnt haben)

  4. Konsolidierungseinstellungen — min_hours, min_sessions, Extraktionsintervall, max. Zeichen

  5. Ausführungsmodus — standalone (manuell starten) oder launchagent (automatischer Start bei Anmeldung, nur macOS)

  6. Protokollverzeichnis + TTL — wo Protokolle gespeichert werden und wie viele Tage sie aufbewahrt werden sollen (0 = für immer)

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

Siehe 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 = 300000

Verwenden 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.json

Das 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 --setup und --configure erledigen 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

MEMORY_DIRECTORY

~/.agent-memory/memory

Wo der Daemon konsolidierte Speicherdateien speichert

SESSION_DIRECTORY

~/.agent-memory/sessions

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_read ohne Argumente gibt nur den MEMORY.md-Index zurück (normalerweise <1 KB). Bevorzugen Sie dies gegenüber topics, es sei denn, Sie benötigen den vollständigen Inhalt.

  • memory_search basiert auf Teilstrings und gibt ≤3 übereinstimmende Zeilen pro Datei zurück — günstiger als das Laden ganzer Themen-Dateien.

  • memory_append_session kostet 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 --configure aus — 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-daemon fü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 tools
memory_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesMarkdown-formatted session summary. Use structured headers and bullets for better extraction; avoid verbose prose.
sourceNoOrigin tag, e.g., "kiro", "claude-desktop"

TDQS

A4.5/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
topicsNoOptional topic file names to load in full (e.g., ["preferences", "projects"]). Omit to return the index only.

TDQS

A4.6/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

Tool Schema Changelog

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

  1. 2 tool updatesv1.0.3
    • Addedmemory_daemon_status
    • Changedmemory_search1 field changed
      • addedInput schema / properties / query / description
        Added value: +"Substring to search for across all memory files (case-insensitive)"
  2. 3 tool updatesv1.0.0
    • First observedmemory_append_session
    • First observedmemory_read
    • First observedmemory_search

TDQS

A4.2/5.0

Scored across 4 tools

Disambiguation5/5

Each tool serves a distinct purpose: appending sessions, checking daemon status, reading memory index, and searching. No overlaps or ambiguities.

Naming Consistency5/5

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.

Tool Count5/5

With 4 tools, the surface is concise and well-scoped for a memory management server. Each tool addresses a core operation without redundancy.

Completeness4/5

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

ActivityNo data
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Open-source MCP memory server for AI agents — persistent, searchable, tiered memory across sessions. Works over stdio (Cursor, Claude Desktop) or HTTP+SSE. MIT licensed.
    8
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Gives 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.
    18
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    @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.
    6
    MIT