DEV Community

Ana Julia Bittencourt
Ana Julia Bittencourt

Posted on • Originally published at blog.memoclaw.com

MCP + MemoClaw — giving your Model Context Protocol tools persistent memory

Your AI agent forgets everything between sessions. You know this. You've probably hacked around it with MEMORY.md files, context-stuffing, or just re-explaining things every time you open a new chat.

MemoClaw fixes this with semantic memory-as-a-service. But here's what most people miss: you don't need to write a single line of integration code. The memoclaw-mcp server exposes store, recall, and list as native MCP tools — which means any MCP-compatible client can use MemoClaw out of the box.

Claude Desktop, Cursor, Windsurf, OpenClaw — if it speaks MCP, it gets persistent memory in under five minutes.

What You'll Build

By the end of this tutorial, your MCP client will be able to:

  • Store memories with importance scores and tags
  • Recall memories using semantic search (not just keyword matching)
  • List and manage stored memories across sessions
  • Isolate context per project using namespaces

No REST calls. No SDK imports. Just tool use.

Prerequisites

  • Node.js 18+
  • An Ethereum wallet (MetaMask, Rainbow, etc.) — this is your identity, no registration needed
  • An MCP-compatible client (we'll use OpenClaw as the primary example)

Step 1: Install memoclaw-mcp

npm install -g memoclaw-mcp
Enter fullscreen mode Exit fullscreen mode

That's the entire installation. One package, globally available.

Step 2: Configure Your MCP Client

Every MCP client has a configuration file where you declare available servers. Here's what the MemoClaw block looks like:

OpenClaw

Add to your OpenClaw MCP config:

{
  "mcpServers": {
    "memoclaw": {
      "command": "memoclaw-mcp",
      "env": {
        "MEMOCLAW_PRIVATE_KEY": "your-wallet-private-key"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "memoclaw": {
      "command": "memoclaw-mcp",
      "env": {
        "MEMOCLAW_PRIVATE_KEY": "your-wallet-private-key"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Cursor / Windsurf

Same pattern — find your MCP server config and add the block above.

That's it. One environment variable (your wallet private key), one command. No API keys to generate, no accounts to create, no OAuth flows.

Step 3: Use It

Once configured, your agent sees three new tools: store_memory, recall_memories, and list_memories. Here's what natural usage looks like in an OpenClaw session:

You: "Remember that I prefer TypeScript over JavaScript for all new projects."

Your agent calls:

store_memory({
  content: "User prefers TypeScript over JavaScript for all new projects",
  importance: 0.8,
  tags: ["preference", "language"]
})
Enter fullscreen mode Exit fullscreen mode

Next session — days later:

You: "Set up a new project for me."

Your agent calls:

recall_memories({
  query: "user project preferences programming language"
})
Enter fullscreen mode Exit fullscreen mode

And gets back your TypeScript preference, ranked by semantic relevance. No re-explaining. No context file to maintain.

Namespace Isolation: One Server, Many Projects

Working on multiple projects? Namespaces keep memories separate without running multiple MCP servers:

store_memory({
  content: "Client wants dark mode as default theme",
  namespace: "project-acme",
  tags: ["client-preference", "ui"]
})

store_memory({
  content: "API rate limit set to 100 req/min for free tier",
  namespace: "project-saas",
  tags: ["architecture", "limits"]
})
Enter fullscreen mode Exit fullscreen mode

When you recall within a namespace, you only get memories from that project. Switch projects, switch namespaces — same wallet, clean separation.

MCP vs. Manual Integration: What You're Skipping

Here's the alternative without MCP — a manual REST integration:

import { MemoClaw } from 'memoclaw-sdk';

const client = new MemoClaw({ privateKey: process.env.PRIVATE_KEY });

// Store
await client.store({
  content: "User prefers TypeScript",
  importance: 0.8,
  tags: ["preference"]
});

// Recall
const results = await client.recall({
  query: "programming language preferences"
});
Enter fullscreen mode Exit fullscreen mode

That's maybe 10 lines of code. Not terrible. But with MCP, it's zero lines. Your agent just... uses the tools. The MCP server handles authentication, request signing, and API communication. You configure once and forget.

The real win isn't lines of code — it's that the agent decides when to store and recall on its own. You don't need to build memory logic into your application. The LLM handles it naturally through tool use.

What It Costs

MemoClaw gives you 100 free API calls per wallet. No credit card, no payment setup — just start using it.

After the free tier, each store or recall costs $0.005 (half a cent) paid via x402 with USDC on Base. Fund your wallet, and payments happen automatically per request. No subscriptions, no monthly bills, no surprises.

For most personal agents, 100 free calls covers weeks of casual use. A heavy session might use 10-20 calls. You'll know when you're getting close.

How It Works Alongside Other Tools

memoclaw-mcp plays nicely with other MCP servers. Your agent might have tools for file access, web search, calendar, and memory all running simultaneously. The LLM sees all available tools and picks the right one for the job.

A typical agent setup might look like:

{
  "mcpServers": {
    "memoclaw": {
      "command": "memoclaw-mcp",
      "env": { "MEMOCLAW_PRIVATE_KEY": "..." }
    },
    "filesystem": {
      "command": "mcp-filesystem",
      "args": ["/home/user/projects"]
    },
    "web-search": {
      "command": "mcp-web-search"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

No conflicts. Each server has its own tool namespace. MemoClaw handles memory; everything else does its thing.

Quick Reference: Available MCP Tools

Tool What It Does
store_memory Save a memory with optional importance (0-1), tags, and namespace
recall_memories Semantic search across stored memories
list_memories Browse all memories, optionally filtered by namespace
delete_memory Remove a specific memory by ID

Common Patterns

Preference tracking: Store user preferences with high importance (0.8+) and a preference tag. Recall before making decisions.

Session summaries: At the end of a work session, store a summary of what was accomplished. Next session, recall recent summaries for continuity.

Correction memory: When a user corrects your agent, store the correction with importance 1.0. These should always surface in recall.

Project context: Use namespaces per project. Store architecture decisions, client requirements, and technical constraints. Your agent carries full project context without eating its prompt window.

What's Next

Once you've got basic memory working, explore:

  • Importance scoring strategies — not everything deserves a 0.9
  • Tag taxonomies — consistent tags make filtered recall powerful
  • Immutable memories — lock critical context so it can never be overwritten
  • Batch storage — store up to 100 memories at once for migrations or bulk imports

Get Started

npm install -g memoclaw-mcp
Enter fullscreen mode Exit fullscreen mode

Add the config block. Start a conversation. Tell your agent something worth remembering.

It'll remember.


MemoClaw is memory-as-a-service for AI agents. 100 free calls, no registration required. docs.memoclaw.com

Originally published at blog.memoclaw.com

Top comments (0)