home / mcp / memory mcp server
Provides long-term memory capabilities by storing and retrieving memories via keywords, slices, and diaries for AI workflows.
Configuration
View docs{
"mcpServers": {
"a157034816-memory-mcp": {
"command": "npx",
"args": [
"-y",
"@a157034816/memory-mcp"
],
"env": {
"MEMORY_STORE_DIR": "C:\\path\\to\\MemoryStore"
}
}
}
}Memory MCP Server provides a stdio-based long-term memory capability for AI agents. It stores and retrieves memories using keywords, slices of content, and diary entries, enabling your AI workflows to remember past context and reference it later.
You integrate Memory as an MCP stdio server to empower your AI calls with long-term memory. Start Memory and connect your MCP Client so that your AI can: save memories with contextual slices, list and reuse existing keywords, and recall past entries within a specified time window. Use a stable namespace for each user/workspace in {userId}/{projectId} to keep memories isolated.
Prerequisites you need before running Memory: Node.js (18.x or newer) if you plan to use the npx integration, and a Rust toolchain if you build from source.
Option 1: Use npx to run a published MCP package (recommended) with an MCP Client that supports starting a stdio server using a command and arguments.
Option 2: Build and run the local binary from source using cargo.
Configure Memory with the following MCP server definitions.
Below are two valid stdio configurations shown for Memory MCP Server. Use the one that fits your setup. The first uses npx to fetch the published MCP package; the second runs a local binary directly.
Code configurations (MCP) for Memory MCP Server
The Memory server stores data on disk. You can customize where it stores data by setting the MEMORY_STORE_DIR environment variable. If not set, Memory will use the system user data directory.
Memory uses a JSONL file for memories and an index to accelerate searches. Each namespace has its own directory structure formed as {userId}/{projectId}. Memory files include: memories.jsonl for append-only storage and index.json for fast lookups. Namespace paths are sanitized to avoid invalid filesystem characters, and backslashes are normalized to forward slashes.
When you plan to remember or recall, always include the namespace in your request as {userId}/{projectId}. If you are uncertain about which keywords exist, fetch them with keywords_list for your namespace, and fall back to keywords_list_global if needed. Try to keep memory entries with concise keywords and short slices. Remember to provide a clear occurred_at time when possible to aid recall.
The Memory MCP Server exposes the following capabilities to your MCP Client: now, keywords_list, keywords_list_global, remember, recall. Use these tools to fetch the current time, manage keywords, record memories, and retrieve relevant past entries.
Fetches the current time in UTC and local time with RFC3339 formatting and offsets.
Lists existing keywords under a given namespace, normalized (trimmed and lowercased) and sorted by length.
Lists global keywords across all namespaces with counts per namespace.
Records a memory with a namespace, a set of keywords, a content slice, and a diary note; supports optional time, importance, and source fields.
Recalls memories by namespace and optional keyword filters, time range, and query terms; returns the most relevant results with optional diary exposure.