MCP server, by Model Context Protocol
Knowledge Graph Memory Server
Node.js MCP server that stores persistent memory as a local knowledge graph of entities, relations and observations.
Quick facts
What it does
The memory server stores facts in a local knowledge graph so a model can retain information across chats. Entities have a unique name, a type, and a list of observations. Relations are directed connections written in active voice, and observations are single facts attached to an entity.
Data persists in a JSONL file. The default location is memory.jsonl in the server directory, and MEMORY_FILE_PATH can point the server at a custom file. A knowledge-graph resource exposes the full graph as JSON and sends update notifications when mutation tools change it.
The server runs with npx or Docker. The Docker example mounts a named volume so the memory file survives container replacement.
Configuration
Run with npx -y @modelcontextprotocol/server-memory, optionally setting MEMORY_FILE_PATH to choose the storage file.
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {"MEMORY_FILE_PATH": "/path/to/custom/memory.jsonl"}
}
}
}Source: https://github.com/modelcontextprotocol/servers/tree/main/src/memory. Placeholders only. Replace them in your own environment, and never commit real keys to a repository.
| Environment variable | Required | Purpose |
|---|---|---|
MEMORY_FILE_PATH | Optional | Path to the memory storage JSONL file. Defaults to memory.jsonl in the server directory. |
Verified tools and features
create_entities and create_relations Config checked
Creates entities with types and observations, and directed relations between existing entities.
add_observations Config checked
Adds atomic fact strings to an existing entity and returns what was added.
search_nodes and open_nodes Config checked
Searches names, types and observation text, or retrieves named nodes with relations between them.
knowledge-graph resource Config checked
Exposes the full graph at memory://knowledge-graph as application/json, with update notifications on mutations.
Security notes
- Memory is stored locally in a JSONL file. Anyone with file access can read what the model saved.
- Delete tools remove entities, observations and relations. Entity deletion cascades to its relations.
- No network or credential access is described. Scope risk by choosing a private MEMORY_FILE_PATH.
An MCP server runs with the permissions of the process you start it from. Scope credentials to the narrowest access the job needs, and review what the client will send before connecting anything sensitive.
Sources and freshness
- Official source: https://github.com/modelcontextprotocol/servers/tree/main/src/memory
- Repository: https://github.com/modelcontextprotocol/servers
Last checked 2026-10-07. Verification label: config checked, which means the configuration and feature list trace to the official source above. It does not mean AgentsUse ran the server. Spotted an error? Send a correction. Back to the MCP server index.