<!-- generated by build_articles.py — edit content/answers/what-is-an-mcp-memory-server.md instead -->
---
title: "What is an MCP memory server?"
canonical: "https://xerj.org/answers/what-is-an-mcp-memory-server"
updated: "2026-11-14"
source: "content/answers/what-is-an-mcp-memory-server.md"
---

# What is an MCP memory server?

**Short answer** (updated 2026-11-14): What is an MCP memory server? It is a Model Context Protocol server that gives an AI assistant tools to save facts and recall them later, so memory survives across chats and clients. The assistant calls the tools itself. XERJ ships one inside its binary: xerj mcp exposes xerj_memory_store and xerj_memory_recall.

**TL;DR** An MCP memory server is a Model Context Protocol server whose tools save and recall facts, so an agent keeps what it learned across chats. XERJ ships one in the same binary as its search engine: `xerj mcp` exposes `xerj_memory_store` and `xerj_memory_recall`.

## Agent prompt

```text
Act as a coding agent. Read https://xerj.org/llms.txt, install XERJ, start a local node, register xerj mcp as an MCP server in this client, call xerj_memory_store with one fact in namespace agentmem, then call xerj_memory_recall and report the hit.
```

## Commands

### Command 1

Note: Install the single XERJ binary. The MCP server is the xerj mcp subcommand of the same binary.

```sh
curl -fsSL https://xerj.org/get | sh
```

### Command 2

Note: Show the MCP server options. It talks to a node you already started; it does not start one.

```sh
xerj mcp --help
```

MCP itself is explained at [What is the Model Context Protocol?](/science/model-context-protocol). Memory is [What is agentic memory?](/science/agentic-memory).

*Figure: The reference server description follows the modelcontextprotocol memory README. The XERJ tools and index layout follow landing/docs/agents/schemas/mcp-tools.json and engine/crates/xerj-api/src/memory_api.rs. This figure does not report a measured recall score.*

## The short definition

MCP is the protocol AI clients like Claude Code and Cursor use to call outside tools. A memory server is an MCP server with two jobs: save a fact when the assistant asks, and find it again later. The protocol is the same as any other MCP server. Only the tools are about memory.

The assistant decides when to call those tools. That is what makes the memory [agentic](/answers/what-is-agentic-memory): the store does not pour every note into the next chat. A fact is written out of the model, and it is read back only when a later task asks for it. If you already use Claude Code's built-in files, see [how Claude Code memory works](/answers/claude-code-memory) for when a server is the right next step.

## Two common designs

The reference server from the modelcontextprotocol project keeps a graph of entities, relations and observations in a local JSONL file. You choose the file with `MEMORY_FILE_PATH`. Lookup walks that graph and matches names and text. It is a good small start, and you can open the file in any editor.

XERJ stores each fact as a document in a search index and finds it with BM25 by default, with filters. Memory then sits next to the files and data your agent already searches, in the same local binary. Use the tabs in the figure above to compare the two designs, then step through a store and recall on XERJ.

For a side-by-side test of two MCP memory tools, see [XERJ vs mcp-memory-service](/compare/xerj-vs-mcp-memory-service). The same questions also appear in the [AI agent memory benchmark](/compare/ai-agent-memory-benchmark) and in the [agentmemory comparison](/compare/xerj-vs-agentmemory).

## How XERJ does it

XERJ is the search engine for AI agents. `xerj mcp` is an MCP stdio server inside the same binary. Point it at a local node you already started. It does not start a node of its own.

`xerj_memory_store` saves a fact to a namespace. The configured embedder runs at write time. Lexical feature hashing is the default, so you do not need a model download or a provider key for that path. `xerj_memory_recall` finds the fact again. The default is BM25 over the stored text. Each namespace is its own `.xerj-memory-{namespace}` index.

Watch two limits. Privacy between agents requires separately scoped API keys, not only different namespace names. And recall with `semantic: true` matches shared words unless the node runs with `--embed-mode neural`. A secured node still requires its own API key even when the embedder is lexical.

## Limits to know

XERJ is single-node. Memories are permanent until explicitly forgotten; there is no decay and no TTL. If you need another data directory, start the node with that directory and point `xerj mcp` at it.

## Try it

Copy the prompt on this page into your coding agent, or read the [agent memory recipe](/docs/recipes/agentic-memory). The commands at the top of this page install the binary and print the `xerj mcp` options.

## Read next

[XERJ vs Memvid](/compare/xerj-vs-memvid), [the AI agent memory benchmark](/compare/ai-agent-memory-benchmark), [agentic memory](/science/agentic-memory), [Model Context Protocol](/science/model-context-protocol) and [best MCP memory servers for Claude Code](/compare/best-mcp-memory-servers-claude-code-2026).

## FAQ

### What does an MCP memory server do?

It gives an AI assistant tools to write facts to a store and read them back later. Any MCP client, such as Claude Code or Cursor, can call those tools.

### How is it different from a normal MCP server?

It is a normal MCP server whose tools happen to be about memory. The protocol is the same; only the tools differ.

### What does the reference MCP memory server store?

The modelcontextprotocol reference server keeps entities, relations and observations in a local JSONL file. You choose the file with MEMORY_FILE_PATH.

### Which memory tools does xerj mcp expose?

xerj_memory_store saves a fact to a namespace and xerj_memory_recall finds it again. They call POST /_memory/{namespace} and its _recall endpoint on a local node.

### Does the XERJ memory server need an API key or a model?

The default lexical embedder needs no model download or external provider key. A secured XERJ node still requires its own API key. Neural or proxy embedding is optional and also runs when memories are stored.

### Where does XERJ keep the memories?

In the node data directory, one .xerj-memory-{namespace} index per namespace. Change the location by starting the node with a different data directory.

## Evidence

- The reference MCP memory server stores a graph of entities, relations and observations in a local JSONL file set by MEMORY_FILE_PATH. Source: [https://github.com/modelcontextprotocol/servers/blob/main/src/memory/README.md](https://github.com/modelcontextprotocol/servers/blob/main/src/memory/README.md)
- xerj mcp exposes xerj_memory_store, which proxies POST /_memory/{namespace}, and xerj_memory_recall, which proxies POST /_memory/{namespace}/_recall. Source: `landing/docs/agents/schemas/mcp-tools.json`
- Each XERJ memory namespace is backed by its own .xerj-memory-{namespace} index. Source: `engine/crates/xerj-api/src/memory_api.rs`

## Related

- [What is the Model Context Protocol?](/science/model-context-protocol)
- [How to use agentic memory in XERJ](/answers/what-is-agentic-memory)
- [How do I set the MCP memory storage path?](/answers/set-mcp-memory-storage-path)
- [How do I give two agents private memory on one laptop?](/answers/private-agent-memory-namespaces)
- [Mem0 vs Zep vs Letta vs Cognee: which agent memory framework fits in 2026?](/compare/xerj-vs-agent-memory-tools)
- [Agent memory](/docs/recipes/agentic-memory)
- [XERJ vs mcp-memory-service: two MCP memory servers, tested](/compare/xerj-vs-mcp-memory-service)
- [AI agent memory benchmark 2026: real tests on 7 open-source projects](/compare/ai-agent-memory-benchmark)
- [Claude Code memory: CLAUDE.md, auto memory, or an MCP memory server?](/answers/claude-code-memory)
- [XERJ vs agentmemory: which memory for your coding agent?](/compare/xerj-vs-agentmemory)
- [Best MCP memory servers for Claude Code in 2026: 8 compared, with install lines](/compare/best-mcp-memory-servers-claude-code-2026) (same intent: agent memory)
- [MemPalace vs claude-mem (and XERJ): which memory should Claude Code use?](/compare/xerj-vs-claude-mem-and-mempalace) (same intent: agent memory)
- [What's a simple way to give an agent long-term memory on my laptop without Qdrant?](/answers/agent-memory-without-postgres-qdrant) (same intent: agent memory)
