Skip to main content

MCP Integration

MemoClaw provides an MCP (Model Context Protocol) server for seamless integration with Claude Desktop, Cursor, Windsurf, and any MCP-compatible application.

Installation

1

Install via npm

npm install -g memoclaw-mcp
2

Configure your wallet

Set your EVM private key with USDC on Base:
export MEMOCLAW_PRIVATE_KEY=0xYourPrivateKey
Use a dedicated wallet with USDC for API payments. The free tier includes 100 calls per wallet.
3

Configure your MCP client

Add MemoClaw to your MCP configuration file.

Client Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
  "mcpServers": {
    "memoclaw": {
      "command": "npx",
      "args": ["-y", "memoclaw-mcp"],
      "env": {
        "MEMOCLAW_PRIVATE_KEY": "0xYourPrivateKey"
      }
    }
  }
}

Cursor

Add to MCP settings in Cursor preferences:
{
  "mcpServers": {
    "memoclaw": {
      "command": "npx",
      "args": ["-y", "memoclaw-mcp"],
      "env": {
        "MEMOCLAW_PRIVATE_KEY": "0xYourPrivateKey"
      }
    }
  }
}

OpenClaw (via mcporter)

If you’re running OpenClaw, use mcporter to add MemoClaw:
npm install -g memoclaw-mcp
mcporter add memoclaw --stdio "memoclaw-mcp" --env "MEMOCLAW_PRIVATE_KEY=0xYourPrivateKey"
Or use the auto-setup script from the MemoClaw skill on ClawHub:
export MEMOCLAW_PRIVATE_KEY=0xYourPrivateKey
bash skills/memoclaw/scripts/setup.sh
Once configured, your agent can call MemoClaw directly:
mcporter call memoclaw.memoclaw_store '{"content": "User prefers dark mode", "importance": 0.8}'
mcporter call memoclaw.memoclaw_recall '{"query": "UI preferences"}'

Other MCP Clients

Any MCP-compatible client can use the server:
npx -y memoclaw-mcp

Available Tools

Core

ToolDescriptionKey Parameters
memoclaw_initCheck configuration and connection status(none)
memoclaw_storeStore a memory with semantic embeddingscontent, importance, tags, namespace, memory_type, pinned
memoclaw_recallSemantic search — find memories by meaningquery, limit, min_similarity, tags, namespace
memoclaw_searchKeyword search — find memories by exact text matchquery, limit, namespace, tags, memory_type
memoclaw_getRetrieve a single memory by IDid
memoclaw_listList stored memories with paginationlimit, offset, tags, namespace, memory_type
memoclaw_updateUpdate a memory by ID (partial update)id, content, importance, tags, memory_type, pinned
memoclaw_deleteDelete a memory by IDid
memoclaw_statusCheck free tier remaining calls(none)
memoclaw_countCount memories with optional filtersnamespace, tags, agent_id, memory_type

Bulk Operations

ToolDescriptionKey Parameters
memoclaw_bulk_storeStore multiple memories in one call (max 100)memories[], session_id, agent_id
memoclaw_bulk_deleteDelete multiple memories by IDs (max 100)ids[]

Intelligence

ToolDescriptionKey Parameters
memoclaw_ingestBulk-ingest conversations/text — auto-extracts facts with dedup & relationsmessages, text, namespace, auto_relate
memoclaw_extractExtract structured facts from conversation via LLM (no auto-relations)messages, namespace
memoclaw_consolidateMerge similar/duplicate memories by clusteringnamespace, min_similarity, mode, dry_run
memoclaw_suggestedGet proactive memory suggestions (stale, fresh, hot, decaying)limit, namespace, category

Relations & Graph

ToolDescriptionKey Parameters
memoclaw_create_relationCreate a relationship between two memoriesmemory_id, target_id, relation_type
memoclaw_list_relationsList all relationships for a memorymemory_id
memoclaw_delete_relationDelete a relationshipmemory_id, relation_id
memoclaw_graphTraverse the memory graph from a starting memorymemory_id, depth (max 3), relation_type

Import & Export

ToolDescriptionKey Parameters
memoclaw_exportExport all memories as JSONnamespace, agent_id, format
memoclaw_importImport memories from a JSON array (max 100)memories[], session_id, agent_id
memoclaw_migrateMigrate markdown files into MemoClawpath, files[], namespace, dry_run

Namespace Management

ToolDescriptionKey Parameters
memoclaw_delete_namespaceDelete ALL memories in a namespace (destructive)namespace, agent_id

Tool Details

memoclaw_init

Check if MemoClaw is properly configured. Call this first to verify the connection, wallet address, and free tier status.
{}

memoclaw_store

Store a new memory with semantic embeddings.
{
  "content": "User prefers dark mode and uses vim keybindings",
  "importance": 0.8,
  "tags": ["preferences", "editor"],
  "namespace": "default"
}

memoclaw_recall

Semantic search — find memories by meaning, not exact words.
{
  "query": "What are the user's editor preferences?",
  "limit": 5,
  "min_similarity": 0.7
}
Keyword search — find memories containing exact text (case-insensitive).
{
  "query": "python",
  "limit": 10,
  "namespace": "project-x"
}

memoclaw_get

Retrieve a single memory by its exact ID.
{
  "id": "550e8400-e29b-41d4-a716-446655440000"
}

memoclaw_list

List all stored memories with pagination.
{
  "limit": 20,
  "offset": 0,
  "tags": ["preferences"],
  "namespace": "default"
}

memoclaw_update

Update an existing memory. Only provided fields are changed.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "importance": 0.9,
  "pinned": true
}

memoclaw_delete

Remove a memory by its ID.
{
  "id": "550e8400-e29b-41d4-a716-446655440000"
}

memoclaw_bulk_store

Store multiple memories in a single call (max 100).
{
  "memories": [
    { "content": "Prefers TypeScript", "importance": 0.7, "tags": ["preferences"] },
    { "content": "Uses VS Code", "importance": 0.5, "tags": ["preferences"] }
  ]
}

memoclaw_bulk_delete

Delete multiple memories at once (max 100 IDs).
{
  "ids": ["id-1", "id-2", "id-3"]
}

memoclaw_count

Get a count of memories with optional filters. Faster than memoclaw_list when you only need the total.
{
  "namespace": "project-x",
  "memory_type": "correction"
}

memoclaw_status

Check your free tier usage.
{}
Response:
Wallet: 0x...
Free tier: 87/100 calls remaining

memoclaw_ingest

Bulk-ingest a conversation or raw text. The server extracts facts, deduplicates, and optionally creates relations.
{
  "messages": [
    { "role": "user", "content": "I switched from JavaScript to TypeScript last month" },
    { "role": "assistant", "content": "Got it! I'll remember your preference for TypeScript." }
  ],
  "auto_relate": true
}

memoclaw_extract

Extract structured facts from a conversation via LLM, without auto-relating them.
{
  "messages": [
    { "role": "user", "content": "My project uses React with Tailwind CSS" }
  ]
}

memoclaw_consolidate

Merge similar/duplicate memories by clustering. Use dry_run: true first to preview.
{
  "namespace": "default",
  "dry_run": true
}

memoclaw_suggested

Get proactive memory suggestions: stale, fresh, hot, or decaying memories.
{
  "category": "stale",
  "limit": 5
}

memoclaw_create_relation

Create a directed relationship between two memories.
{
  "memory_id": "source-id",
  "target_id": "target-id",
  "relation_type": "supersedes"
}
Relation types: related_to, derived_from, contradicts, supersedes, supports.

memoclaw_list_relations

List all relationships for a memory (both incoming and outgoing).
{
  "memory_id": "550e8400-e29b-41d4-a716-446655440000"
}

memoclaw_delete_relation

Delete a specific relationship.
{
  "memory_id": "source-id",
  "relation_id": "relation-id"
}

memoclaw_graph

Traverse the memory graph from a starting point.
{
  "memory_id": "550e8400-e29b-41d4-a716-446655440000",
  "depth": 2
}

memoclaw_export

Export all memories as JSON for backup or analysis.
{
  "namespace": "default",
  "format": "json"
}

memoclaw_import

Import memories from a JSON array (max 100 per call).
{
  "memories": [
    { "content": "Imported fact 1", "importance": 0.6 },
    { "content": "Imported fact 2", "tags": ["imported"] }
  ]
}

memoclaw_migrate

Migrate markdown files into MemoClaw. Use dry_run: true to preview.
{
  "path": "/home/user/.openclaw/workspace/memory/",
  "namespace": "migrated",
  "dry_run": true
}

memoclaw_delete_namespace

Delete ALL memories in a namespace. This is destructive and cannot be undone. Use memoclaw_count first.
{
  "namespace": "old-project"
}

Example Prompts

Once configured, you can ask Claude:
  • “Remember that I prefer TypeScript over JavaScript”
  • “What did I say about my coding preferences?”
  • “List all memories tagged with ‘project’”
  • “Delete the memory about the old API key”

Free Tier

The MCP server includes a free tier of 100 calls per wallet. After exhausting the free tier, calls are paid via x402 protocol (USDC on Base).

Environment Variables

VariableDescription
MEMOCLAW_PRIVATE_KEYEVM private key for authentication and payments
MEMOCLAW_URLAPI URL (defaults to https://api.memoclaw.com)

Troubleshooting

”MEMOCLAW_PRIVATE_KEY environment variable required”

Make sure the environment variable is set in your MCP configuration or shell profile.

”Wallet authentication failed”

Ensure your wallet has USDC on Base for paid calls, or check your free tier status.

Connection issues

Restart your MCP client after changing configuration.

Learn More