Context Mem logo

Context Mem

Local MCP memory and context infrastructure with searchable storage, compression, knowledge graphs, and multi-agent session continuity.

Install Context Mem

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "context-mem": {
      "command": "npx",
      "args": [
        "-y",
        "context-mem"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y context-mem

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The context-mem MCP server stores agent observations in a local SQLite-backed memory system and maintains a Markdown vault for human-readable browsing. Its MCP tools support ingestion, hybrid retrieval, knowledge management, temporal queries, entity graphs, context compression, and session handoffs. Use it when agents need durable project memory, lower context usage, or coordination across sessions and projects. It runs locally without API keys or a cloud account.

Use cases

  • Persist project decisions and observations across agent sessions
  • Search compressed development history with hybrid retrieval
  • Restore context at the start of a coding session
  • Coordinate multiple agents working on shared files
  • Trace historical decisions and knowledge conflicts

Key features

  • Local SQLite memory store with Markdown vault
  • Hybrid BM25 and vector retrieval
  • Adaptive observation summarization and compression
  • Knowledge contradiction and temporal validity handling
  • Entity relationship graph queries
  • Multi-agent claims, broadcasts, and session handoffs

Tools39

What Context Mem lets your agent do. Expand a tool for its parameters.

Self-reported~570 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/21 checks healthy over the last 112d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 6d ago via OSV.dev · context-mem (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars20Stargazers on the source repository.
npm downloads450Package downloads in the last 30 days.
Last commit7mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed39Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Context Mem works

What context-mem MCP server does

The context-mem MCP server gives AI agents a persistent memory layer for development work. It records observations from tool calls, file reads, shell commands, and other project activity, then processes those observations with summarization, importance scoring, entity extraction, topic detection, and adaptive compression.

SQLite is the authoritative storage layer. A synchronized Markdown vault under .context-mem/vault/ provides a browsable representation containing indexes, session sources, entity pages, topic pages, knowledge entries, and an event log. The vault is designed to be readable with ordinary tools such as a terminal or Obsidian, while the MCP interface provides structured access for agents.

The system keeps raw sources separate from derived summaries and wiki pages. This allows retrieval to use indexed data while preserving the original record. It also supports project-scoped and cross-project memory, temporal validity, contradiction handling, and entity relationships.

How it works

Incoming observations pass through content-aware summarization before they are stored. The material describes separate summarization behavior for content such as stack traces, JSON configuration, shell output, and compiler errors. Importance affects how aggressively older information is compressed; recent or important observations can remain verbatim, while pinned entries are not compressed.

Retrieval combines BM25 search with vector search, plus trigram and Levenshtein matching. An optional LLM judge can rerank results. The underlying store includes SQLite FTS5 indexes and vector embeddings. Knowledge entries can be marked as superseded, merged, retained, or archived, and temporal tools can inspect what was true at a given time or compare two project states.

The context-mem MCP server also includes mechanisms for agent coordination. Agents can register capabilities, report status, claim files, and broadcast findings. Session tools create checkpoints, restore previous context, and prepare handoff packages for later sessions.

Setup and configuration

Install the npm package and initialize it from the project directory:

Terminal
npm i context-mem
npx context-mem init

The initializer detects supported editors and writes the corresponding MCP and instruction files. Documented targets include Claude Code, Cursor, Windsurf, VS Code with Copilot, Cline, Roo Code, Continue, and JetBrains AI. The generated files differ by client and may include hooks, rules, or project instructions in addition to the MCP configuration.

Runtime settings can be changed through the configure MCP tool. The Markdown vault is derived from SQLite; deleting it does not remove the authoritative stored observations, while manual vault edits are preserved during synchronization.

Tools and capabilities

The MCP interface includes tools for several workflows:

  • Store and retrieve observations with observe, recall, timeline, and stats.
  • Search memory with hybrid search or natural-language ask.
  • Manage durable knowledge using save_knowledge, search_knowledge, promote_knowledge, global_search, resolve_contradiction, and merge_suggestions.
  • Explore entities and relationships with entity_detect, graph_query, add_relationship, and graph_neighbors.
  • Inspect history with temporal_query, time_travel, and explain_decision.
  • Control context and continuity with wake_up, restore_session, handoff_session, predict_loss, and generate_story.
  • Coordinate multiple agents using agent_register, agent_status, claim_files, and agent_broadcast.

These tools make the context-mem MCP server suitable for projects where agents must recover prior decisions, find evidence from earlier work, preserve knowledge across sessions, or avoid conflicting edits during parallel work.

Limitations and notes

It also describes the Markdown vault as a derived layer rather than the primary database, so applications that require direct database-level control should account for SQLite being authoritative. Client setup varies by editor, and the available initialization targets do not include every MCP-compatible client.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Context Mem

context-mem is an MCP server that connects AI agents to a local SQLite memory store and synchronized Markdown vault. Its main tools store and retrieve observations, search memory, manage knowledge, query entity graphs, inspect timelines, compress context, restore sessions, and coordinate multiple agents across projects.

Install it with npm, then run its initializer: `npm i context-mem` followed by `npx context-mem init`. The initializer detects supported editors and writes their MCP configuration and related instruction files.

Yes, context-mem supports Cursor setup. Running `npx context-mem init` can write `.cursor/mcp.json` and `.cursor/rules/context-mem.mdc` for a project.

Its authoritative memory store is local SQLite, with a synchronized Markdown vault under `.context-mem/vault/`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewContext Mem AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/context-mem?style=directory)](https://allmcps.com/mcp/context-mem)
HTML Embed
<a href="https://allmcps.com/mcp/context-mem"><img src="https://allmcps.com/api/badge/context-mem?style=directory" alt="Context Mem on AllMCPs" /></a>