Memory MCP Server
SQLite-backed MCP server for persistent memory, full-text retrieval, and graph traversal.
★ 0No licensedatabases
Install
Config snippet generator goes here (5 client tabs)
README
# Memory MCP
<!-- markdownlint-disable MD033 -->
[](https://www.npmjs.com/package/@j0hanz/memory-mcp) [](https://github.com/j0hanz/memory-mcp/blob/master/package.json) [](https://github.com/j0hanz/memory-mcp/blob/master/package.json) [](https://github.com/j0hanz/memory-mcp/blob/master/package.json)
[](https://insiders.vscode.dev/redirect/mcp/install?name=memory-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40j0hanz%2Fmemory-mcp%40latest%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=memory-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40j0hanz%2Fmemory-mcp%40latest%22%5D%7D&quality=insiders)
[](https://cursor.com/en/install-mcp?name=memory-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBqMGhhbnovbWVtb3J5LW1jcEBsYXRlc3QiXX0=)
A SQLite-backed MCP server for persistent memory storage, full-text retrieval, and relationship graph traversal.
## Overview
Memory MCP provides a local, persistent memory layer for MCP-enabled assistants. It stores SHA-256-addressed memory items in SQLite with FTS5-powered full-text search, a directed relationship graph, BFS recall traversal, and token-budget-aware context retrieval — all accessible over stdio transport with no external dependencies.
## Key Features
- **13 MCP tools** for CRUD, batch operations, FTS5 search, BFS graph recall, token-budget context retrieval, relationships, and stats.
- **Full-text search** over content and tags via SQLite FTS5 with importance and type filters.
- **Graph recall** with BFS traversal, bounded frontier, and MCP progress notifications per hop.
- **Token-budget retrieval** (`retrieve_context`) selects memories that fit a caller-specified token budget — no manual pagination needed.
- **Strict Zod input validation** with typed output envelopes and SHA-256 hash addressing.
- **Resource support** with `internal://instructions` (Markdown guide) and `memory://memories/{hash}` URI template with hash auto-completion.
- **stdio transport** with clean shutdown handling (`SIGINT`, `SIGTERM`) and no HTTP endpoints. |
## Requirements
- Node.js `>=24`.
- SQLite with FTS5 support (verified at startup).
- Any MCP client that supports stdio command servers.
## Quick Start
Use the npm package directly with `npx` — no installation required:
```json
{
"mcpServers": {
"memory-mcp": {
"command": "npx",
"args": ["-y", "@j0hanz/memory-mcp@latest"]
}
}
}
```
> [!TIP]
> The server uses stdio transport only; no HTTP endpoint is exposed. Stdout must not be polluted by custom logging.
Or run with Docker:
```bash
docker run --rm -i ghcr.io/j0hanz/memory-mcp:latest
```
## Client Configuration
<details>
<summary><b>Install in VS Code</b></summary>
[](https://insiders.vscode.dev/redirect/mcp/install?name=memory-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40j0hanz%2Fmemory-mcp%40latest%22%5D%7D)
Workspace file `.vscode/mcp.json`:
```json
{
"servers": {
"memory-mcp": {
"command": "npx",
"args": ["-y", "@j0hanz/memory-mcp@latest"]
}
}
}
```
CLI:
```bash
code --add-mcp '{"name":"memory-mcp","command":"npx","args":["-y","@j0hanz/memory-mcp@latest"]}'
```
</details>
<details>
<summary><b>Install in VS Code Insiders</b></summary>
[](https://insiders.vscode.dev/redirect/mcp/install?name=memory-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40j0hanz%2Fmemory-mcp%40latest%22%5D%7D&quality=insiders)
CLI:
```bash
code-insiders --add-mcp '{"name":"memory-mcp","command":"npx","args":["-y","@j0hanz/memory-mcp@latest"]}'
```
</details>
<details>
<summary><b>Install in Cursor</b></summary>
[](https://cursor.com/en/install-mcp?name=memory-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBqMGhhbnovbWVtb3J5LW1jcEBsYXRlc3QiXX0=)
`~/.cursor/mcp.json