Memory MCP
Provides persistent storage of conversation memories using MongoDB database with support for saving, retrieving, adding, and clearing memory records.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Memory MCP Server (Embedded GraphRAG + Vector Memory)
Persistent knowledge graph memory and context window caching for LLM conversations. Built on an embedded KuzuDB Cypher graph database with local HuggingFace vector embeddings (
Xenova/all-MiniLM-L6-v2) — zero external database setup required.
An MCP (Model Context Protocol) server that provides hybrid semantic vector + multi-hop Cypher graph memory retrieval and context window caching for AI coding environments like Cursor and Claude Desktop.
Why Use Memory MCP?
Embedded Knowledge Graph (KuzuDB) – Stores entities, observations, and typed relationships in a local, in-process Cypher graph database (
~/.memory-mcp/graph_db) with zero external setup.Hybrid Vector + Graph Retrieval – Uses local 384-d embeddings (
Xenova/all-MiniLM-L6-v2) and Kuzuarray_cosine_similarityto find entry nodes, then traverses 1–3 relationship hops via Cypher so the LLM only receives compact, high-signal facts.Context Window Caching – Intelligent archiving, semantic relevance scoring, and graph-linked summaries (
Summarizes/Mentionsedges).Zero-Config Install – No MongoDB or Neo4j server required.
Related MCP server: MongoDB MCP Server for LLMs
Quick Start
Install in Cursor (Recommended):
Or install manually:
npm install -g @jamesanz/memory-mcp
# Or from source:
git clone https://github.com/JamesANZ/memory-mcp.git
cd memory-mcp && npm install && npm run buildFeatures
Knowledge Graph & Hybrid Retrieval Tools
store-graph-memory– Upsert structured entities (name,entityType,observations[]) and directedrelations(from,to,relationType) with automatic 384-d embeddings.query-memory– Hybrid semantic vector + multi-hop Cypher traversal query that returns only the relevant connected subgraph and memory chunks.remove-graph-entities– Remove outdated entities or specific relationships so contradictory facts do not linger.
Basic Memory Tools
save-memories– Save memories to the graph database (overwrites existing)get-memories– Retrieve all stored memory logsadd-memories– Append new memories and auto-extract entity mentionsclear-memories– Remove all stored memories and graph entities
Context Window Caching
archive-context– Archive conversation context with tags and vector embeddingsretrieve-context– Retrieve relevant archived contextscore-relevance– Score archived content relevance using vector cosine similaritycreate-summary– Create summaries of archived content linked viaSummarizesedgesget-conversation-summaries– Get all summaries for a conversationsearch-context-by-tags– Search archived content by tags
Configuration
By default, the graph database and local embedding model cache are stored in ~/.memory-mcp/. You can customize these paths via environment variables:
export MEMORY_DB_PATH="/custom/path/to/graph_db"
export MEMORY_MODEL_CACHE_DIR="/custom/path/to/models"Claude Desktop
Add to claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"memory-mcp": {
"command": "node",
"args": ["/absolute/path/to/memory-mcp/build/index.js"]
}
}
}Usage Examples
Store Structured Graph Memory
{
"tool": "store-graph-memory",
"arguments": {
"entities": [
{
"name": "memory-mcp",
"entityType": "Project",
"observations": ["Uses embedded KuzuDB graph database", "Written in TypeScript with ESM"]
},
{
"name": "KuzuDB",
"entityType": "Tech",
"observations": ["In-process property graph database supporting Cypher and vector similarity"]
}
],
"relations": [
{
"from": "memory-mcp",
"to": "KuzuDB",
"relationType": "USES_DATABASE"
}
],
"llm": "claude"
}
}Query Subgraph Memory
{
"tool": "query-memory",
"arguments": {
"query": "What database architecture does memory-mcp use?",
"maxHops": 2,
"limit": 5
}
}Technical Details
Built with: Node.js, TypeScript, MCP SDK, KuzuDB (kuzu), HuggingFace Transformers (@huggingface/transformers), zod
Storage: Embedded KuzuDB (~/.memory-mcp/graph_db)
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted memory for AI agents over MCP. One memory shared by all your agents.
A Model Context Protocol server for Wix AI tools
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol server that provides access to MongoDB databases. This server enables LLMs to inspect collection schemas and execute read-only queries.8391 npm283MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.1MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.MIT
- AlicenseDqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.5MIT