mcp-memory
Standalone MCP server for enabling memory for Claude through a knowledge graph
claude mcp add --transport stdio s2005-mcp-memory-server npx -y @modelcontextprotocol/server-memory \ --env MEMORY_FILE_PATH="/path/to/custom/memory.json"
How to use
This MCP server implements a persistent memory graph using a local knowledge graph. It allows you to create and relate memory entities (e.g., people, organizations, events), attach atomic observations to those entities, and query or search the graph to retrieve contextual memory for a user across chats. The API tools you’ll typically use are: create_entities to add new entities with their initial observations, create_relations to connect entities with active-voice relations, and add_observations to append new facts to existing entities. You can also read the entire graph with read_graph, search for nodes with search_nodes, and retrieve specific nodes with open_nodes to see both the entities and the relations among them. This memory is designed to survive across conversations, enabling features like personalized interactions, memory-based prompts, and relationship tracking over time.
To run, configure the MCP server as shown in the example configuration, then invoke the server via your chosen runner (npx in this setup). Once running, you can use the Claude Desktop integration or your own client to issue the memory tools described in the API, for example: creating a few entities for the user, linking organizations, and storing observations such as preferences, goals, and behavioral notes. The system supports updating the memory incrementally as conversations progress, while ensuring operations are atomic and consistent.
How to install
Prerequisites:
- Node.js (recommended v14+)
- npm (comes with Node.js)
- Optional: Docker if you prefer running via Docker as shown in the README
Installation steps:
- Install the MCP memory server package globally or locally via npm:
# Install as a standalone package (recommended)
npm install -g mcp-memory-server
# Or install locally in a project
npm install mcp-memory-server
- Run the MCP memory server using npx (as described in the docs):
npx -y @modelcontextprotocol/server-memory
- Alternatively, run via Docker (from the README example):
docker run -i -v claude-memory:/app/dist --rm mcp/memory
- If you choose to configure memory storage path, set MEMORY_FILE_PATH in the environment as shown in the example:
export MEMORY_FILE_PATH=/path/to/custom/memory.json
# then run the npx command as above
Note: If you are integrating with Claude Desktop, you can also embed this server under the claude_desktop_config.json using the provided memory server configuration example.
Additional notes
Tips and considerations:
- MEMORY_FILE_PATH controls where the memory JSON file is stored. If not set, memory.json in the server directory is used by default.
- The server exposes a rich set of tools: create_entities, create_relations, add_observations, delete_entities, delete_observations, delete_relations, read_graph, search_nodes, and open_nodes. Use these to build and maintain a coherent memory graph.
- When deleting entities, related relations are cascaded automatically. Deleting observations or relations is silent if the target does not exist.
- For large memory graphs, consider structuring data to keep observations atomic and 使用-friendly, to maintain efficient searches.
- If you run into issues with paths or permissions, ensure the memory file path is writable by the process runtime and that volume mounts (for Docker) are configured correctly.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.