Memory MCP
The Memory MCP server provides persistent memory and full-text session search for AI coding assistants, enabling them to remember context across sessions and search historical conversations.
Memory Management
save_memory– Persist notes, decisions, patterns, or preferences with optional tags and context.search_memory– Full-text keyword search across saved memories, ranked by relevance, with optional tag filtering.list_memories– Browse recent saved memories, optionally filtered by tag.delete_memory– Remove a specific saved memory by its ID.
Session Search & Retrieval
list_sessions– Browse past AI coding sessions, filterable by source (e.g.,claude_code,omp) or project path, with pagination.get_session– Retrieve the full conversation from a specific session, including messages, assistant responses, and tool usage.search_sessions– Full-text keyword search across all historical session messages, thinking blocks, and tool usage, ranked by relevance.refresh_sessions– Re-scan session directories to index new or changed files, keeping session history up to date.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Memory MCPwhat did we decide about the database schema last week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Memory MCP
Persistent memory and full-text session search for AI coding assistants, exposed as an MCP server.
The problem
AI coding assistants forget everything between sessions. Architecture decisions, user preferences, project context, what you debugged last Tuesday -- gone. You re-explain the same things constantly.
Memory MCP fixes this with two capabilities:
Explicit memory -- save notes, decisions, patterns, and preferences that persist across sessions. Your assistant remembers what you told it.
Session search -- full-text search across your entire conversation history. Find that thing you discussed three weeks ago without scrolling through logs.
No database servers. No background processes. No cloud. One SQLite file on your machine.
Related MCP server: MCP Vector Memory
Supported session sources
Source | Location | Format |
| JSONL (streamed content blocks) | |
Claude Code history |
| JSONL (survives session file pruning) |
| SQLite (sessions, messages, parts tables) | |
| JSONL (event-per-line) | |
| JSONL (rollout events) | |
| JSON (chat sessions) | |
| JSON (conversations) | |
LM Studio API logs |
| JSONL (via |
Adding a new source requires one parser file and a registry entry. See Adding a new source.
Installation
Requires Python 3.11+ with SQLite FTS5 support (included in standard Python builds).
pip install -e .Or run directly with uv (no install needed):
uv run --directory /path/to/memory_mcp python -m memory_mcpMCP configuration
Add to your MCP client config (e.g., ~/.claude/mcp.json or project-level .mcp.json):
With pip install:
{
"mcpServers": {
"memory": {
"command": "memory-mcp"
}
}
}With uv (no install):
{
"mcpServers": {
"memory": {
"command": "uv",
"args": ["run", "--directory", "/path/to/memory_mcp", "python", "-m", "memory_mcp"]
}
}
}Tools
Memory (explicit knowledge store)
Tool | Description |
| Persist a note with optional tags and context. Survives across all future sessions. |
| Full-text search across saved memories. Keyword-based, ranked by relevance. |
| Browse recent memories, optionally filtered by tag. |
| Remove a memory by ID. |
Sessions (historical conversation search)
Tool | Description |
| Browse past sessions. Filter by source ( |
| Retrieve the full conversation from a specific session. |
| Get tool calls and results for a session, optionally filtered by tool name. |
| Full-text search across all session messages, thinking blocks, and tool usage. |
| Re-scan session directories and index new or changed files. |
| Manually trigger a full sync push + pull cycle. |
Multi-machine sync (optional)
Memory MCP can sync sessions and memories across multiple machines via a self-hosted sync server. When configured, each machine pushes its local data to a central PostgreSQL database and pulls data from other machines.
Quick start
Deploy the sync server with PostgreSQL + systemd. See
DEPLOY.mdfor the Proxmox/no-Docker playbook.Current lab shape:
memory-mcpapp VM: FastAPI service on:8000pg2026DB VM: PostgreSQL 18 + pgvector
Create an API key:
python3 -c "import secrets; print(secrets.token_hex(32))"Insert the SHA-256 hash into PostgreSQL:
INSERT INTO users (id, name, api_key_hash, created_at) VALUES (gen_random_uuid(), 'austin', '<sha256-of-api-key>', now());Configure each machine with environment variables:
export MEMORY_MCP_SYNC_URL=http://your-server:8000 export MEMORY_MCP_SYNC_KEY=your-secret-keyRestart memory-mcp — the sync engine starts automatically. On the first configured sync, existing rows in
~/.memory_mcp/memory.dbare assigned this machine's UUID and uploaded; no separate SQLite export is needed.
How sync works
Offline-first: all reads go to local SQLite. Sync is a background process — your tools are never blocked waiting for the network.
Push: pending sessions and memories are POSTed to the server after each scan cycle and after each
save_memorycall.Pull: the server returns items authored by other machines since the last pull. Sessions use
INSERT OR IGNORE(idempotent); memories use last-write-wins conflict resolution byupdated_at.Machine identity: each host generates a persistent UUID on first run (
~/.memory_mcp/machine_id). This UUID is the sync key.No env vars = local-only: if
MEMORY_MCP_SYNC_URLandMEMORY_MCP_SYNC_KEYaren't set, the sync engine never starts and behavior is identical to v0.3.0.
Sync tools
Tool | Description |
| Manually trigger a full push + pull cycle. Returns a summary. |
How it works
On startup, Memory MCP yields its tool list to the MCP client immediately (<500 ms cold) and runs the initial session scan in a background task. The embedding model loads lazily on the first semantic search call — keyword search and saved memories work without it. Subsequent startups skip files whose mtime hasn't changed.
Database location:
~/.memory_mcp/memory.db(override withMEMORY_MCP_DBenv var)Session sources: auto-detected from standard locations (extend with
MEMORY_MCP_SOURCESenv var, format:type:path;type:path)Indexing: incremental by file mtime, parallelized across 8 threads
Search: FTS5 with BM25 ranking, prefix matching, phrase support; optional vector search via sqlite-vec + fastembed (BAAI/bge-small-en-v1.5) when
semantic=trueis passedStartup: non-blocking — heavy work (scan, model load, vector backfill) runs after the server is already responding to tool calls
Adding a new session source
Create
memory_mcp/parsers/your_source.pyimplementing theSessionParserprotocol:source_type: strattributeparse_file(path: str) -> ParsedSession | Nonemethod
Register it in
memory_mcp/parsers/__init__.pyAdd directory detection in
memory_mcp/config.py
See parsers/claude_code.py or parsers/omp.py for examples.
Testing
python tests/test_e2e.py # end-to-end: spawns server, exercises all 10 tools
python tests/test_startup.py # startup contract: cold Popen -> tools/list under 1.5stest_e2e.py starts the MCP server as a subprocess, exercises all 10 tools over the stdio protocol, and asserts tool responses. test_startup.py enforces the v0.3.0 startup contract — if an eager import or pre-yield blocking call regresses startup speed, it fails immediately. Both use throwaway databases so your real data is untouched.
Architecture
memory_mcp/
server.py # FastMCP entry point, lifespan yields fast then runs scan + sync in background
readiness.py # Lazy embedder + scan/backfill coordination
config.py # Auto-detects session dirs, DB path, sync settings
db.py # SQLite + FTS5 + sqlite-vec schema, all queries, sync triggers
embeddings.py # Lazy fastembed wrapper (BAAI/bge-small-en-v1.5)
scanner.py # Walks session dirs, dispatches to parsers, parallel indexing
machine_id.py # Persistent machine UUID for cross-machine sync
client.py # HTTP client for sync server (stdlib urllib, zero-dependency)
sync_engine.py # Background push/pull sync loop
parsers/
base.py # ParsedSession / ParsedMessage dataclasses, SessionParser protocol
claude_code.py # Claude Code JSONL parser (merges streamed assistant blocks)
claude_history.py # Claude Code history.jsonl parser (one file, many sessions)
omp.py # OMP JSONL parser
opencode.py # OpenCode SQLite parser (reads DB directly, read-only)
tools/
memory.py # save_memory, search_memory, list_memories, delete_memory
sessions.py # list_sessions, get_session, search_sessions, refresh_sessions
hosted/
server.py # FastAPI sync server (REST API)
models.py # SQLAlchemy models (PostgreSQL + pgvector)
auth.py # Bearer API key authenticationLicense
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -license-quality-maintenanceProvides persistent local memory functionality for AI assistants, enabling them to store, retrieve, and search contextual information across conversations with SQLite-based full-text search. All data stays private on your machine while dramatically improving context retention and personalized assistance.3
- Alicense-quality-maintenanceProvides AI coding agents with persistent, long-term memory through local semantic search and SQLite storage. It enables agents to save and retrieve architectural decisions or project context across different conversation sessions without requiring cloud services.
- Alicense-qualityCmaintenanceProvides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.6Apache 2.0
- AlicenseAqualityBmaintenanceProvides AI coding assistants with persistent memory storage using a local SQLite database. Enables tools to remember project details, notes, and relationships across sessions to maintain context and reduce repetitive explanations.174MIT
Related MCP Connectors
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent memory for AI agents — verbatim conversations, searchable by meaning.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nerdyaustin/memory_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server