engram · nickcirv — Claude Code MCP server: code graph and project context
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.
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 engramxWhat engram 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.
What it helps with
- 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 for the agent
- 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
How to install engram
Platform CLI
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 engramxReplace <…> with your own values
Platform CLI
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 engramxReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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 engramxReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about engram
How do I install engram in Claude Code?
Run claude mcp add engram -e ENGRAM_API_TOKEN=<ENGRAM_API_TOKEN> -- npx -y engramx. To pass the full set of variables instead: `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`.
What does engram do?
It indexes code entities, Git relationships and notes on past mistakes, then serves narrow context to the agent on request. The graph is stored in .engram/ using sql.js over SQLite.
Do I need an API token?
Yes, for the protected routes of the HTTP server and the dashboard. It is read from ENGRAM_API_TOKEN or a local token file.
Similar MCP servers
All MCP servers for Agent setup: memory, context, orchestration →engram by other authors comes first.