MCP Server for AI Agent Memory

Give your AI agents persistent memory via the Model Context Protocol. MCP v3.2 tools: memory_search, memory_add, memory_get, memory_list, memory_clear. 100% local. No API key. MIT license.

Last updated: March 2026 · View on GitHub →

What is an MCP Memory Server?

An MCP memory server exposes memory tools to AI agents via the Model Context Protocol (MCP). Your agent can store, search, and retrieve information across sessions — without relying on the context window alone. MCP is the standard protocol for connecting AI agents to tools, adopted by OpenClaw, Claude Desktop, Cursor, and more.

agent-memory is a lightweight, open-source MCP v3.2 server for AI agent memory. Unlike cloud-based alternatives, it runs entirely on your machine. No account. No API key. No data leaves your device.

Quick Start

# Install agent-memory pip install agent-memory # Start the MCP memory server python -m agent_memory.mcp_server # Your AI agent can now use: # memory_search(query) — find relevant memories # memory_add(text, ttl='7d') — store a memory # memory_get(id) — retrieve specific memory # memory_list() — list recent memories # memory_clear() — clear all memories

Features

🔌
MCP v3.2 Native
Full Model Context Protocol v3.2 support. Works with OpenClaw, Claude Desktop, Cursor, and any MCP client.
🔒
100% Local
All data stays on your machine. No cloud. No account. No API key required.
⏱️
TTL Expiration
Set time-to-live on memories. They auto-expire after a specified duration (e.g., '1h', '7d', '30d').
🔐
AES Encryption
Encrypt sensitive memories with AES-256. Optional per-memory encryption.
🏗️
Multiple Backends
JSON for simplicity, SQLite for performance, Redis for production scale. Switch with one line.
📡
REST API + SSE
Built-in REST API server and Server-Sent Events for real-time memory updates.

MCP Memory Server Comparison

Which MCP memory server is right for you?

Feature
agent-memory
Mem0 OpenMemory
MCP Protocol
✓ v3.2
100% Local
✓ Always
✗ Cloud required
API Key Required
✗ Never
✗ OpenAI key required
TTL Expiration
✓ Built-in
AES Encryption
✓ Local
JSON/SQLite/Redis
✓ All three
MIT License
Open core
Price
Free forever
$19–$249/mo

Python API

Beyond MCP, use agent-memory directly in Python:

from agent_memory import Memory m = Memory(storage="json", path="./memory.json") # Store memories with automatic TTL m.add("User prefers dark mode", ttl="30d") m.add("API endpoint: /api/v2/users", ttl="7d") # Retrieve via semantic search results = m.search("dark mode preference") for r in results: print(r["text"], r["score"]) # Or use encrypted storage m_enc = Memory(encryption_key="my-secret-key") m_enc.add("Admin password hint")

Use Cases

AI Coding Agents (Cursor, Claude Code): Remember project conventions, API shapes, architectural decisions, and user preferences across sessions. No more re-explaining your codebase every time.

Research Agents: Store facts, URLs, and insights from web searches. Retrieve relevant context when working on related topics.

Customer Support Agents: Remember user preferences, past issues, and conversation history for personalized support.

DevOps Agents: Track server configurations, deployment history, and operational patterns for reliable automation.

Get Started

★ Star on GitHub 🚀 Live Demo 📊 Compare with Mem0