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/Jacksini/engram-mcp.git
cd engram-mcp
npm install
npm run build
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-df55 -- 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

A persistent memory server for AI agents with SQLite and graph relationships.

Engram

A persistent memory server for AI agents, implemented as an MCP (Model Context Protocol) server. Stores structured notes/memories in a local SQLite database with full-text search, tagging, categorisation, TTL expiration, directional graph relationships, and full change history.

Features

  • 32 MCP tools full CRUD, search, bulk ops, import/export, stats, tag utilities, graph relations, versioning
  • CLI engram-cli for querying and managing memories from the terminal
  • SQLite + FTS5 fast full-text search with any / all / near modes
  • Graph relations link memories with typed edges (caused, references, supersedes, related)
  • Change history every create/update/delete is tracked automatically; restore any previous version
  • TTL optional expires_at on every memory; auto-purge on startup
  • Rich filtering by category, tag, metadata key/value, date ranges, sort order
  • ESLint + Prettier enforced code style
  • 455 tests full coverage via Vitest (npm test)

Requirements

  • Node.js 18+
  • A host that supports MCP servers (VS Code with Copilot, Claude Desktop, etc.)

Installation

git clone https://github.com/Jacksini/engram-mcp.git
cd engram-mcp
npm install
npm run build

The compiled server is at build/index.js and the CLI at build/cli.js.


Configuration

VS Code (Copilot / MCP extension)

Add to your mcp.json (Ctrl+Shift+P MCP: Open User Configuration):

{
  "servers": {
    "engram-mcp": {
      "type": "stdio",
      "command": "node",
      "args": ["C:/path/to/engram-mcp/build/index.js"]
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "engram-mcp": {
      "command": "node",
      "args": ["C:/path/to/engram-mcp/build/index.js"]
    }
  }
}

Custom database path

By default the database is stored at ~/.engram/memories.db. Override it with:

"env": { "ENGRAM_DB_PATH": "C:/custom/path/memories.db" }

CLI

engram-cli lets you interact with the memory database from the terminal without needing an MCP client.

# Install globally (after npm run build)
npm link

# Or run directly
node build/cli.js <command> [options]

CLI commands

engram-cli [--db ] [--json] <command> [args] [options]

COMMANDS
  search <query>              FTS search (--limit, --mode, --category, --tag)
  list                        List memories (--category, --tag, --limit, --sort)
  get <id>                    Get a memory by UUID
  save <content>              Save a new memory (--category, --tags, --metadata, --expires)
  update <id>                 Update a memory (--content, --category, --tags, --metadata)
  delete <id> [--yes]         Delete a memory (asks for confirmation unless --yes)
  stats                       Database statistics
  backup                      Create a timestamped backup of the database
  link <from_id> <to_id>      Link two memories (--relation)
  unlink <from_id> <to_id>    Remove a link
  graph [--include-orphans]   Show memory graph (--relation, --mermaid-only)
  history <id>                Change history for a memory (--limit)
  restore <id> <history_id>   Restore a memory to a previous version
  help                        Show help
Examples
# Search and show results as JSON
engram-cli search "sqlite fts5" --limit 5 --json

# List recent code memories
engram-cli list --category code --limit 10

# Save a new memory with tags
engram-cli save "Use json_each() to query JSON arrays in SQLite" --category code --tags "sqlite,json"

# Show full memory
engram-cli get abc12345-...

# Show the memory graph as Mermaid diagram
engram-cli graph --mermaid-only

# See history of a memory and restore a version
engram-cli history abc12345-...
engram-cli restore abc12345-... 42

MCP Tools reference

Create

Tool Description
save_memory Save a single memory
save_memories Save up to 50 memories in one transaction (supports compact output)

Common input fields:

Field Type Required Description
content string (110 000 chars) Text content to store
category enum general code decision bug architecture convention
tags string[] Arbitrary labels for filtering
metadata object Any JSON key/value pairs
expires_at string | null (ISO 8601) Auto-expiration. null = never expires

Read

Tool Description
get_memory Fetch a single memory by UUID
get_memories Fetch multiple memories by UUID array
list_memories Paginated listing with filters and sort
search_memories Ful

Tools (6)

save_memorySave a single memory to the database.
save_memoriesSave up to 50 memories in one transaction.
get_memoryFetch a single memory by UUID.
get_memoriesFetch multiple memories by UUID array.
list_memoriesPaginated listing of memories with filters and sort.
search_memoriesFull-text search across stored memories.

Environment Variables

ENGRAM_DB_PATHCustom file path for the SQLite database

Configuration

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

Try it

Save a new memory about the project architecture with the tag 'architecture'.
Search for all memories related to 'sqlite' and 'fts5'.
List the 10 most recent memories in the 'code' category.
Get the full history for the memory with ID abc12345.
Link the memory about 'bug-fix' to the memory about 'feature-request'.

Frequently Asked Questions

What are the key features of Engram?

Persistent storage using local SQLite with FTS5 full-text search. Directional graph relationships between memories using typed edges. Automatic change history tracking with version restoration. TTL-based expiration for automated memory cleanup. Rich filtering by category, tags, metadata, and date ranges.

What can I use Engram for?

Maintaining long-term context for AI agents across different sessions. Storing project-specific conventions and architecture decisions. Tracking bug reports and their associated fixes over time. Building a searchable knowledge base of code snippets and documentation.

How do I install Engram?

Install Engram by running: git clone https://github.com/Jacksini/engram-mcp.git && cd engram-mcp && npm install && npm run build

What MCP clients work with Engram?

Engram 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 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