Knowledge Graph Memory Server MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add knowledge-graph-memory -- npx -y @modelcontextprotocol/server-memory
README.md

Persistent memory for Claude using a local knowledge graph

Knowledge Graph Memory Server

A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.

Core Concepts

Entities

Entities are the primary nodes in the knowledge graph. Each entity has:

  • A unique name (identifier)
  • An entity type (e.g., "person", "organization", "event")
  • A list of observations

Example:

{
  "name": "John_Smith",
  "entityType": "person",
  "observations": ["Speaks fluent Spanish"]
}

Relations

Relations define directed connections between entities. They are always stored in active voice and describe how entities interact or relate to each other.

Example:

{
  "from": "John_Smith",
  "to": "Anthropic",
  "relationType": "works_at"
}

Observations

Observations are discrete pieces of information about an entity. They are:

  • Stored as strings
  • Attached to specific entities
  • Can be added or removed independently
  • Should be atomic (one fact per observation)

Example:

{
  "entityName": "John_Smith",
  "observations": [
    "Speaks fluent Spanish",
    "Graduated in 2019",
    "Prefers morning meetings"
  ]
}

API

Tools

  • create_entities

    • Create multiple new entities in the knowledge graph
    • Input: entities (array of objects)
      • Each object contains:
        • name (string): Entity identifier
        • entityType (string): Type classification
        • observations (string[]): Associated observations
    • Ignores entities with existing names
  • create_relations

    • Create multiple new relations between entities
    • Input: relations (array of objects)
      • Each object contains:
        • from (string): Source entity name
        • to (string): Target entity name
        • relationType (string): Relationship type in active voice
    • Skips duplicate relations
  • add_observations

    • Add new observations to existing entities
    • Input: observations (array of objects)
      • Each object contains:
        • entityName (string): Target entity
        • contents (string[]): New observations to add
    • Returns added observations per entity
    • Fails if entity doesn't exist
  • delete_entities

    • Remove entities and their relations
    • Input: entityNames (string[])
    • Cascading deletion of associated relations
    • Silent operation if entity doesn't exist
  • delete_observations

    • Remove specific observations from entities
    • Input: deletions (array of objects)
      • Each object contains:
        • entityName (string): Target entity
        • observations (string[]): Observations to remove
    • Silent operation if observation doesn't exist
  • delete_relations

    • Remove specific relations from the graph
    • Input: relations (array of objects)
      • Each object contains:
        • from (string): Source entity name
        • to (string): Target entity name
        • relationType (string): Relationship type
    • Silent operation if relation doesn't exist
  • read_graph

    • Read the entire knowledge graph
    • No input required
    • Returns complete graph structure with all entities and relations
  • search_nodes

    • Search for nodes based on query
    • Input: query (string)
    • Searches across:
      • Entity names
      • Entity types
      • Observation content
    • Returns matching entities and their relations
  • open_nodes

    • Retrieve specific nodes by name
    • Input: names (string[])
    • Returns:
      • Requested entities
      • Relations between requested entities
    • Silently skips non-existent nodes

Usage with Claude Desktop

Setup

Add this to your claude_desktop_config.json:

Docker
{
  "mcpServers": {
    "memory": {
      "command": "docker",
      "args": ["run", "-i", "-v", "claude-memory:/app/dist", "--rm", "mcp/memory"]
    }
  }
}
NPX
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}
NPX with custom setting

The server can be configured using the following environment variables:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
      }
    }
  }
}
  • MEMORY_FILE_PATH: Path to the memory storage JSON file (default: memory.json in the server directory)

VS Code Installation Instructions

For quick installation, use one of the one-click installation buttons below:

[![Install with NPX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-NPM-24

Tools (9)

create_entitiesCreate multiple new entities in the knowledge graph
create_relationsCreate multiple new relations between entities
add_observationsAdd new observations to existing entities
delete_entitiesRemove entities and their relations
delete_observationsRemove specific observations from entities
delete_relationsRemove specific relations from the graph
read_graphRead the entire knowledge graph
search_nodesSearch for nodes based on query
open_nodesRetrieve specific nodes by name

Environment Variables

MEMORY_FILE_PATHPath to the memory storage JSON file

Configuration

claude_desktop_config.json
{"mcpServers": {"memory": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"]}}}

Try it

Remember that I prefer to use Python for all my data analysis tasks.
Create an entity for 'Project Alpha' and note that it is currently in the planning phase.
Search for all entities related to 'Anthropic' to see what I have stored.
Add an observation to 'John_Smith' that he is now working on the new marketing campaign.
What do you know about my current project status?

Frequently Asked Questions

What are the key features of Knowledge Graph Memory Server?

Persistent storage of entities, relations, and observations. Cascading deletion of relations when entities are removed. Atomic observation management for granular fact tracking. Full graph retrieval and keyword-based node searching. Customizable storage file path via environment variables.

What can I use Knowledge Graph Memory Server for?

Retaining user preferences and project context across multiple chat sessions. Building a personal knowledge base of contacts, events, and organizations. Tracking project milestones and status updates over time. Linking related concepts to help Claude provide more context-aware responses.

How do I install Knowledge Graph Memory Server?

Install Knowledge Graph Memory Server by running: npx -y @modelcontextprotocol/server-memory

What MCP clients work with Knowledge Graph Memory Server?

Knowledge Graph Memory Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Knowledge Graph Memory Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare