# Memory

> Memory is an open-source MCP server for knowledge and memory. Persistent knowledge-graph memory for AI assistants, stored in a local file. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted
- **Repository:** https://github.com/modelcontextprotocol/servers/tree/HEAD/src/memory
- **MCP Registry name:** io.github.modelcontextprotocol/server-memory
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory), [agent memory](https://ai-powered.com/categories/agent-memory)
- **Listing updated:** 2026-11-27

## About

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.

## Features

- **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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
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.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

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

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

### Cursor (~/.cursor/mcp.json)

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

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

### VS Code (~/.copilot/mcp-config.json)

```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.

### Codex: Add with the CLI (Terminal)

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

### Codex: Or add to config.toml (~/.codex/config.toml)

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

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

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

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

### Devin Desktop (~/.config/devin/mcp_config.json)

```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.

### Cline (cline_mcp_settings.json)

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

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

### Zed (Zed settings.json)

```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.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

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

### Kiro (~/.kiro/settings/mcp.json)

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

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

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_entities` (name suggests: changes): Create multiple new entities in the knowledge graph
- `create_relations` (name suggests: changes): Create multiple new relations between entities
- `add_observations` (name suggests: changes): Add new observations to existing entities
- `delete_entities` (name suggests: deletes): Remove whole entities, with all their observations
- `delete_observations` (name suggests: deletes): Remove specific observations from entities
- `delete_relations` (name suggests: deletes): Remove specific relations from the graph
- `read_graph` (name suggests: reads): Read the entire knowledge graph
- `search_nodes` (name suggests: reads): Search for nodes based on query
- `open_nodes`: Retrieve specific nodes by name

## 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.

## Alternatives

- [MCP Neo4j Memory](https://ai-powered.com/mcp/mcp-neo4j-memory): MCP Neo4j Memory is an open-source MCP server for knowledge and memory.
- [Neurodivergent Memory](https://ai-powered.com/mcp/neurodivergent-memory): Neurodivergent Memory is an open-source MCP server for knowledge and memory.
- [Gnosis Memory](https://ai-powered.com/mcp/gnosis-memory): Gnosis Memory is a freemium MCP server for knowledge and memory.
- [Memory](https://ai-powered.com/mcp/memory-6): Memory is an MCP server for knowledge and memory.
- [Memory](https://ai-powered.com/mcp/memory-8): Memory is an MCP server for knowledge and memory.
- [NeuroDock Cognitive Graph](https://ai-powered.com/mcp/neurodock-cognitive-graph): NeuroDock Cognitive Graph is an open-source MCP server for knowledge and memory.
- [Mnemograph](https://ai-powered.com/mcp/mnemograph): Mnemograph is an open-source MCP server for knowledge and memory.
- [Memory MCP Server](https://ai-powered.com/mcp/memory-mcp-server): Memory MCP Server is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/memory-9
