mcp-engram
Enables LLMs to build and explore a cognitive neuroscience-inspired knowledge graph with SQLite, supporting search, graph traversal, temporal sequences, and structured reasoning.
README
MCP Engram — Cognitive Knowledge Graph
A Model Context Protocol (MCP) server for building and exploring a cognitive neuroscience-inspired knowledge graph. Models thought, emotion, reasoning, and episodic memory after the structure of the human mind. Backed by SQLite — zero infrastructure, single file on disk, works offline.
Quick Start
npx mcp-engram
Or install globally:
npm install -g mcp-engram
mcp-engram
The server stores its database at ~/.mcp-engram/knowledge.db by default. No external services required.
Architecture
How It Works
The MCP server exposes 8 tools that let an LLM build, search, and traverse a knowledge graph:
| Tool | Purpose |
|---|---|
search_nodes |
Full-text search across all nodes (FTS5) |
explore_context |
Weighted graph traversal around given nodes |
create_nodes |
Create or upsert nodes of any type |
create_relations |
Create edges with context, weight, and confidence |
add_sources |
Record provenance (Source nodes + DERIVED_FROM links) |
get_temporal_sequence |
Follow chronological chains (NEXT, BEFORE, CAUSES) |
create_reasoning_chain |
Build structured multi-step reasoning |
get_reasoning_chain |
Retrieve reasoning chains by name or topic |
Node Types (15)
Entity, Event, Concept, Attribute, Proposition, Emotion, Agent, ScientificInsight, Law, Location, Thought, ReasoningChain, ReasoningStep, Source, EmotionalEvent
Storage
- SQLite with WAL mode for concurrent reads
- FTS5 virtual table for full-text search with BM25 ranking
- Recursive CTEs for graph traversal
- Single
nodestable for all types,edgestable with UNIQUE constraint, plusaliasesandobservationstables - Complex objects stored as JSON in a
propertiescolumn
Installation
Prerequisites
- Node.js v18+
- A C/C++ toolchain for compiling the
better-sqlite3native module:- Mac: Xcode Command Line Tools (
xcode-select --install) - Linux:
build-essential(apt install build-essential) - Windows: Visual Studio Build Tools
- Mac: Xcode Command Line Tools (
From npm
npx mcp-engram
From source
npm install
npx nx build mcp-engram
node dist/servers/mcp-engram/main.js
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
MCP_ENGRAM_DB_PATH |
No | ~/.mcp-engram/knowledge.db |
Path to the SQLite database file |
Integrating with Claude Desktop
Add the server to your Claude Desktop config:
-
Open your config file:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- Mac:
-
Add the server configuration:
{
"mcpServers": {
"mcp-engram": {
"command": "npx",
"args": ["mcp-engram"]
}
}
}
- Restart Claude Desktop.
Project Structure
servers/mcp-engram/ # MCP server (TypeScript, ESM)
src/main/ # Server bootstrap, tool handlers, prompts
src/storage/ # SQLite backend, FTS, schema, validation
src/types/ # TypeScript interfaces and enums
libs/graphrag-memory/ # Shared type library (Entity, Relation, etc.)
Development
# Build all projects
npx nx run-many -t build
# Test all projects
npx nx run-many -t test
# Lint
npx nx lint mcp-engram
# Build specific project
npx nx build mcp-engram
npx nx build graphrag-memory
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.