home / mcp / knowledge graph memory mcp server
Provides persistent memory for Claude by storing entities, relations, and observations in a local knowledge graph.
Configuration
View docs{
"mcpServers": {
"rmranjit-mcp-memory": {
"command": "docker",
"args": [
"run",
"-i",
"-v",
"claude-memory:/app/dist",
"--rm",
"mcp/memory"
],
"env": {
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
}
}
}
}You run a local memory server that lets Claude remember information about users across chats by storing entities, relations, and observations in a persistent knowledge graph. This enables personalized interactions, remembers user preferences, and tracks relationships over time.
Interact with Claude through your MCP client to leverage the memory server. The memory system maintains a graph of entities (people, organizations, events), the relations between them, and atomic observations about each entity. The client can read the full graph, search for nodes, and update memories as you gather new facts during conversations.
Practical usage patterns include creating new entities for recurring participants or organizations, linking them with relations such as works_at or located_in, and adding observations like preferences or identifying details. You can retrieve all memory data at the start of a session to tailor the interaction, and continuously update memory as new facts arise.
Key capabilities you’ll use regularly: - Create or update entities with associated observations - Establish directed relations between entities - Read the entire memory graph to understand context - Search for nodes by name, type, or observation content to find relevant connections - Open specific nodes to view their details and connected relations
Prerequisites: you need a runtime environment that can execute Node.js commands or Docker containers.
Choose one installation method below and follow the steps to start the memory server.
Option A: Run with Docker
docker pull mcp/memory
docker run -i -v claude-memory:/app/dist --rm mcp/memoryOption B: Run with NPX
npx -y @modelcontextprotocol/server-memoryOption C: NPX with a custom memory file path
npx -y @modelcontextprotocol/server-memory
# Or configure the environment variable for a custom path
MEMORY_FILE_PATH=/path/to/custom/memory.json npx -y @modelcontextprotocol/server-memoryNote: MEMORY_FILE_PATH defines where memory is stored. If you don’t set it, memory.json in the server directory is used by default.
Configuration and usage notes, security considerations, and troubleshooting tips are provided to help you run and maintain the memory server reliably.
Create multiple new entities in the knowledge graph. Each entity must include a name, an entityType, and an observations array.
Create multiple new relations between entities. Each relation defines a from, to, and relationType in active voice.
Add new observations to existing entities. Returns added observations per entity; fails if the target entity does not exist.
Remove entities and cascadingly delete their associated relations.
Remove specific observations from entities. Silent if an observation does not exist.
Remove specific relations from the graph. Silent if the relation does not exist.
Read and return the entire knowledge graph, including all entities and relations.
Search nodes by a query across names, types, and observations. Returns matching entities and their relations.
Retrieve specific nodes by name along with the relationships among the requested nodes. Non-existent nodes are skipped silently.