Skip to main content

🤖 Connect Agents via MCP

The bundled Model Context Protocol server lets any MCP-capable agent — Claude Code, Claude Desktop, or custom SDK agents — store and recall memory autonomously.

Claude Code

claude mcp add lighthouse-memory \
--env LIGHTHOUSE_API_KEY=YOUR_API_KEY \
-- npx -y @lighthouse-web3/memory

Add --scope user to make it available in every project. Pass additional env vars (MEMORY_NETWORK, MEMORY_NAMESPACE, …) with more --env flags.

Claude Desktop / other MCP clients

Add to the client's MCP configuration:

{
"mcpServers": {
"lighthouse-memory": {
"command": "npx",
"args": ["-y", "@lighthouse-web3/memory"],
"env": { "LIGHTHOUSE_API_KEY": "YOUR_API_KEY" }
}
}
}

npx -y @lighthouse-web3/memory runs the package's bundled MCP server (lighthouse-memory-mcp) over stdio.

Available tools

ToolWhat it does
memory_rememberStore content (+tags, metadata); buffers locally, flushes in batches
memory_flushForce all pending memories onto the network as one batch blob
memory_recallSemantic + keyword search, optional tag filter
memory_listNewest-first listing
memory_getFull record by id or CID
memory_forgetRemove from index; deletes the blob once no other memory shares it
memory_rebuild_indexRestore the index from the network on a new machine
memory_statusCounts (incl. pending), network, embeddings mode, snapshot CID

What it looks like in practice

Once connected, the agent uses memory naturally:

You: remember that our staging environment is at staging.acme.dev and redeploys on every merge to develop

Agent: (calls memory_remember) Saved.

days later, new session

You: where do I check the latest staging build?

Agent: (calls memory_recall) Your staging environment is at staging.acme.dev — it redeploys on every merge to develop.

tip

Encourage durable habits in your agent's system prompt, e.g. "Before ending a session, call memory_flush if any memories are pending."