Quickstart: MCP
MCP (Model Context Protocol) lets Claude Desktop and Claude Code use MemLayer as a tool. Claude can store, search, organize, and forget memories on your behalf — no API calls required.
Prerequisites
Section titled “Prerequisites”- Installation completed
- API token ready (
mlk_...)
Claude Desktop setup
Section titled “Claude Desktop setup”Add MemLayer to your claude_desktop_config.json:
{ "mcpServers": { "memlayer": { "url": "https://mcp.memlayer.dev/mcp", "headers": { "X-API-Key": "mlk_your_api_key_here" } } }}The config file location depends on your OS:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Claude Code setup
Section titled “Claude Code setup”Create a .mcp.json file in your project root:
{ "mcpServers": { "memlayer": { "url": "https://mcp.memlayer.dev/mcp", "headers": { "X-API-Key": "mlk_your_api_key_here" } } }}Restart Claude
Section titled “Restart Claude”After adding the configuration, restart Claude Desktop or reload your Claude Code session.
Try it
Section titled “Try it”Open a conversation with Claude and try these prompts in order:
Store a memory (retain):
“Remember that my favorite programming language is Haskell”
Claude calls the retain tool, which extracts the fact and stores it with a vector embedding.
Search memories (recall):
“What’s my favorite programming language?”
Claude calls the recall tool, which performs a semantic search and returns the matching memory.
Consolidate memories (reflect):
“Organize my memories”
Claude calls the reflect tool, which groups related facts into higher-level concepts and domains.
Forget a memory:
“Forget everything about my programming preferences”
Claude calls recall to find matching memories, then calls forget with the relevant entity IDs to remove them.
What happened
Section titled “What happened”Behind the scenes, each prompt triggered a different MemLayer operation:
- Retain extracted “favorite programming language is Haskell” as a structured fact, generated a vector embedding, and stored it in both the bitemporal database and the vector index.
- Recall converted your question into an embedding, searched for semantically similar memories, and returned the best match.
- Reflect scanned stored memories for patterns and grouped related facts into concepts.
- Forget marked the specified entities as deleted in the bitemporal database and removed their vectors from the index. The data remains in the audit history but no longer appears in queries.
Next steps
Section titled “Next steps”- Quickstart: API — call the REST API directly
- Concepts — understand semantic layers, bitemporality, and the knowledge graph
- MCP Tools Reference — full list of available MCP tools and their parameters