Skip to content
MCP server

Memory

Persistent knowledge-graph memory for AI assistants, stored in a local file

Runs locally

Memory is an open-source MCP server for knowledge and memory. It runs locally on your machine and is started by your AI client.

Pricing
Open source
Platforms
CLI, API, Self-hosted
Runs
Locally
What it can do
Can delete data (3 tools)
Version
2.2.2
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add server-memory -- npx -y @modelcontextprotocol/server-memory

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

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

Claude Code setup guide

Add to claude_desktop_config.json

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

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

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

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "server-memory": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add server-memory -- npx -y @modelcontextprotocol/server-memory

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.server-memory]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-memory"]

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "server-memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

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

    Or run: gemini mcp add -s user server-memory npx -- -y @modelcontextprotocol/server-memory

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

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

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

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

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

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

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "server-memory": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-memory"
          ]
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

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

    Junie

    Add to ~/.junie/mcp/mcp.json

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

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

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

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

About Memory

Gives an AI assistant a place to keep what it learns about a person across separate conversations. Information is organised as a graph: named entities with a type and a list of short observations, connected by directed, active-voice relations such as works_at. The assistant can add, search, read and delete any part of that graph through MCP tools, and the whole graph is also exposed as a JSON resource that clients can subscribe to.

The graph is saved to a JSONL file on the local machine, with atomic writes and a file lock so several clients can share one memory file without losing changes. The server runs over stdio by default and can also run as a streamable HTTP service bound to localhost. Optional environment variables cap the number of entities, relations or file size.

It suits developers and power users who want a transparent, editable memory they can inspect, back up and clear themselves, rather than a memory held inside a hosted service. Setup is a single npx command or a Docker image, and the server is MIT licensed.

Tools this server provides (9)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 3 of 9 tools delete data and 3 change data; 1 name doesn't say.

From the server's own tool labels and tool names; not verified by us.

create_entitiesName suggests: changes
Create multiple new entities in the knowledge graph
create_relationsName suggests: changes
Create multiple new relations between entities
add_observationsName suggests: changes
Add new observations to existing entities
delete_entitiesName suggests: deletes
Remove whole entities, with all their observations
delete_observationsName suggests: deletes
Remove specific observations from entities
delete_relationsName suggests: deletes
Remove specific relations from the graph
read_graphName suggests: reads
Read the entire knowledge graph
search_nodesName suggests: reads
Search for nodes based on query
open_nodes
Retrieve specific nodes by name

What it does

Knowledge graph storage
Stores entities, typed observations and directed relations in a local JSONL file.
Full set of graph tools
Create, search, read, update and delete entities, observations and relations through MCP tools.
Search and partial reads
Search by name, type or observation text, and limit how much of a large graph is returned.
Live resource updates
Exposes the graph as a JSON resource that notifies subscribed clients when it changes.
Safe shared file access
Uses atomic saves and a lock file so several clients can write the same memory file.
Optional size limits
Environment variables can cap entities, relations or total file bytes.

Good for

  • Letting a chat assistant remember a user's preferences and background between sessions
  • Tracking people, organisations and events and how they relate to one another
  • Inspecting, editing or exporting what an assistant has stored about a user
  • Sharing one persistent memory file between several local MCP clients
  • Running a memory service over HTTP for clients on the same machine

Pricing

Open source

Free and MIT licensed

Memory FAQ

Where is the memory stored?

By default in a memory.jsonl file inside the server's directory. The MEMORY_FILE_PATH variable sets a custom location, and the documentation recommends an absolute path you own.

Does Memory need an API key or internet access?

No environment variables are required in the registry entry. The graph is kept in a local file.

Can several clients use the same memory?

Yes. Write tools take an exclusive lock on a file next to the memory file, so writes from different server processes take turns.

What does Memory require to run?

Node.js 24 or later when run through npx or from source. A Docker image is also provided.

Is Memory free?

Yes. Memory is open source, so you can use and self-host it for free.

How do I add Memory to Claude Code?

Run this command in your terminal: claude mcp add server-memory -- npx -y @modelcontextprotocol/server-memory

What are the best alternatives to Memory?

The closest alternatives to Memory are MCP Neo4j Memory, Neurodivergent Memory, Gnosis Memory, Memory and Memory.

Where this comes from

  • Description: written from the project's README and its MCP Registry entry.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers