Engram MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/vedtechsolutions/engram-mcp.git
cd engram-mcp
pnpm install
npx tsup
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add engram-mcp-5bec -- node "<FULL_PATH_TO_ENGRAM_MCP>/dist/index.js"

Replace <FULL_PATH_TO_ENGRAM_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Persistent, cross-session memory for AI agents

Engram — Persistent Memory for Claude Code

An engram is a unit of cognitive information imprinted in neural tissue — the physical trace of a memory.

Why Engram?

Claude Code forgets everything when the context window compacts. Your decisions, your debugging breakthroughs, your "always use X instead of Y" — gone. You repeat the same mistakes, re-explain the same architecture, re-discover the same solutions.

Engram fixes this. After compaction, Claude continues working like it never happened — with your decisions, pitfalls, and project context intact.

You Don't Need Memory MCP

If you're using Memory MCP or similar knowledge-graph memory servers, Engram replaces them entirely:

Memory MCP Engram
Encoding Manual — Claude must decide to call create_entities Automatic — hooks capture errors, corrections, decisions without tool calls
Recall Manual — Claude must call search_nodes Automatic — pitfalls injected before writes, corrections on session start
After compaction Nothing — Claude doesn't know the memory server exists Full recovery — briefing auto-injected with task, files, decisions, pitfalls
Context cost Every tool call burns tokens Zero-token hooks — hooks run outside the context window
Learning Store and retrieve Encode, decay, and surface — confidence scoring, relevance matching, natural forgetting
Noise Grows forever, no curation Self-maintaining — confidence decay, dedup, stale detection
Error prevention None Pitfall surfacing — warns before you repeat known mistakes

The Compaction Problem (and Why Hooks Solve It)

When Claude Code's context window fills up, it compacts — summarizing the conversation to free space. This destroys:

  • What you were doing and why
  • Decisions you made and their rationale
  • Errors you hit and how you fixed them
  • Files you were working on

Tool-based memory servers can't help because after compaction, Claude doesn't remember the server exists until something reminds it to call a tool. There's no automatic trigger.

Engram's hooks fire automatically:

  • SessionStart hook injects a briefing with your active plan, recent pitfalls, and project context — Claude picks up exactly where it left off
  • PreCompact hook saves a snapshot of what you were doing before compaction happens
  • UserPromptSubmit hook surfaces relevant memories on every prompt — no tool call needed
  • PreToolUse hook warns about known pitfalls before every Write/Edit/Bash

The result: compaction becomes invisible. Claude continues working with full context of your decisions, your mistakes, and your project's pitfalls.

How Much Context Does Engram Use?

Engram's post-compaction injection is ~180 tokens — just task, domain, files, and critical decisions. Everything else is pulled on-demand per prompt. Compare this to the 2000+ tokens that narrative-style memory systems inject, displacing space you need for actual work.

How It Works

┌─────────────────────────────────────────────────────┐
│                   Claude Code                        │
│                                                      │
│  Hooks (automatic, zero-token):                      │
│    SessionStart  → inject briefing + pitfalls        │
│    PreCompact    → save snapshot before compaction    │
│    PreToolUse    → warn on known pitfalls             │
│    UserPrompt    → surface relevant memories          │
│    PostToolFail  → learn from errors automatically    │
│    PostToolUse   → boost pitfalls you avoided         │
│    SessionEnd    → close session, promote pitfalls    │
│                                                      │
│  MCP Tools (discretionary):                          │
│    engram_recall    → search memories                 │
│    engram_learn     → store a lesson                  │
│    engram_plan      → track multi-step tasks          │
│    engram_remind    → "when X, remind me Y"           │
│    + correct, forget, strengthen, weaken              │
│                                                      │
│  StatusLine:                                         │
│    Engram: normal | 42 mem 3 rem                     │
└────────────────────┬────────────────────────────────┘
                     │
              ┌──────┴──────┐
              │  SQLite DB  │
              │  + FTS5     │
              │  ~/.engram/ │
              └─────────────┘

Quick Start

1. Clone and build

git clone https://github.com/vedtechsolutions/engram-mcp.git
cd engram-mcp
pnpm install
npx tsup

2. Configure MCP server

Add to your project's .mcp.json:

{
  "mcpServers": {
    "engram": {
      "command": "node",
      "args": ["/path/to/engram-mcp/dist/server.js"]
    }
  }
}

3. Configure hooks

Add to your project's `.claude/setting

Tools (4)

engram_recallSearch through stored memories and project context.
engram_learnManually store a specific lesson or piece of information.
engram_planTrack and manage multi-step tasks.
engram_remindSet a conditional reminder for future sessions.

Configuration

claude_desktop_config.json
{"mcpServers": {"engram": {"command": "node", "args": ["/path/to/engram-mcp/dist/server.js"]}}}

Try it

Recall the decision we made regarding the authentication architecture last week.
Remind me to check the API rate limits whenever I modify the network request module.
Store this lesson: always use the custom logger instead of console.log to ensure logs are captured in the database.
What was the pitfall we encountered when setting up the database migrations?

Frequently Asked Questions

What are the key features of Engram MCP?

Automatic session hooks for SessionStart, PreCompact, and PreToolUse. Zero-token context injection for project plans and pitfalls. Automatic error learning and pitfall surfacing. SQLite-backed persistent storage with FTS5 search. Self-maintaining memory with confidence decay and stale detection.

What can I use Engram MCP for?

Maintaining project context across multiple Claude Code sessions. Preventing the repetition of previously encountered debugging mistakes. Tracking complex multi-step development tasks without losing progress during context compaction. Surfacing relevant architectural decisions made in earlier development phases.

How do I install Engram MCP?

Install Engram MCP by running: git clone https://github.com/vedtechsolutions/engram-mcp.git && cd engram-mcp && pnpm install && npx tsup

What MCP clients work with Engram MCP?

Engram MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Engram MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare