MCP Memory is a robust, Elasticsearch-backed knowledge graph system that gives AI models persistent memory beyond the limits of their context windows. Built for the Model Context Protocol (MCP), it ensures your LLMs remember important information across conversations, creating more coherent, personalized, and effective AI interactions.
Ever experienced these frustrations with AI assistants?
MCP Memory solves these problems by creating a structured, searchable memory store that preserves context indefinitely.
# 1. Clone the repository
git clone https://github.com/mcp-servers/mcp-servers.git
cd mcp-servers/memory
# 2. Install dependencies
npm install
# 3. Start Elasticsearch (uses Docker)
npm run es:start
# Note: If you prefer to use your own Elasticsearch installation,
# set the ES_NODE environment variable to point to your Elasticsearch instance
# 4. Build the project
npm run build
Copy and configure the launch script:
# Copy the example launch file
cp launch.example launch.sh
# Edit launch.sh to add your Groq API key
# This is required for smart memory retrieval
nano launch.sh # or use your preferred editor
Make the script executable:
chmod +x launch.sh
Add the command to Claude Desktop:
Verify connection:
MCP Memory creates a structured knowledge graph where:
Conversation 1: Initial Information
User: My daughter's name is Emma and she's turning 8 next month.
Claude: That's wonderful! Emma will be turning 8 next month. Is there anything special you're planning for her birthday?
Conversation 2: Days or Weeks Later
User: I'm thinking about what to get for a gift.
Claude: If you're looking for gift ideas for Emma's 8th birthday coming up, have you considered what her current interests are?
Conversation 3: After the Birthday
User: The party went really well on Saturday!
Claude: I'm glad Emma's 8th birthday party was a success on Saturday! Did she enjoy the gifts she received?
MCP Memory includes a comprehensive admin CLI for maintaining your knowledge graph:
# Search the memory
node dist/admin-cli.js search "Emma birthday"
# View details about a specific entity
node dist/admin-cli.js entity "Emma"
# Back up your entire memory system
node dist/admin-cli.js backup memory-backup.json
Organize knowledge into separate domains:
# Create a project-specific memory zone
node dist/admin-cli.js zones add client-acme "ACME Corp Project Knowledge"
# Import data into that zone
node dist/admin-cli.js import acme-data.json client-acme
You can instruct Claude to organize memories in different zones through natural conversation:
User: Claude, can you create a new memory zone called "work-project" for storing information about my current work project?
Claude: I've created a new memory zone called "work-project". I'll store information related to your work project in this zone. What would you like me to remember about your project?
User: Claude, let's switch to my "cooking" memory zone now. I want to discuss a recipe.
Claude: I've switched to your "cooking" memory zone. What recipe would you like to discuss today?
Leverage Elasticsearch's powerful search features:
# Fuzzy search (finds "meeting" even with typo)
node dist/admin-cli.js search "meteing notes"
# Zone-specific search
node dist/admin-cli.js search "budget" client-acme
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "elasticsearch-knowledge-graph" '{"command":"npm","args":["run","start"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"elasticsearch-knowledge-graph": {
"command": "npm",
"args": [
"run",
"start"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"elasticsearch-knowledge-graph": {
"command": "npm",
"args": [
"run",
"start"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect