EngramEngramdocs
v0.3.2
GitHub
Integrations

MCP Integration

The Model Context Protocol (MCP) is an open standard that lets AI clients connect to external tools. Engram exposes all 21 memory tools over MCP, making them available to any MCP-compatible client with zero code changes.

The MCP server uses @engram-ai-memory/core directly with a local SQLite database. Set the ENGRAM_DB_PATH environment variable to point to your database file.

Claude Code

Claude Code natively supports MCP. Add Engram once and it persists across all future Claude Code sessions on that machine.

Fastest path: let engram setup do it. The engram setup command configures Claude Code automatically — it registers the MCP server at user scope (so it loads in every session, with no manual approval) and installs two automatic-memory hooks: a recall hook that injects relevant memories on each prompt, and a session-end hook that stores a summary. Opt out with --no-claude-hooks, and check status any time with engram doctor. The manual configuration below is for other MCP clients or custom setups.

Setup

Create ~/.mcp.json for global access (all projects), or .mcp.json in a project root for per-project scope. Do not put MCP servers in ~/.claude/settings.json — that file is for Claude Code settings only.

// ~/.mcp.json (global) or .mcp.json (per-project)
{
  "mcpServers": {
    "engram": {
      "command": "npx",
      "args": ["-y", "@engram-ai-memory/mcp@latest"],
      "env": {
        "ENGRAM_DB_PATH": "/home/you/.engram/engram.db"
      }
    }
  }
}
Use an absolute path. MCP config files are plain JSON — no shell expands ~, so the server would try to create a directory literally named~ and fail to start. On macOS use /Users/you/....

Alternatively, if you installed via engram setup, point to the local build:

{
  "mcpServers": {
    "engram": {
      "command": "node",
      "args": ["/home/you/.engram/repo/packages/mcp/dist/server.js"],
      "env": {
        "ENGRAM_DB_PATH": "/home/you/.engram/engram.db"
      }
    }
  }
}

Restart Claude Code, then verify Engram is listed:

> /mcp
● engram (connected)
  Tools: store_memory, recall_context, search_memory,
         add_knowledge, memory_stats, forget
Once connected, Claude Code can call recall_context to inject relevant past memories and store_memory to save new information.

Auto-store conversations (optional)

By default, memories are only stored when Claude explicitly calls store_memory. Add a Claude Code hook to automatically save a summary of every session:

# Copy the hook script from the repo
cp ~/.engram/repo/scripts/claude-code-hook.sh ~/.claude/hooks/engram-session-end.sh
chmod +x ~/.claude/hooks/engram-session-end.sh

Add to ~/.claude/settings.json:

{
  "hooks": {
    "SessionEnd": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/hooks/engram-session-end.sh",
        "timeout": 15
      }]
    }]
  }
}

Every session now auto-stores a conversation summary to engram as episodic memory.


Install from Claude Desktop / Smithery

The easiest way to get started — install Engram as a one-click Desktop Extension without any manual configuration.

Via Smithery

Engram is listed on Smithery (smithery.ai). Click Install, configure the optional database path and namespace, and Engram is ready.

# Smithery URL
https://smithery.ai/skills/ayvazyan10/engram

Via .mcpb Desktop Extension

Download engram-mcp.mcpb from the GitHub releases page and open it in Claude Desktop. The bundle automatically installs @engram-ai-memory/mcp on first launch — no Node.js setup required beyond having npm available.

# Download from GitHub releases
https://github.com/ayvazyan10/engram/releases/latest/download/engram-mcp.mcpb
The Desktop Extension uses a bootstrap launcher: it installs @engram-ai-memory/mcp to ~/.engram/mcp/ on first run, then delegates to it via stdio. Subsequent launches skip the install step and start in under a second.

Claude Desktop

Claude Desktop (macOS and Windows) supports MCP servers via its settings file.

macOS

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "engram": {
      "command": "node",
      "args": ["/path/to/engram/packages/mcp/dist/server.js"],
      "env": {
        "ENGRAM_DB_PATH": "/home/you/.engram/engram.db"
      }
    }
  }
}

Windows

Edit %APPDATA%\\Claude\\claude_desktop_config.json:

{
  "mcpServers": {
    "engram": {
      "command": "node",
      "args": ["C:\\path\\to\\engram\\packages\\mcp\\dist\\server.js"],
      "env": {
        "ENGRAM_DB_PATH": "%USERPROFILE%\\.engram\\engram.db"
      }
    }
  }
}

Restart Claude Desktop after saving.


Cursor

Cursor supports MCP via its .cursor/mcp.json project file or the global settings.

Global (all projects)

Edit ~/.cursor/mcp.json:

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

Per-project

Create .cursor/mcp.json in the project root with the same content. Cursor merges project-level and global MCP servers.


Any MCP-compatible client

Engram's MCP server speaks the standard protocol. For any client not listed above, use the stdio transport:

# Run the MCP server directly (stdio transport)
$ ENGRAM_DB_PATH=/path/to/engram.db node packages/mcp/dist/server.js

Refer to your client's documentation for how to register an MCP server using a command or HTTP URL.


Remote Engram server

The MCP server talks to SQLite directly — it constructs the brain in-process and never calls the REST API, so there is no “remote MCP” mode and no host variable. To share one memory store across machines, point every MCP server at the same database file over a network mount:

{
  "mcpServers": {
    "engram": {
      "command": "node",
      "args": ["/path/to/engram/packages/mcp/dist/server.js"],
      "env": {
        "ENGRAM_DB_PATH": "/shared/engram.db"
      }
    }
  }
}
The MCP server accesses SQLite directly — it does not connect to the REST API server. For remote access, use the REST API (http://host:4901) or share the database file over a network mount.
When exposing Engram on a network interface, set HOST=0.0.0.0 and always set ENGRAM_API_KEY — every route except /api/health then requires that key via X-API-Key or Authorization: Bearer. Also restrict browser origins with ENGRAM_ALLOWED_ORIGINS and keep the port firewalled.

How tools fire automatically

When Claude Code detects Engram's MCP server, it enables automatic memory injection:

  • Session startrecall_context is called with a summary of the current task. Top memories are prepended to the system prompt.
  • During conversation — store_memory is called when the AI identifies important new facts, decisions, or events.
  • On user request — any of the 21 tools can be called explicitly via /tools or natural language: "Search your memory for…".

See MCP Tools for full documentation of each tool's parameters and response format.

MCP Integration — Engram Docs