Local-first semantic memory layer for MCP agents. Recall, remember, forget, stats over stdio.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Local-first semantic memory for MCP agents. Recall, remember, forget, echo, drift detection, stats over stdio.
The server runs as an MCP stdio process on your machine. It exposes six tools that let an agent ask "have I seen this task before?" and, if so, get the previous answer back in milliseconds without re-running the work. Inspired by bat echolocation: even a recall miss reports how close the nearest memory was, an echo tool senses nearby memories without retrieving answers, and every recall outcome is logged so drift_report can flag cached answers that are absorbing too broad a family of queries (first-fill semantic drift).
Embeddings come from sentence-transformers/all-MiniLM-L6-v2 (384-dim, runs on CPU). Storage is a persistent local ChromaDB collection. No data leaves your machine.
After install you can run the server from anywhere:
The first time a tool is called, the embedding model (~80MB) is downloaded into the local Hugging Face cache. Subsequent starts are fast.
Edit your config file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonAdd an mcpServers entry:
If subconscious-mcp isn't on Claude Desktop's PATH, use the absolute path printed by which subconscious-mcp, e.g. "command": "/Users/you/.local/bin/subconscious-mcp".
Then quit and restart Claude Desktop. The new tools appear under the π indicator.
Option A. Register from the CLI (recommended):
Option B. Edit ~/.claude.json (or your project's .mcp.json) and add:
Reload the Claude Code session and the six tools become available.
A copy-pasteable file is in examples/claude_desktop_config.json and examples/claude_code_config.json.
Beyond the explicit tools, subconscious-mcp can capture your work automatically through Claude Code hooks. Three commands get you there:
install-hooks edits your Claude Code settings.json (default ~/.claude/settings.json) to register two hooks: a SessionStart hook and a Stop hook. It backs up the existing file first (settings.json.bak.<timestamp>), writes atomically, and is idempotent: running it again when both hooks are already present is a no-op. Pass --dry-run to print the planned change without writing, and --settings <path> to target a different settings file.
What gets captured: when a session ends, the Stop hook reads the tail of the transcript, extracts the last user-request to assistant-outcome exchange, redacts secrets (best effort, see Privacy), and writes one episode per session into ~/.subconscious-mcp/data/context.db (a plain SQLite inbox). The hooks never load the embedding model or ChromaDB; the MCP server embeds and ingests pending episodes at its next startup.
What SessionStart injects: at the start of a session it prints this project's most recent episodes (up to 3) plus a one-line nudge to call recall before starting non-trivial work. Claude Code absorbs that text as context.
Capture is per-project automatically. The namespace is derived from the git repository root folder name (falling back to the current directory basename), so each project's episodes and curated memory stay isolated without any configuration. Set namespace explicitly in config to override.
Everything stays on your machine. Episodes captured by the ambient hooks live in ~/.subconscious-mcp/data/context.db, a plain SQLite file you can inspect with any SQL client:
Before an episode is written, the captured text passes through a best-effort redactor. It currently masks these shapes:
sk- keys (including sk-ant-, sk-proj-)pypi-)ghp_, gho_, ghu_, ghs_, ghr_) and fine-grained tokens (github_pat_)xoxb-, xoxa-, xoxp-, xoxr-, xoxs-)AKIA...)Bearer authorization tokens-----BEGIN ... PRIVATE KEY-----)KEY=value env assignments where the name ends in KEY / TOKEN / SECRET / PASSWORD / PASSWD (the value is masked, the name is kept)Redaction is best effort, not a guarantee. Known gaps it does NOT catch: AWS secret access keys (bare 40-char strings), bare JWTs outside a Bearer prefix, passwords inside connection strings (postgres://user:pass@host), Stripe secret keys (sk_live_ / sk_test_, underscore form), and npm tokens. Treat capture as a convenience, not a vault.
To turn capture off entirely, set capture_enabled=false in config or SUBCONSCIOUS_CAPTURE_ENABLED=false in the environment. The Stop hook then captures nothing.
To wipe everything subconscious-mcp has stored (curated memory, episodes, echo logs, server logs) in one line:
recall(task, threshold=0.85, top_k=1)Semantic search for a previously remembered task.
| arg | type | default | meaning |
|---|---|---|---|
task | str | (required) | the task description to look up |
threshold | float | 0.85 | minimum cosine similarity for a hit |
top_k | int | 1 | how many candidates to consider |
tags | list[str] | null | optional; candidate must share at least one |
Returns:
On a miss, hit is false, answer is null, and similarity is the best similarity observed in top_k. Callers can see how close they came.
When tags is supplied, the miss similarity reflects the best match within the fetched window intersected with the tag filter, and can be 0.0 even when a tag-matching entry exists beyond the window (raise top_k to widen the window).
remember(task, answer, tags=[], ttl_seconds=null, skip_if_duplicate=false)Persist a (task, answer) pair. Returns {stored, entry_id, embedding_dim}.
ttl_seconds=null means never expire. Pass an integer to have the entry filtered out of future recalls after that many seconds.
Before storing, the nearest curated entry is probed. If its cosine similarity falls in the near-duplicate band [0.75, 0.92], the result also carries warning="near_duplicate" with nearest_task, nearest_similarity, and nearest_entry_id (a write-time first-fill drift guard that complements drift_report). The entry is still stored. Pass skip_if_duplicate=true to skip the write instead, in which case the result is {stored: false, ...} with the same warning fields. Ambient capture episodes never trigger the warning.
The band [0.75, 0.92] is deliberately independent of default_threshold (0.85), so it straddles the recall threshold: the warning fires on neighbours that recall might or might not return. Similarities above 0.92 are treated as update-territory (basically the same task) and are intentionally not warned. To act on a warning, recall the nearest_entry_id (or look it up) to inspect the existing entry, then decide whether to merge, update, or proceed.
echo(task, top_k=5)Sonar ping: return the nearest non-expired entries without their answers.
| arg | type | default | meaning |
|---|---|---|---|
task | str | (required) | the task description to ping with |
top_k | int | 5 | how many nearest entries to report |
tags | list[str] | null | optional; candidate must share at least one |
Returns:
Use it to sense whether a task sits in known territory before committing to a recall. Because no answer is returned, an echo can never propagate a stale or wrong cached answer. Echo calls don't count toward the hit rate and aren't written to the echo log.
Each echo carries a kind: "memory" for curated remember entries, "episode" for ingested ambient capture. Episodes surface in echo but never in recall answers.
drift_report(min_hits=3, min_spread=0.08)No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/subconscious)<a href="https://allmcps.com/mcp/subconscious"><img src="https://allmcps.com/api/badge/subconscious?style=directory" alt="Subconscious on AllMCPs" /></a>