MCPSaver
Local MCP server for persistent, searchable agent memory using SQLite FTS5, replacing flat MEMORY.md files with efficient full-text search and workspace context caching.
README
MCPSaver
Local MCP server for persistent, searchable agent memory.
<img src="assets/banner.gif" alt="MCPSaver banner" width="100%">
Full landing page: cpntodd.github.io/MCPSaver
MCPSaver replaces flat MEMORY.md files with a SQLite database behind a Model Context Protocol (MCP) server. It provides full-text search (FTS5), workspace context caching, and code symbol indexing -- all running locally over stdio.
Why
Flat Markdown memory files force the agent to read the entire file to find one relevant lesson, burning thousands of tokens on irrelevant history. MCPSaver gives the agent queryable long-term memory with selective retrieval:
| Operation | Flat MEMORY.md | MCPSaver |
|---|---|---|
| Find a past lesson | Read entire file (~2000 tokens) | search_memory("pytest fixture") (~50 tokens) |
| Load project context | Run git status, read manifests (~500 tokens) |
get_workspace_context() (~30 tokens) |
| Record a new lesson | Append to MEMORY.md manually |
record_lesson(...) (indexed, timestamped) |
| Check prior art | Grep codebase (~300 tokens) | find_prior_art(symbol="...") (~20 tokens) |
Install
git clone https://github.com/cpntodd/MCPSaver.git
cd MCPSaver
uv sync
Requires Python >= 3.13.
VS Code Configuration
Add to your VS Code mcp.json (User or Workspace settings):
{
"servers": {
"mcpsaver": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/path/to/MCPSaver",
"run",
"mcpsaver"
]
}
}
}
Or use the Claude Desktop / Cursor equivalent for your MCP client.
Tools
record_lesson
Store a lesson, convention, or correction into persistent memory.
record_lesson(
lesson_type: "convention" | "self_correction" | "human_correction" | "api_fact" | "decision" | "pattern",
context: string,
correction: string,
mistake?: string,
pattern?: string,
tags?: string[],
workspace?: string
)
search_memory
Full-text search across all lessons using SQLite FTS5 with porter stemming.
search_memory(
query: string,
limit?: int (default 10),
tags?: string[]
)
get_workspace_context / set_workspace_context
Cache and retrieve project metadata (stack, linter, formatter, file tree).
get_workspace_context(workspace: string)
set_workspace_context(
workspace: string,
stack?: string[],
linter?: string,
formatter?: string,
test_runner?: string,
file_tree?: string,
conventions?: object
)
find_prior_art / index_symbols
Search indexed code symbols to find prior usage of functions, classes, or patterns.
find_prior_art(
workspace: string,
symbol?: string,
kind?: string,
limit?: int
)
index_symbols(
workspace: string,
symbols: [{symbol, kind?, file_path, line?, snippet?}],
clear_first?: bool
)
list_lessons
List recent lessons with optional type/workspace filters.
get_stats
Return summary statistics about the memory database.
import_memory_md
Import existing MEMORY.md flat files into the SQLite database.
Architecture
~/.local/share/mcpsaver/memory.db <-- SQLite database (auto-created)
|
+-- lessons <-- Core lessons table (all memory entries)
+-- lessons_fts <-- FTS5 full-text index (porter stemming)
+-- workspace_context <-- Cached project metadata per workspace
+-- code_symbols <-- Indexed code symbols per workspace
Storage
All data lives in ~/.local/share/mcpsaver/memory.db. Nothing leaves the machine. The MCP server communicates exclusively over stdio with no network access.
License
GPL-3.0-or-later
(c) 2026 cpntodd
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.