home / mcp / knowledge graph memory server

Knowledge Graph Memory Server

MCP server enabling persistent memory for Claude through a local knowledge graph - fork focused on local development

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "itseasy21-mcp-knowledge-graph": {
      "command": "npx",
      "args": [
        "-y",
        "@itseasy21/mcp-knowledge-graph"
      ],
      "env": {
        "MEMORY_FILE_PATH": "YOUR_MEMORY_FILE_PATH"
      }
    }
  }
}

You can run a Knowledge Graph Memory Server to persistently remember user information across chats. It stores entities, their relationships, and observations in a structured memory that your MCP client can read and update over time, enabling personalized and continuous conversations.

How to use

Connect your MCP client to the Memory Server using a stdio configuration. The server runs locally as a small, persistent memory store that your client can query for entities, relations, and observations. Use it to create, read, update, and search memory as your conversation flows. You can configure the memory path to store data at a specific location on your machine and use an environment variable to point the server to that file.

Key capabilities you can leverage include creating entities, defining relations between them, adding observations, and querying or updating memory as you chat. The memory graph supports search across entity names, types, and observations, and it can retrieve specific nodes along with their connected relations.

How to install

Prerequisites you need on your system before installing are Node.js and npm (or you can use npx directly if you have Node installed). Ensure you have internet access to fetch the MCP package from the registry.

Install and run the Memory Server client locally using the provided MCP command configuration. The recommended approach is to install via a client installer and then start the memory server as a standard MCP server.

npx -y @smithery/cli install @itseasy21/mcp-knowledge-graph --client claude

Configuration and usage notes

Memory data is stored in a local file. You can specify the memory file path when you configure the MCP server in your client. The default path is memory.jsonl in the server’s installation directory if you do not provide a custom path.

Example setup configurations

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@itseasy21/mcp-knowledge-graph"
      ],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/your/memory.jsonl"
      }
    }
  }
}

If you need to point to a custom memory file path using CLI arguments instead of an environment variable, you can pass the memory path through the argument list as follows.

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@itseasy21/mcp-knowledge-graph", "--memory-path", "/path/to/your/memory.jsonl"]
    }
  }
}

System prompt and memory etiquette

Use a clear memory management strategy in your conversations. The memory system should capture basic identity, behaviors, preferences, goals, and relationships while keeping the data atomic and easy to update or remove.

Available tools

create_entities

Create multiple new entities in the knowledge graph with names, types, and initial observations.

create_relations

Create multiple new relations between existing entities using source, target, and relation type.

add_observations

Add new observations to existing entities and return the added facts.

delete_entities

Remove entities and their related connections from the graph.

delete_observations

Remove specific observations from entities.

delete_relations

Remove specific relationships between entities.

read_graph

Read and return the entire knowledge graph with all entities and relations.

search_nodes

Search for nodes by name, type, or observations and return matching entities with their relations.

open_nodes

Retrieve specific nodes by name and include their relations.