Skip to main content
MCP Server

Knowledge graph-based persistent memory system

Share
1,100 stars TypeScript MIT Updated: 2025-05-12

Send to Your Agent

Copy this prompt and paste it into Claude, Cursor, or any MCP client to install instantly.

Install the Memory MCP server for me.

Server: Memory
Description: Knowledge graph-based persistent memory system
Install command: npx -y @modelcontextprotocol/server-memory

Environment variables needed:
- MEMORY_FILE_PATH: Path to the memory file (optional, defaults to memory.json in working directory)

GitHub: https://github.com/modelcontextprotocol/servers/tree/main/src/memory

Please install this MCP server and confirm when ready.

Paste into any AI agent with MCP support — works with Claude Desktop, Cursor, Cline, and more.

Quick Install

Config file: ~/Library/Application Support/Claude/claude_desktop_config.json

  1. Open Claude Desktop app
  2. Go to Settings → Developer → Edit Config
  3. Paste the config below into the file
  4. Restart Claude Desktop
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}

Add this to your ~/Library/Application Support/Claude/claude_desktop_config.json

Installation Methods

npx Run directly with npx
npx -y @modelcontextprotocol/server-memory
docker Run with Docker
docker run -i --rm mcp/memory

Tools (9)

create_entities

Create new entities in the knowledge graph with type and observations

create_relations

Create directed relations between entities

add_observations

Add new observations to existing entities

delete_entities

Remove entities and their relations from the knowledge graph

delete_observations

Remove specific observations from entities

delete_relations

Remove relations between entities

read_graph

Read the entire knowledge graph

search_nodes

Search for entities by name or observation content

open_nodes

Open specific entities by name to view their details

Environment Variables

MEMORY_FILE_PATH Optional

Path to the memory file (optional, defaults to memory.json in working directory)

Example: /path/to/memory.json

Compatibility

Claude Desktop
Cursor
Cline
VS Code
Devin (formerly Windsurf)

About

A Model Context Protocol server that provides persistent memory using a local knowledge graph. This lets Claude and other MCP clients remember information about the user across conversations.

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", "Works as a software engineer"]
}

Relations

Relations define directed connections between entities. They are always stored in active voice.

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)

Use Cases

  • User preference memory — Remember coding style, communication preferences
  • Project context — Track project history, decisions, and stakeholders
  • Relationship tracking — Maintain organizational charts and connections
  • Long-term learning — Build up knowledge about domains over time

Related Resources

Compare LLM Pricing

This server works with Claude, GPT-4o, and other models. Compare API costs side-by-side to find the cheapest option for your workflow.