# engram

Builds a local graph of your codebase and hands the agent the relevant files and links instead of everything at once. Fits projects that no longer fit in context.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 143
- Author: NickCirv
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/NickCirv/engram
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/nickcirv-engram

## What it does

Engram indexes source entities, references, Git co-change patterns and recorded mistakes into a project-local graph. The agent queries it and gets back bounded context with an estimated token count, then opens only what matters. The index lives in the project's `.engram/` directory and persists through `sql.js` on SQLite.

You reach it through a CLI, MCP, an authenticated local dashboard and hooks. Hooks intercept file reads and greps, which is why plain `init` installs one by default. Run it with `--no-hook` to inspect the graph output before you change how your agent behaves.

Node 20 or later is required, and the package is `engramx`. The system is not guaranteed to stay off the network: the CLI checks npm for updates, and configured providers or plugins can spawn their own processes. Set `ENGRAM_NO_UPDATE_CHECK=1` to stop the update check. The HTTP server binds to `127.0.0.1`, validates Host and Origin, and wants a bearer token from `ENGRAM_API_TOKEN` or a local token file.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `ENGRAM_API_TOKEN`, `ENGRAM_MISTAKE_GUARD`, `ENGRAM_ANTHROPIC_MEMORY_PATH`, `ENGRAM_MCP_CONFIG_PATH`, `ENGRAM_NO_UPDATE_CHECK` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env ENGRAM_API_TOKEN=<ENGRAM_API_TOKEN> --env ENGRAM_MISTAKE_GUARD=<ENGRAM_MISTAKE_GUARD> --env ENGRAM_ANTHROPIC_MEMORY_PATH=<ENGRAM_ANTHROPIC_MEMORY_PATH> --env ENGRAM_MCP_CONFIG_PATH=<ENGRAM_MCP_CONFIG_PATH> --env ENGRAM_NO_UPDATE_CHECK=<ENGRAM_NO_UPDATE_CHECK> --transport stdio nickcirv-engram -- npx -y engramx
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add nickcirv-engram --env ENGRAM_API_TOKEN=<ENGRAM_API_TOKEN> --env ENGRAM_MISTAKE_GUARD=<ENGRAM_MISTAKE_GUARD> --env ENGRAM_ANTHROPIC_MEMORY_PATH=<ENGRAM_ANTHROPIC_MEMORY_PATH> --env ENGRAM_MCP_CONFIG_PATH=<ENGRAM_MCP_CONFIG_PATH> --env ENGRAM_NO_UPDATE_CHECK=<ENGRAM_NO_UPDATE_CHECK> -- npx -y engramx
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "nickcirv-engram": {
            "command": "npx",
            "args": [
                "-y",
                "engramx"
            ],
            "env": {
                "ENGRAM_API_TOKEN": "<ENGRAM_API_TOKEN>",
                "ENGRAM_MISTAKE_GUARD": "<ENGRAM_MISTAKE_GUARD>",
                "ENGRAM_ANTHROPIC_MEMORY_PATH": "<ENGRAM_ANTHROPIC_MEMORY_PATH>",
                "ENGRAM_MCP_CONFIG_PATH": "<ENGRAM_MCP_CONFIG_PATH>",
                "ENGRAM_NO_UPDATE_CHECK": "<ENGRAM_NO_UPDATE_CHECK>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "nickcirv-engram": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "engramx"
            ],
            "env": {
                "ENGRAM_API_TOKEN": "<ENGRAM_API_TOKEN>",
                "ENGRAM_MISTAKE_GUARD": "<ENGRAM_MISTAKE_GUARD>",
                "ENGRAM_ANTHROPIC_MEMORY_PATH": "<ENGRAM_ANTHROPIC_MEMORY_PATH>",
                "ENGRAM_MCP_CONFIG_PATH": "<ENGRAM_MCP_CONFIG_PATH>",
                "ENGRAM_NO_UPDATE_CHECK": "<ENGRAM_NO_UPDATE_CHECK>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ENGRAM_API_TOKEN=<ENGRAM_API_TOKEN> -e ENGRAM_MISTAKE_GUARD=<ENGRAM_MISTAKE_GUARD> -e ENGRAM_ANTHROPIC_MEMORY_PATH=<ENGRAM_ANTHROPIC_MEMORY_PATH> -e ENGRAM_MCP_CONFIG_PATH=<ENGRAM_MCP_CONFIG_PATH> -e ENGRAM_NO_UPDATE_CHECK=<ENGRAM_NO_UPDATE_CHECK> nickcirv-engram npx -y engramx
```
Replace <…> with your own values

## When to use it
- locate the right code before opening whole files
- trace who calls a function and what depends on it
- carry past debugging mistakes into a new session
- generate IDE rule files from one index
- estimate how many tokens a context request costs

## Example prompts
- Query the graph for everything related to authentication and show me only the files I need
- Index this project without the hook, I want to see the output first
- Show me the callers of this function before I change it

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

## Other versions with the same name
- [engram · tstockham96](https://affpapa.org/en/nevibecode/mcp/tstockham96-engram.md) — ★ 47
- [Engram · get-engram](https://affpapa.org/en/nevibecode/mcp/engram.md) — ★ 19

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
