Connect r3 to your MCP client
r3 is a local-first memory server for MCP clients. It stores facts and conversation context through tools over standard input and output. This guide connects your client, writes a test memory, and reads it back in a new conversation.
How it works
Section titled “How it works”Your MCP client launches r3 over stdio. r3 stores memory locally in three layers:
- Embedded Redis stores memory content and metadata via
redis-memory-server(auto-downloaded binary, no external service). Falls back to an in-process store if it cannot start. - vectra provides a local, file-backed vector index for semantic search with no network calls.
- Mem0 cloud is optional. Set
MEM0_API_KEYto sync memories across machines. Without a key, nothing leaves your machine.
Prerequisites
Section titled “Prerequisites”- Node.js 18 or later
- An MCP client (Claude Desktop, Claude Code, or Cursor)
- Network access for the initial npm install and Redis binary download
- A writable working directory for the vector index
Connect r3 to your client
Section titled “Connect r3 to your client”-
Add r3 to your MCP config
Edit
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS (or the equivalent path on your OS):{"mcpServers": {"r3": {"command": "npx","args": ["@n3wth/r3"]}}}Run this command in your terminal:
Terminal window claude mcp add r3 "npx @n3wth/r3"Add to
.cursor/mcp.jsonin your project (or the global Cursor MCP config):{"mcpServers": {"r3": {"command": "npx","args": ["@n3wth/r3"]}}} -
Restart and confirm tools
Restart or reconnect your MCP client after editing the configuration. Inspect the discovered tools:
add_memory,search_memory, andcache_statsshould appear. A successful MCP connection confirms transport readiness. -
Write a memory
Ask the assistant to store a preference:
Remember that I prefer TypeScript and dark mode.Confirm that the client calls
add_memorywith your message. ASavedresponse acknowledges the request; the next step checks retrieval. -
Read it back in a new conversation
Start a new conversation and ask:
What are my preferences?Confirm that the client calls
search_memoryand returns the preference you stored. An answer drawn from the current conversation does not verify retrieval. If the result is missing, see Troubleshooting.
Check persistence separately
Section titled “Check persistence separately”A new conversation and a server restart are different checks. Restart r3 from the same working directory, then retrieve your test memory again. Review the storage limitations before relying on restart persistence. Keep an independent copy of data you cannot lose.