cc-mem-mcp
The cc-mem-mcp server provides lossless, categorized long-term memory for Claude Code (and any MCP client), backed by Qdrant vector storage — preserving context across compaction generations that would otherwise lose details.
Initialize project memory (
memory_init): Bootstrap memory for a repo by scanning it into categorized baselines (overview, stack, structure, commands, connections, git, docs), folding in existing compaction summaries, and optionally installing a managed block inCLAUDE.mdwithPostCompact/SessionStarthooks.Ingest compaction summaries (
memory_ingest): Automatically read Claude Code's JSONL transcripts, parse numbered sections into categorized chunks, and store them deduped across compaction generations — losslessly.Semantic search (
memory_find): Query stored memory using natural language, with optional filtering by category (e.g.code.connections,business.goal) and/or project slug, returning top matches with similarity scores.Manually store a fact (
memory_store): Write a single durable fact directly to memory with a category, project scope, tags, and source annotation.Delete a fact (
memory_delete): Remove a specific memory chunk by its ID.Browse the category taxonomy (
memory_categories): List all active category domains and sub-categories (e.g.code.rules,code.workflow,business.decision).Inspect memory stats (
memory_stats): View collection size, storage backend (embedded local or shared Qdrant server), and current embedding model configuration.
Deployment & configuration: Supports local (embedded Qdrant) or shared Qdrant server, Docker or source installation, multiple embedding providers (local FastEmbed or OpenAI), multilingual models, and customizable category strictness via environment variables.
Click on "Deploy 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., "@cc-mem-mcp find memory about the deployment process"
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.
cc-mem-mcp
Lossless, categorized long-term memory for Claude Code (and any MCP client), backed by Qdrant.
Compaction summaries grow without bound and lose a little more every time they're re-summarized — after enough rounds, facts will be dropped. But Claude Code already produces a categorized, updated state at each compaction (its numbered summary: Primary Request, Files and Code Sections, Errors and fixes, Pending Tasks, …). This server's job is not to invent its own taxonomy — it is to capture that summary the moment it's written and keep it losslessly across every compaction generation, so a detail dropped by compaction #7 is still retrievable from #2.
Claude Code writes ~/.claude/projects/<slug>/*.jsonl
│ (each compaction appends an isCompactSummary line — already categorized)
▼
cc-mem-ingest ──► parse numbered sections = categories
│ split into chunks, content-hash dedup across generations
▼
┌──────────────────────── Qdrant ────────────────────────┐
│ embedded local-file (default) or shared server (URL) │
│ payload: category · project · generation · ts │
└──────────────────────────────────────────────────────────┘
▲
│ memory_find(query, category?, project?) ← retrieve on demand
the agent reloads relevant state instead of trusting the lossy summaryThe categories are whatever Claude Code produced — not an enum we impose.
An optional built-in taxonomy (code.* / business.*) exists only as a
suggestion for the manual memory_store path; set CC_MEM_STRICT_CATEGORIES=1
if you actually want it enforced.
Lifecycle: init → auto-update → query
memory_init ──► scan repo (project.* baseline) + fold in current session context
(once) + install a managed block in CLAUDE.md so the agent knows to query/update
│
▼
auto-update ──► every compaction is captured by a PostCompact hook / watcher (cc-mem-ingest)
│
▼
query ──► memory_find(query, category?, project?) ← agent reloads state on demandInit creates the first state and wires Claude Code up in one call:
cc-mem-init # scans cwd, ingests current context, writes CLAUDE.md block
cc-mem-init --install-hooks # also add SessionStart + PostCompact hooks to settings.jsonIt scans the repo into project.overview / stack / structure / commands / connections / git / docs,
derives the Claude Code transcript folder from the repo path to fold in the current
session, and installs a managed ## Long-term Memory block in CLAUDE.md telling the
agent to memory_find before re-deriving and to rely on automatic updates. Re-run
anytime — it's idempotent.
Related MCP server: Mnemoverse Memory
Tools
Tool | Purpose |
| Bootstrap. Scan repo → baseline, fold in current context, install CLAUDE.md guidance. |
| Auto-update. Capture Claude Code's compaction summaries from disk. Idempotent. |
| Query. Semantic retrieval, filterable by category/project. |
| Optional manual write-through for a single fact. |
| List the suggestion taxonomy. |
| Remove a chunk by id. |
| Collection size, backend, embedding config. |
Capture: keeping compactions losslessly
Ingestion is idempotent (identical chunks re-map to the same id), so run it however you like:
# one-shot, current project
cc-mem-ingest --project <transcript-folder-slug>
# background watcher (polls every 30s)
cc-mem-ingest --watch --interval 30
# or wire it to Claude Code's PostCompact hook (fires right after each compaction)
# settings.json:
# { "hooks": { "PostCompact": [ { "matcher": "*", "hooks": [
# { "type": "command", "command": "cc-mem-ingest --once" } ] } ] } }Then, in-session, the agent calls memory_find (or memory_ingest on demand) to
reload state after a compaction. See examples/CLAUDE.snippet.md.
Quick start (Docker)
Build:
docker build -t cc-mem-mcp .Wire it into Claude Code — add to .mcp.json (project) or ~/.claude.json (global):
{
"mcpServers": {
"memory": {
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "cc-mem-data:/data", "cc-mem-mcp"]
}
}
}That's it — embedded Qdrant persists in the cc-mem-data volume, embeddings run
locally via FastEmbed (no API key). See examples/ for shared-server
and OpenAI variants.
Then paste examples/CLAUDE.snippet.md into your
CLAUDE.md so the agent writes through and retrieves automatically.
Configuration
All via environment variables (see .env.example):
Var | Default | Meaning |
| (unset) | Set to use a shared Qdrant server; unset = embedded local file. |
| (unset) | API key for a protected server. |
|
| Embedded storage path (mount a volume here). |
|
| Qdrant collection. |
|
|
|
|
| Model for the chosen provider. |
| (empty) | Instruction prefixes; set |
| (unset) | For |
| (built-in) | JSON |
|
|
|
Shared memory across machines/people
Run one Qdrant server (e.g. on a box everyone can reach) and point every client at it:
docker compose up -d qdrant # from this repo
# then in each client's mcp config:
# -e QDRANT_URL=http://<host>:6333Everyone using the same QDRANT_URL + COLLECTION_NAME shares one memory.
Keep the same EMBEDDING_PROVIDER/EMBEDDING_MODEL across clients — vectors
from different models aren't comparable.
Run without Docker (from source)
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
# point at your Qdrant (omit for embedded local-file) and run:
QDRANT_URL=http://YOUR_QDRANT_HOST:6333 cc-mem-mcp # stdio MCP serverWire it into Claude Code with the venv's cc-mem-mcp executable as the command,
passing QDRANT_URL / COLLECTION_NAME / EMBEDDING_MODEL via env
(see examples/).
Automatic capture (PostCompact hook)
Copy a template from hooks/, set your QDRANT_URL, and register it in
.claude/settings.json so every compaction is captured with no manual step. See
hooks/README.md.
Publish the image (to share with others)
Push a v* tag and the bundled GitHub Actions workflow builds and publishes
ghcr.io/<owner>/cc-mem-mcp — no secrets to set up:
git tag v0.1.0 && git push origin v0.1.0Then anyone replaces OWNER in the examples/ .mcp.json with your
GitHub owner and they're running the same memory server.
Multilingual note
The default embedding model is English-centric. For non-English content set a multilingual model, e.g.:
EMBEDDING_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2Changing the model changes the vector dimension — use a fresh COLLECTION_NAME
(or re-index) when you switch.
Notes
MCP is stdio JSON-RPC — the client launches the server per session with
docker run -i; it is not a long-running HTTP service.All logs go to stderr; stdout is reserved for the protocol.
Switching embedding models changes the vector dimension. Use a fresh
COLLECTION_NAME(or re-index) when you change models.
License
MIT — see LICENSE.
Available Tools
7 toolsmemory_categoriesA
List the active category taxonomy (domains and their sub-categories).
Inputs: no named parameters. Returns: result
memory_deleteA
Delete a stored fact by its id (as returned by memory_store/memory_find).
Inputs: id (required). Returns: result
memory_findA
Retrieve relevant facts by meaning (semantic search).
Call this at the start of a task instead of relying on the compaction
summary. Narrow with category (code.connections, or a whole domain like
code) and/or project. Returns the top matches with a similarity score.
Inputs: query (required), limit, project, category. Returns: result
memory_ingestA
Capture Claude Code's OWN compaction summaries from disk into memory.
This is the primary write path: instead of tagging facts by hand, it reads
the transcript(s) Claude Code writes to ~/.claude/projects/<slug>/*.jsonl,
finds every compaction summary, and stores each of the summary's numbered
sections (Primary Request, Files and Code Sections, Errors and fixes, Pending
Tasks, ...) as categorized, dedup'd chunks. Safe to run repeatedly — unchanged
chunks re-map to the same id, so nothing piles up and nothing is lost across
compaction generations.
project: restrict to one project slug (the transcript folder name). Omit to scan all projects. session_path: ingest a single .jsonl transcript instead of scanning.
Inputs: project, session_path. Returns: result
memory_initA
Create the FIRST STATE for a project and wire Claude Code to use memory.
Call this once at the start of working on a repo (or to refresh — it's idempotent). It:
Scans the repo into a categorized
project.*baseline (overview, stack, structure, commands, connections, git, docs).Folds in current context: ingests any existing compaction summaries for this repo's Claude Code session(s).
Installs a managed memory block in the project CLAUDE.md so the agent knows to query (memory_find) and rely on automatic updates.
root: repo path (defaults to the server's working directory). When running in Docker, mount the repo and pass its in-container path here. install_hooks: also add SessionStart/PostCompact hooks to ~/.claude/settings.json.
Inputs: root, project, install_hooks, install_claude_md. Returns: result
memory_statsA
Report collection size, storage backend, and embedding configuration.
Inputs: no named parameters. Returns: result
memory_storeA
Persist ONE durable fact to long-term memory (write-through).
Call this the moment a fact worth surviving compaction appears — do NOT wait for the conversation to be summarized. One call = one atomic fact.
category is domain.sub. Built-in taxonomy:
code.rules conventions, constraints, do/don't agreed this session
code.workflow current procedure/steps, what's done, what's pending
code.os OS, shell, tool versions, paths, env vars
code.connections hosts / SSH / ports / domains / services / DBs in use
code.files files changed, with absolute paths
code.issues unresolved bugs / blockers
business.goal the business problem being solved, expected outcome
business.decision business decisions + rationale
business.constraint requirements, limits, deadlines, stakeholders
business.state where we are in the business flow
project: optional slug to scope the fact to one project/repo. tags: optional keywords for later filtering. source: optional origin note (e.g. a file path or URL).
Inputs: content (required), category (required), tags, source, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: categories listing, deletion, semantic search, bulk ingestion from disk, initialization of project memory, stats reporting, and single-fact storage. No overlap between them.
All tools follow the 'memory_' prefix. Most use verb forms (delete, find, ingest, init, store) but two use nouns (categories, stats). The pattern is mostly consistent with minor deviation.
With 7 tools covering initialization, ingestion, storage, retrieval, deletion, categories, and statistics, the count is well-scoped for a memory management server. Each tool earns its place.
Core CRUD operations are covered (store, find, delete) along with initialization and bulk ingestion. Minor gaps like an explicit update or listing all facts are missing but can be worked around.
Maintenance
Related MCP Connectors
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
InfoLang semantic memory MCP — investigate, memorize, and recall compressed agent context.
Related MCP Servers
- FlicenseAqualityDmaintenanceDual-mode tool providing long-term memory management for Claude Code and MCP clients, with semantic search and user/session isolation via Qdrant.66-
- AlicenseAqualityAmaintenanceHosted memory for AI agents that learns from outcomes, with shared rooms. One key across Claude, Cursor & ChatGPT.111,188 npm30MIT

Unforget MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceLong-term memory for Claude Code, Cursor, and MCP clients with zero-config embedded PostgreSQL. Stores and retrieves facts, preferences, and decisions using 4-channel semantic, BM25, entity, and temporal search with cross-encoder reranking.1Apache 2.0- AlicenseNot gradedqualityDmaintenancePersistent memory with semantic search for Claude and MCP-compatible clients, storing context that survives conversations and can be retrieved intelligently.1MIT