ContextKeep MCP
ContextKeep gives agents persistent memory on SQLite with full-text search, categories and a web interface.
- 159 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Keeps an agent's notes on a network-reachable server; HTTP has no built-in authorization and deleting memories is irreversible.
Install
- Works in
Manual install
git clone https://github.com/mordang7/ContextKeep.git
cd ContextKeep
python -m venv .venvFirst commands of a fresh install without Docker. Then `pip install -r requirements.txt` and `python server.py`.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Keeps an agent's notes on a network-reachable server; HTTP has no built-in authorization and deleting memories is irreversible.
This is third-party code. Review the repository files before installing.
What it does
ContextKeep, a long-term memory MCP server, keeps an agent's notes between sessions in a SQLite database with FTS5 full-text search. Memory sorts into categories you edit yourself, and one memory can sit in several. The agent moves from `list_categories` and `list_memories` to `retrieve_memory` instead of reading everything. There are 16 tools: storing, searching, recent listing, edit history, JSON export and statistics. A web interface runs alongside for browsing, editing and export. MCP answers over stdio or over HTTP at `/mcp`, with an SSE fallback for older clients.
Who it is for. People tired of repeating project context to an agent in every new session who want memory on their own server.
Good fit when
- Architecture decisions have to outlive a closed session and be found by keyword.
- One memory server serves several clients over the network.
- Memory needs hand editing: viewing, fixing and exporting to JSON from a browser.
- After upgrading from version 1 old notes must be kept and carried into categories tag by tag.
Not a fit when
- Memory is only needed within one session and long-term storage is overkill.
- Notes cannot sit on a server reachable by other network users.
- Built-in authorization for HTTP access is expected.
Example request
Store the decision to choose PostgreSQL in the architecture category, and find it tomorrow by the word database.MCP
- Transport
- stdio, http, sse
- Authentication
- not required
Limitations
Python 3.10 or Docker is required. Version 2.1 changes the schema: `list_all_memories` is removed and tags give way to categories, and before upgrading the README requires `scripts/upgrade_to_v2_1.py`, which makes a verified backup. In the examples the HTTP server listens on `0.0.0.0`, yet the README describes no authentication, so close ports 5000 and 5100 with a firewall or proxy. Remove an old SSH and stdin config under the same name, or the client launches the previous server with another database. The `delete_memory` tool erases a memory with no way back.
How to disable. Remove the `context-keep` server from the client configuration and stop the `server.py` and `webui.py` processes or the container with `docker compose down`. The database stays on disk, so export it and delete it if not needed.
FAQ
How do I confirm the right server is connected?
Call `get_contextkeep_info`: it returns the version (`2.1.0`), the `sqlite` backend, the database path and the tool list. The path and memory count must match the web interface's `/api/info`.
Which ports are the defaults?
The web interface at `http://localhost:5000` and MCP over HTTP at `http://localhost:5100/mcp`.
How do I upgrade from version 1?
Run `python scripts/upgrade_to_v2_1.py baremetal` or `docker`. The script makes a backup, verifies it and stops on discrepancies.
What if the web interface does not see what the agent stored?
Compare `get_contextkeep_info` and `/api/info`: the database id and path must match. A mismatch means the client launched another instance.
How do I make a backup?
Run `python scripts/backup_contextkeep.py baremetal --install-dir /path/to/contextkeep` or the `docker --volume <volume name>` form. Restore commands are written into the backup folder.
Discussion
No questions or reviews yet.
Related
MCP serversAn MCP server that preserves Claude Code context between sessions: decisions, checkpoints and a file cache kept in local SQLite.
An MCP server that keeps large tool output out of the agent's context window and stores session memory in SQLite
A local-first MCP memory server for agents: session history, codebase index and a concept graph in one SQLite database
A self-hosted MCP server for long-term agent memory: structured records, versioned rollback and a visual dashboard
Local memory for an agent: hooks record facts from conversations and the MCP server brings them back in later sessions from one SQLite file
Long-term memory for agents: a remote MCP server, plugins for Claude Code, Cursor and Codex, and an API for your own apps
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| ContextKeep (this card) | no | not required | 159 | |
| MCP Memory Service | no | not required | 2,090 | stores agent memory with vector search; ContextKeep leans on categories, FTS5 and an edit history with a web interface |
| Basic Memory | no | not required | 4,509 | keeps memory in markdown files; ContextKeep holds it in SQLite and adds a database identity check |
README in short
Install: a clone, a virtual environment and `pip install -r requirements.txt`, or `docker compose up -d --build`. Version 2.1 brought SQLite, FTS5, categories, one container for the web interface and MCP, and a safe upgrade with a backup.