MCP.so
Sign In

Context Mem

@JubaKitiashvili

About Context Mem

Your AI forgets everything between sessions. This fixes that — 98%+ retrieval accuracy, 100% on LongMemEval, 99% token savings. 44 MCP tools. Fully local, zero cost.

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "context-mem": {
      "command": "npx",
      "args": [
        "-y",
        "context-mem",
        "serve"
      ]
    }
  }
}

Tools

45

Store a new observation (content snippet) into context memory with automatic summarization.

Summarize a piece of content using the matching summarizer plugin without storing it.

[v4] Unified search across observations, knowledge, content, topics. Legacy search/search_knowledge/search_content/recall/browse/global_search/ask are aliased to this with deprecation _meta.

Retrieve observations in reverse-chronological order with optional filters.

Retrieve a single observation by its ID.

Get token economy statistics for the current session.

Update a mutable configuration key at runtime.

Execute code in JavaScript, TypeScript, Python, Shell, Ruby, Go, Rust, PHP, Perl, R, or Elixir.

Index content into the content store with code-aware chunking for later search.

Search the content store for indexed content chunks.

Save a knowledge entry with automatic contradiction detection. When contradictions are found, the save is blocked — resubmit with force: true to save anyway.

Search the knowledge base using 3-layer search (FTS5 → trigram → scan). Optionally include global cross-project knowledge. By default only returns currently-valid facts (valid_to IS NULL).

Promote a project knowledge entry to the global cross-project knowledge store. Privacy engine sanitizes content before storing.

Search the global cross-project knowledge store.

Update the project quick profile — a 3-5 line summary shown at every session start. Auto-generates from knowledge if no content provided.

Get current budget usage and status for the session.

Configure budget settings (session limit, overflow strategy).

Restore a previous session snapshot by session ID.

Emit a context event with priority and metadata.

Query context events with optional filters.

Query the knowledge graph. Find entities and their relationships.

Add a relationship between two entities in the knowledge graph. Creates entities if they do not exist.

Find all entities connected to a given entity. Faster than graph_query for simple lookups.

Register the current session as a named agent for multi-agent coordination.

List all active agents with their tasks and claimed files.

Claim files for the current agent. Returns conflicts if already claimed by another agent.

Broadcast a message to all active agents via the event system.

View or compare the project state at any point in time. Shows observations, knowledge, and events as of a target date.

Ask a natural language question about the project. Searches knowledge, observations, events, and graph entities.

Resolve a contradiction between knowledge entries by merging, superseding, or keeping both.

Generate session handoff — saves state and returns continuation prompt for a new session. Use when context is running low or before ending a session.

Verbatim memory retrieval with importance filtering and rich attribution. Returns original content, not summaries.

Generate a human-readable narrative from session data. Formats: pr (pull request), standup, adr (architecture decision record), onboarding.

Predict which memory entries are at highest risk of being forgotten or archived. Users can pin important entries to protect them.

Reconstruct the evidence chain behind a code change or decision. Returns the trail of events that led to a decision.

Import external conversation exports (Claude, ChatGPT, Slack, plaintext) into context memory.

Browse observations by topic, person, or time dimension.

List all detected topics with observation counts.

Find topics that appear in 2+ projects (cross-project knowledge bridges).

Generate a scored session primer with 4-layer context: project profile, critical knowledge, recent decisions, and top entities.

Query knowledge that was valid at a specific point in time. Returns facts that were active at the given timestamp.

Extract entities (technologies, people, files, components) from text content.

List all detected person entities with relationship counts.

View pending merge suggestions for duplicate global knowledge entries.

Query internal error log. Shows what context-mem subsystems have failed at (embedder, entity extraction, topic storage, dreamer, etc.). Useful for doctor-style debugging.

Overview

What is Context Mem?

Context Mem is a local MCP (Model Context Protocol) server that provides memory and context infrastructure for AI agents. It automatically remembers every tool call and compresses observations to save tokens, storing everything in a local SQLite database and a markdown vault. It is designed for developers using AI coding assistants like Claude Code, Cursor, Windsurf, VS Code Copilot, and others.

How to use Context Mem?

Install the package with npm i context-mem and run npx context-mem init to auto-configure for your editor. The server runs locally with no API keys or cloud account required.

Key features of Context Mem

  • Automatic memory ingestion into a markdown vault.
  • 14 content-aware summarizers for 99.1% token savings.
  • Hybrid retrieval with BM25, vector, and LLM reranking.
  • 45+ MCP tools for querying and managing memory.
  • Fully local: no cloud, no API keys required.
  • Adaptive compression with pinned entries staying verbatim.

Use cases of Context Mem

  • Retain project context across AI sessions to avoid re-explaining.
  • Comp

Comments

More Memory & Knowledge MCP servers