Give AI agents persistent memory across coding sessions
MCP memory server storing agent memories as OKF-formatted Markdown, indexed with SQLite FTS5 for fast search.
1.0Add to Favorites
Why it matters
Enable AI coding assistants to remember project context, user preferences, architectural decisions, and work progress across sessions so they can pick up exactly where they left off and maintain continuity throughout long-term development projects.
Outcomes
What it gets done
Store and retrieve coding preferences, architectural decisions, and project-specific context in OKF-formatted memory files
Search past conversations and decisions using full-text search across namespaced memory records
Automatically checkpoint session progress so agents know what was accomplished and what's next
Maintain human-readable markdown memory files synced with high-performance SQLite indexing for instant lookups
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Capabilities
Tools your agent gets
Stores or updates a memory record in OKF v0.2 format with metadata.
Retrieves a specific memory by its key and namespace.
Finds memories matching keywords, tags, or namespace filters.
Retrieves the last recorded session checkpoint for session continuity.
Updates the canonical session checkpoint with progress and milestones.
Overview
Mcp Memory
MCP-Memory is an MCP server that gives AI agents persistent, cross-session memory, storing each record as an OKF-formatted Markdown file and indexing it in SQLite with FTS5 for fast keyword search. Use it when an MCP-compatible AI agent needs to remember project context, preferences, or session progress across chats instead of starting fresh each time.
What it does
MCP-Memory is a Model Context Protocol server that gives AI agents such as Claude Desktop, Cursor, Antigravity, Windsurf, or Codex persistent, long-term memory across chat turns and sessions. Every memory record is formatted as an Open Knowledge Format (OKF v0.2) Markdown document with YAML frontmatter (type, key, namespace, tags, generated, sources, verified, status, stale_after) and indexed in a local SQLite database with FTS5 full-text search for sub-20ms key lookups and instant keyword search. It uses a dual-layer architecture: a human-browsable OKF directory (memory/) with hierarchical index.md progressive-disclosure files and a log.md update history, alongside a hidden high-performance SQLite index that stays in sync with it. Namespaces (for example user/preferences, project/architecture, or default) keep memories contextually separated.
When to use - and when NOT to
Use it when an AI agent needs to remember facts, preferences, or project state across sessions instead of losing everything at the end of a chat - for example recording a user's coding-style preference once, or checkpointing session progress so the agent knows exactly where it left off the next time a project opens. It fits any MCP-compatible client (Antigravity, Claude Desktop/Code, Cursor, Windsurf, Codex) via a zero-boilerplate setup wizard. It is project-scoped by default, storing memory inside each project's own root directory, though a single global store shared across projects can be configured via environment variables if that is what a workflow needs instead.
Capabilities
The server exposes six MCP tools: memory_store (store or update a memory record in OKF v0.2 format, with tags, concept type, status, and provenance sources), memory_retrieve (look up a memory by key and namespace), memory_search (find memories by keyword, tags, or namespace, with a configurable result limit), memory_delete (remove a memory from both the SQLite index and the on-disk bundle), memory_get_last (an agent directive to retrieve the last recorded session checkpoint at session start, so the agent knows where work was left off), and memory_update_last (an agent directive to update that canonical checkpoint whenever a milestone completes or work pauses).
How to install
git clone https://github.com/fellowgeek/mcp-memory
cd mcp-memory
python3 setup.py
The interactive setup wizard auto-detects and registers mcp-memory with installed AI tools, after which the client launches the server automatically in the background with no manual process to keep running. To configure a client manually instead, point its MCP server entry at run.sh (JSON config for Antigravity, Claude Desktop, Cursor, and Windsurf; a [mcp_servers.memory] TOML entry for Codex Desktop; or claude mcp add / codex mcp add for the respective CLIs). By default, OKF Markdown files live in a project's memory/ folder and the SQLite index in .mcp_memory/memories.db; MCP_MEMORY_PROJECT_ROOT, MCP_MEMORY_DB_PATH, and MCP_MEMORY_DIR environment variables override these locations, including pointing them at a shared home-directory path for a single global store.
Who it's for
Developers using MCP-compatible AI coding assistants who want the agent to retain project context, preferences, and progress checkpoints across sessions instead of starting from a blank memory every time.
Source README
MCP-Memory: OKF-Backed Agent Memory Server
MCP-Memory is a Model Context Protocol (MCP) server that equips AI agents (such as Claude Desktop, Cursor, Antigravity, Windsurf, or Codex) with persistent, long-term memory capabilities.
Memory records are formatted using the Open Knowledge Format (OKF v0.2) standard and indexed with a local SQLite instance (supporting FTS5 full-text search) for fast key-value lookups, tag filtering, and content search.
Fast Track: Jump directly to Quick Start
Key Features
- Persistent State Across Sessions: Enables AI agents to read, store, search, and delete stateful memory snippets that persist across chat turns and sessions.
- OKF Standard Compliance: Stores every memory item formatted as an OKF v0.2 Markdown document with YAML frontmatter (
type,key,namespace,tags,generated,sources,verified,status,stale_after), adhering strictly toSPEC.mdandOKF_RULES.md. - Dual-Layer Architecture:
- Human-Browseable OKF Directory: Automatically dumps and syncs every memory to disk as a raw
.mdfile inside thememory/bundle directory with hierarchicalindex.mdprogressive disclosure files (rootindex.mdversioned withokf_version: "0.2") andlog.mdupdate history tracking. - High-Performance SQLite Indexing: SQLite FTS5 (Full-Text Search) and automatic triggers for sub-20ms key lookups and instant keyword searches.
- Human-Browseable OKF Directory: Automatically dumps and syncs every memory to disk as a raw
- Namespace Isolation: Supports contextual separation (e.g.
user/preferences,project/architecture,default). - Zero Boilerplate Setup: Quick setup wizard (
python3 setup.py) auto-configures installed MCP tools (Antigravity, Claude, Cursor, Windsurf, Codex).
MCP Tools
The server exposes six MCP tools to interacting agents:
1. memory_store
Stores or updates a memory record in OKF v0.2 format.
- Parameters:
key(string, required): Unique identifier or path for the memory (e.g.user/preferences/coding_styleorproject/architecture).content(string or object, required): Core information to store.project_root(string, required): Absolute path to the active project root directory (e.g./Users/user/Projects/my-app).tags(array of strings, optional): Classification tags for filtering.namespace(string, optional, default:"default"): Scope/namespace.concept_type(string, optional, default:"Agent Memory"): OKF concept type (e.g.Metric,Playbook,Attested Computation).title(string, optional): Display name.description(string, optional): One-line summary.resource(string, optional): Canonical URI of underlying asset.status(string, optional, default:"stable"): Lifecycle state (draft|stable|deprecated).stale_after(string, optional): ISO date (YYYY-MM-DD).sources(array of objects, optional): Provenance sources[{resource, id, title, author, usage_count, last_modified}].verified(array of objects or object, optional): Verification events[{by, at}].generated_by(string, optional): Actor identifier following actor convention (<producer>/<version>,human:<id>,process:<id>).
2. memory_retrieve
Retrieves a specific memory by its key and namespace.
- Parameters:
key(string, required): The memory key to look up.project_root(string, required): Absolute path to the active project root directory.namespace(string, optional, default:"default"): Scope/namespace.
3. memory_search
Finds memories matching keywords, tags, or namespace filters.
- Parameters:
project_root(string, required): Absolute path to the active project root directory.query(string, optional): Keyword search query across keys, frontmatter, and content.tags(array of strings, optional): Filter by specific tags.namespace(string, optional): Scope search to a namespace.limit(integer, optional, default: 10): Maximum number of results.
4. memory_delete
Removes a specific memory record by its key and namespace, from both the SQLite index and the memory/ bundle on disk.
- Parameters:
key(string, required): The key of the memory to remove.project_root(string, required): Absolute path to the active project root directory.namespace(string, optional, default:"default"): Scope/namespace.
5. memory_get_last
AGENT DIRECTIVE (Session Start): Retrieves the last recorded session checkpoint (system/last_memory) so the AI agent immediately knows where work was left off when opening a project or starting a session.
- Parameters:
project_root(string, required): Absolute path to active project root directory.namespace(string, optional, default:"default"): Scope/namespace.
6. memory_update_last
AGENT DIRECTIVE (Milestones & Progress): Updates the canonical session checkpoint (system/last_memory) whenever completing a milestone, making key changes, or pausing work.
- Parameters:
content(string or object, required): Brief note or structured dictionary summarizing progress and referencing key memory files.project_root(string, required): Absolute path to active project root directory.namespace(string, optional, default:"default"): Scope/namespace.summary(string, optional): One-sentence description of the milestone achieved.
OKF (Open Knowledge Format) Structure
Every stored memory strictly adheres to the OKF v0.2 specification (SPEC.md & OKF_RULES.md):
---
type: Agent Memory
title: Coding Style
key: user/preferences/coding_style
namespace: default
tags:
- preferences
- style
status: stable
generated:
by: mcp-memory/0.2.0
at: '2026-08-12T19:23:35Z'
created_at: '2026-08-12T19:23:35Z'
updated_at: '2026-08-12T19:23:35Z'
---
User prefers functional programming style with explicit type annotations.
Quick Start
1. Clone the Repository
git clone https://github.com/fellowgeek/mcp-memory
cd mcp-memory
2. Interactive Setup Wizard
Run setup.py to auto-detect and register mcp-memory with your AI tools:
python3 setup.py
Note: Once
setup.pyfinishes configuring your tools, your AI client will launchmcp-memoryautomatically in the background whenever needed. You do not need to manually start or keep a server process running in your terminal.
3. Run Manually via CLI (Optional / Debugging)
If you want to manually verify startup, inspect stdio output, or pre-initialize the virtual environment (.venv), you can run run.sh directly:
./run.sh
Manual Client Configuration
If you prefer to configure your MCP client manually, add the "memory" server entry pointing to run.sh:
JSON Configuration (Antigravity, Claude Desktop, Cursor, Windsurf)
Add to your client's mcp_config.json or claude_desktop_config.json:
{
"mcpServers": {
"memory": {
"command": "/ABSOLUTE/PATH/TO/run.sh"
}
}
}
TOML Configuration (Codex Desktop)
Add to ~/.codex/config.toml:
[mcp_servers.memory]
command = "/ABSOLUTE/PATH/TO/run.sh"
CLI Configuration
- Claude Code CLI:
claude mcp add --scope user memory -- /ABSOLUTE/PATH/TO/run.sh - Codex CLI:
codex mcp add memory -- /ABSOLUTE/PATH/TO/run.sh
Testing
Run the automated test suite to verify OKF serialization, SQLite database operations, and FastMCP tool execution:
python3 test_memory.py
Storage & Environment Variables
By default, mcp-memory creates project-isolated memory stores inside each project's root directory:
- OKF Markdown Files (Human-readable):
memory/folder in project root. - SQLite Database (Hidden index):
.mcp_memory/memories.dbin project root.
You can customize this behavior using environment variables:
MCP_MEMORY_PROJECT_ROOT: Project root directory (default: process current working directorycwd).MCP_MEMORY_DB_PATH: SQLite database file path (default:.mcp_memory/memories.dbrelative to project root).MCP_MEMORY_DIR: Directory for Open Knowledge Format (OKF).mdfiles (default:memoryrelative to project root).
Tip: If you prefer a single global memory store shared across all projects, set
MCP_MEMORY_DB_PATH=~/.mcp_memory/memories.dbandMCP_MEMORY_DIR=~/.mcp_memory/memoryin your client's MCP configuration.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.