Elasticsearch Knowledge Graph MCP server

Elasticsearch-based knowledge graph that tracks access patterns to prioritize recent, important, and frequently accessed information with advanced search capabilities and complete CRUD operations.
Back to servers
Setup instructions
Provider
Jean-Christophe Hoelt
Release date
Mar 08, 2025
Language
TypeScript
Stats
9 stars

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.

Why AI Models Need Persistent Memory

Ever experienced these frustrations with AI assistants?

  • Your AI forgetting crucial details from earlier conversations
  • Having to repeat the same context every time you start a new chat
  • Losing valuable insights once the conversation history fills up
  • Inability to reference past work or decisions

MCP Memory solves these problems by creating a structured, searchable memory store that preserves context indefinitely.

Installation

Prerequisites

  • Docker: Required for running Elasticsearch (or a local Elasticsearch installation)
  • Node.js: Version 18 or higher
  • npm: For package management

Setup Steps

# 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

Connecting to Claude Desktop

  1. 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
    
  2. Add the command to Claude Desktop:

    • Open Claude Desktop Settings
    • Navigate to the "Commands" section
    • Click "Add New Command"
    • Configure as follows:
      • Name: MCP Memory
      • Command: /path/to/mcp-servers/memory/launch.sh
      • Arguments: Leave empty
      • Run in background: Yes
      • Show in menu: Yes
  3. Verify connection:

    • Start the command from Claude Desktop
    • You should see a notification that Claude is connected to MCP Memory
    • Try asking Claude about something you discussed in a previous conversation

How It Works

MCP Memory creates a structured knowledge graph where:

  1. Entities represent people, concepts, projects, or anything worth remembering
  2. Relations connect entities, creating a network of associations
  3. Observations capture specific details about entities
  4. Relevance scoring determines what information to prioritize

Using Memory with Claude

Example Usage Flow

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?

Admin Tools

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

Advanced Features

Memory Zones

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

Managing Memory Through Conversation

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?

Search Capabilities

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

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later