Mcp Knowledge Graph
@shaneholloman
MCP server enabling persistent memory for Claude through a local knowledge graph - fork focused on local development
Overview
What is Mcp Knowledge Graph?
Mcp Knowledge Graph is an MCP server that gives AI models persistent memory through a local knowledge graph. It stores and retrieves information across conversations using entities, relations, and observations, and works with Claude Code/Desktop and any MCP‑compatible AI platform.
How to use Mcp Knowledge Graph?
Add the server to your claude_desktop_config.json or .claude.json using npx -y mcp-knowledge-graph --memory-path <path>. Optionally create a .aim directory in a project for project‑local storage. Once configured, the AI can use tools prefixed with aim_ (e.g., aim_memory_store, aim_memory_search) to manage memories.
Key features of Mcp Knowledge Graph
- Master Database used by default for all operations
- Multiple named databases for organizing memories by topic
- Automatic project‑local memory using
.aimdirectories - Location override to force project or global storage
- Safe operations with built‑in file marker protection
- Database discovery to list all available stores
Use cases of Mcp Knowledge Graph
- Remembering user preferences, project details, or personal information across AI conversations
- Organizing memories into separate databases (work, personal, health) by context
- Keeping memory files in a synced folder (e.g., Dropbox) for access across multiple machines
- Project‑local memory that stays within a codebase, with automatic detection via
.aimdirectory
FAQ from Mcp Knowledge Graph
What are the .aim directory and _aim file marker?
The .aim directory is a project‑local folder that triggers automatic memory storage. The _aim marker is a safety line ({"type":"_aim","source":"mcp-knowledge-graph"}) placed at the start of every memory file to prevent accidental overwrites of unrelated JSONL files.
How does storage location work?
If a .aim directory exists in the current project, memory files are stored there. Otherwise, the configured global --memory-path directory is used. You can also force project or global location with an optional location parameter.
How do I use multiple named databases?
Pass a context parameter (e.g., "work", "personal") to memory tools. The system automatically creates new database files (e.g., memory-work.jsonl) alongside the master memory.jsonl. No manual setup is required.
What happens if a file lacks the _aim marker?
The server refuses to write to the file and returns an error: “File does not contain required _aim safety marker”. Either add the marker manually or delete the file and let the system recreate it.
What are the requirements to run this server?
Node.js version 22 or later and an MCP‑compatible AI platform (e.g., Claude Desktop).