ctx-memory
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., "@ctx-memory where did we leave off on the auth project?"
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.
local-shared-memory-mcp
๐ง In progress. Early development: tools, CLI commands and the storage format may change.
One local memory that every AI tool shares. Start in Claude, continue in Cursor, Codex, Gemini CLI or opencode, and nothing has to be re-explained. Everything lives in one SQLite file (~/.memory/ctx-memory.db) behind an MCP server. No cloud, no account, no native build (Node >= 22.13, built-in node:sqlite + FTS5).
Claude Desktop โโ
Cursor โโผโโโบ ctx-memory MCP server โโโบ ~/.memory/ctx-memory.db
Codex / any MCP โQuick start
npm install
node src/cli.js init # Claude Desktop, Cursor, Windsurf (backs up configs as .bak)
claude mcp add ctx-memory -- node /path/to/local-shared-memory-mcp/src/cli.js serve # Claude CodeRestart the apps. Set MEMORY_DB_PATH to move the database.
Related MCP server: light-agent-memory-mcp-server
Switching models
In the tool you are leaving: "Save a handoff for project
myapp: goal, decisions, state, next steps."In the next tool: "Call get_context for project
myappand continue."
Use the same project name everywhere, ask for get_context yourself (most tools don't call it automatically; Claude Code with the hooks installed does, see Auto-save), and remember small facts as you go. For tools without MCP (e.g. ChatGPT web): node src/cli.js export myapp and paste the output.
Tools
Tool | Purpose |
| Latest handoff + top memories, capped by |
| Save a fact, preference, decision, task or note (tags, project, importance 1-5, dedupes) |
| Keyword search, ranked by relevance and importance (5 results by default) |
| Delete a memory by id |
| Store a "where we left off" summary |
| Projects with memory counts |
| Full memory as text, no cap |
Fast and small: FTS5 search (AND first, prefix and stemming, filler words ignored); context is ranked by importance and recency, near-duplicates collapsed, and replies are compact text cut at the token cap:
Handoff (2d ago, claude): Goal: ship auth. Next: login route.
#2 API runs on port 9090
#1 pref: I prefer tabs over spaces #style #code
(+12 more; use recall)Auto-save
All tools: the server tells models to
rememberproactively, andget_contextreminds them tosave_handoffbefore the chat ends. Models can still ignore this.Claude Code (hooks): loads memory automatically at session start and saves a handoff at session end, with no model involved. Hooks work only in Claude Code; other tools get the nudges above.
node src/cli.js hooks install # prints the settings.json block
node src/cli.js hooks install --write # merges it into ~/.claude/settings.json (backs up first)
node src/cli.js hooks install --summarize # at session end, also ask `claude -p` for a real handoff + candidate memories (uses some of your Claude usage)The project name is the folder Claude Code runs in (override with MEMORY_PROJECT). Without --summarize the end-of-session handoff is a free, crude extract of your last requests and the last reply.
Safeguards: likely secrets (API keys, tokens, password=) are redacted before anything auto-saved is stored. Memories captured by --summarize start pending and stay out of get_context and recall until you run node src/cli.js approve <id|all> (see them with pending, drop one with reject <id>). MEMORY_AUTOSAVE=off disables saving.
Other AI tools
Configs below follow each tool's documented format and are not all tested. Replace /path/to/local-shared-memory-mcp with your clone. Restart the tool afterwards.
Gemini CLI, ~/.gemini/settings.json:
{ "mcpServers": { "ctx-memory": { "command": "node", "args": ["/path/to/local-shared-memory-mcp/src/cli.js", "serve"] } } }Codex CLI, ~/.codex/config.toml:
[mcp_servers.ctx-memory]
command = "node"
args = ["/path/to/local-shared-memory-mcp/src/cli.js", "serve"]opencode, ~/.config/opencode/opencode.json:
{ "mcp": { "ctx-memory": { "type": "local", "command": ["node", "/path/to/local-shared-memory-mcp/src/cli.js", "serve"], "enabled": true } } }CLI and web viewer
node src/cli.js add "I prefer tabs" -k preference -t style -p myapp # also: list, search, edit, forget, projects
node src/cli.js handoff save "Goal: ship auth." -p myapp --from claude # or: handoff show; stdin works too
node src/cli.js export myapp # Markdown to paste anywhere
node src/cli.js import notes.md -p myapp # each "- line" becomes a memory
node src/cli.js ui # read-only viewer at http://127.0.0.1:4777
node src/cli.js usage --days 30 # tokens this server sent to your AIs
node src/cli.js pending # auto-saved memories awaiting review; then: approve <id|all> | reject <id>The viewer shows memories (search, project/kind/tag filters; auto-saved ones show a "pending review" badge until approved), handoffs, a get_context preview with token size, and a Usage tab. It binds to 127.0.0.1, answers GET only and refuses non-local Host headers.
Usage tracking stores one row per tool call (time, tool, AI app, project, estimated tokens = chars รท 4), never memory text, and prunes after 90 days. Turn it off with MEMORY_USAGE=off.
Limits and roadmap
Search matches words, not meaning, and a model saves memory only if it chooses to call the tools.
Planned: editing and deleting in the viewer, approve/reject buttons for pending memories in the viewer (the command line already has them), merge duplicates, pinning, expiry and cleanup, semantic search, and an HTTP/SSE mode for ChatGPT and other remote clients.
Run tests with npm test.
License
Available Tools
7 toolsexport_markdownC
Full memory as text, to paste into an AI without MCP.
Inputs: project.
forgetC
Delete a memory by id.
Inputs: id (required).
get_contextA
Latest handoff + top memories. Call first in every chat.
Inputs: project, max_tokens.
list_projectsC
Projects with memory counts.
Inputs: no named parameters.
recallC
Search memory by keywords.
Inputs: query (required), kind, limit, project.
rememberC
Save a durable fact, preference, decision or task.
Inputs: text (required), kind, tags, source, +2 more.
save_handoffB
Save a where-we-left-off summary for the next AI.
Inputs: summary (required), project, from_model.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 7 tools
Most tools have distinct purposes: remember (write), recall (keyword search), forget (delete), save_handoff (session summary), list_projects, export_markdown. The main overlap is get_context vs recall (both retrieve memories) and remember vs save_handoff (both persist), but descriptions make the boundaries clear enough to avoid most misselection.
All names are verb-first and lowercase, with verb_noun forms (get_context, save_handoff, list_projects, export_markdown) alongside single-verb forms (remember, recall, forget). The mix is minor and still highly readable and predictable.
Seven tools is well-scoped for a memory server, covering the core write/read/delete/list/export surface without redundancy. Each tool earns its place.
Covers the full lifecycle: write (remember, save_handoff), read (get_context, recall), delete (forget), plus list_projects and export_markdown. Minor gaps exist (no update/edit of an existing memory, no get-by-id), but these are workable via forget+remember.
Maintenance
Related MCP Connectors
Cross-tool persistent memory and context for AI assistants over MCP.
Shared memory for your AI tools: tasks, notes and context every tool can read and write over MCP.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides persistent, inspectable memory storage for AI agents using SQLite. Agents can store, recall, and search memories across sessions via three MCP tools.3MIT
- AlicenseAqualityCmaintenanceProvides persistent, searchable memory for AI agents across any MCP-compatible client, storing project context, user preferences, and session learnings locally in SQLite with tools to save, retrieve, search, and manage them.124 npmMIT
- FlicenseNot gradedqualityBmaintenanceEnables agents to store conversational turns in a single SQLite store and recall relevant context through lexical, entity, dense, and recent views without an LLM in the recall loop. It exposes MCP tools for remembering, bulk ingest, recall, stats, and session deletion, with persistent indexes and zero-token maintenance.-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to store, retrieve, and manage persistent memories locally via an MCP server with hybrid vector and keyword search, plus tools for memory CRUD, search, backup, and import.MIT