🤖 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
| Tool | What it does |
|---|---|
memory_remember | Store content (+tags, metadata); buffers locally, flushes in batches |
memory_flush | Force all pending memories onto the network as one batch blob |
memory_recall | Semantic + keyword search, optional tag filter |
memory_list | Newest-first listing |
memory_get | Full record by id or CID |
memory_forget | Remove from index; deletes the blob once no other memory shares it |
memory_rebuild_index | Restore the index from the network on a new machine |
memory_status | Counts (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.
Encourage durable habits in your agent's system prompt, e.g. "Before ending a session, call memory_flush if any memories are pending."