Get Started
Integrating the Pieces MCP with OpenClaw brings your workflow context directly into this open-source continuous AI agent runtime. OpenClaw (formerly ClawdBot, formerly Moltbot) runs as a persistent Node.js service—unlike chatbots that respond to one-off prompts, it runs 24/7, executing tasks proactively via cron jobs and event listeners.
With Pieces MCP connected, OpenClaw gains access to your Long-Term Memory. It can autonomously query your past work, generate standups, monitor recent activity, and surface relevant context without you asking.
Prerequisites
Installing PiecesOS & Configuring Permissions
Follow the instructions below for a detailed guide on setting up and configuring PiecesOS to correctly pass captured workflow context to the Pieces MCP server.
Setting Up OpenClaw
OpenClaw executes MCP tools via MCPorter, its built-in MCP management layer. Edit ~/.openclaw/workspace/config/mcporter.json:
Install mcp-remote globally with a pinned version for security:
npm install -g mcp-remote@0.1.38
See MCP Bridge for why we recommend a locally installed binary over npx.
Local Setup (SSE with mcp-remote — recommended)
When OpenClaw and PiecesOS run on the same machine, use the localhost URL with the mcp-remote bridge:
{
"mcpServers": {
"pieces": {
"command": "mcp-remote",
"args": [
"http://localhost:39300/model_context_protocol/2024-11-05/sse"
]
}
}
}
Remote Setup (ngrok)
When OpenClaw needs to reach PiecesOS on a different machine:
{
"mcpServers": {
"pieces": {
"command": "mcp-remote",
"args": [
"https://YOUR_NGROK_URL.ngrok-free.app/model_context_protocol/2024-11-05/sse"
]
}
}
}
See Tunneling for tunnel setup.
Example Use Cases
Once Pieces MCP is connected to OpenClaw, you can automate workflows like:
Autonomous daily standup: Schedule OpenClaw to run every morning, query yesterday's workstream summaries, and post a formatted standup to your Slack or Teams channel.
Meeting prep: Before a calendar event, OpenClaw searches audio transcriptions and workstream summaries for context related to the meeting topic and drafts a brief for you.
Automated debugging log: When OpenClaw detects a production alert, it queries recent workstream events for error-related content and creates a pieces_memory entry with the incident context.
Verification
- Start OpenClaw.
- Ask via your connected messaging platform: "What Pieces tools do you have?"
- Pieces LTM tools should be listed.
- Try: "What did I work on yesterday?"—OpenClaw will call
ask_pieces_ltm.
Security Note
OpenClaw can run with permissionMode: 'bypassPermissions' to execute tools autonomously. When combined with Pieces MCP write tools (like create_pieces_memory), this is powerful but should be used carefully. Consider:
- Running OpenClaw in Docker with limited filesystem access
- Disabling write tools in MCPorter if running fully autonomously
- Monitoring execution logs
Updating
Edit ~/.openclaw/workspace/config/mcporter.json, update the URL, and restart OpenClaw.
Troubleshooting
If you're experiencing issues integrating Pieces MCP with OpenClaw:
Verify PiecesOS Status: Ensure PiecesOS is actively running on your system.
MCPorter Config Not Found: Create
~/.openclaw/workspace/config/directory manually.Bridge Process Not Starting: Run
npm install -g mcp-remote@0.1.38and ensure the global npm bin directory is in your PATH.Tools Not Available: Restart OpenClaw after editing MCPorter config.
ngrok URL Expired: Restart the ngrok tunnel and update the URL in MCPorter config. See ngrok Setup for details.
You're now set to enhance your OpenClaw workflow with powerful context retrieval through Pieces MCP. Happy coding!