EngramEngramdocs
v0.1.0
Search docs…⌘K
GitHub
Integrations

MCP Integration

The Model Context Protocol (MCP) is an open standard that lets AI clients connect to external tools. Engram exposes all 18 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.

Setup

Create .mcp.json in your project root (or home directory for global access):

{
  "mcpServers": {
    "engram": {
      "command": "node",
      "args": ["/path/to/engram/packages/mcp/dist/server.js"],
      "env": {
        "ENGRAM_DB_PATH": "/path/to/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/server/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": "~/.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

If Engram runs on a different machine (e.g., a dev server or NAS), point the MCP server at the remote host by setting the ENGRAM_HOST environment variable:

{
  "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" in the daemon config and ensure the port is firewalled from public access. Engram has no built-in authentication.

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 conversationstore_memory is called when the AI identifies important new facts, decisions, or events.
  • On user request — any of the 18 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