MCP Setup
MCP (Model Context Protocol) lets Claude use MemLayer as a tool. MemLayer uses stdio transport for local communication.
Prerequisites
Section titled “Prerequisites”- Installation completed
- memlayer server running (
bb local-serverorbb server)
Claude Desktop
Section titled “Claude Desktop”Add MemLayer to your Claude Desktop configuration file:
{ "mcpServers": { "memlayer": { "command": "bb", "args": ["mcp"], "cwd": "/path/to/memlayer" } }}Config file location:
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
After saving, restart Claude Desktop.
Claude Code
Section titled “Claude Code”Add memlayer with a single command:
claude mcp add memlayer -- bb mcpOr create a .mcp.json file in your project root:
{ "mcpServers": { "memlayer": { "command": "bb", "args": ["mcp"], "cwd": "/path/to/memlayer" } }}Reload your Claude Code session to pick up the new configuration.
How it works
Section titled “How it works”The MCP server communicates over stdio (standard input/output). When your MCP client starts memlayer, it launches the bb mcp command which reads JSON-RPC messages from stdin and writes responses to stdout.
Session flow:
- Client launches
bb mcpprocess - Client sends
initializerequest via stdin - Server responds with capabilities and serves
SKILL.md— a set of behavioral instructions that teach the agent when and how to use memory (see Connect Your Agent for details) - Client sends tool calls (
tools/call) as needed - Client terminates the process when done
Verifying the connection
Section titled “Verifying the connection”After configuring Claude, ask:
“Remember that I prefer dark mode in all my editors”
If MemLayer is connected, Claude will call the memlayer_retain tool and confirm the memory was stored.
Troubleshooting:
Test the MCP server directly:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | bb mcpNext steps
Section titled “Next steps”- MCP Tools Reference — all available tools and their parameters
- Quickstart: MCP — guided walkthrough of all four operations