OpenClaw Integration
OpenClaw is an open-source personal AI assistant that you run on your own devices and talk to through the messaging apps you already use. You can configure it to route its Claude API calls through the LeanMCP AI Gateway for monitoring, cost tracking, and content filtering.About OpenClaw
OpenClaw is an open-source personal AI assistant created by Austrian developer Peter Steinberger as a playground project in late 2025 , originally released under the name Clawdbot and briefly renamed Moltbot before settling on OpenClaw in late January 2026 after trademark concerns from Anthropic’s legal team over the original “Clawd” pun on “Claude” . Rather than living in a browser tab, OpenClaw runs locally on your machine and answers you on channels you already use like WhatsApp, Telegram, Slack, Discord, Google Chat, Signal, iMessage, Microsoft Teams, Matrix, LINE, and many more , with persistent memory stored in local Markdown files, a skills system, scheduled wakeups, and integrations for browser control, voice, and canvas rendering. The project went viral almost immediately: it drew 2 million visitors in a single week shortly after launch, reached around 247,000 stars and 47,700 forks on GitHub by early March 2026 , and surpassed 250,000 stars on March 3, 2026, overtaking React to become one of the fastest-growing projects in GitHub history . In February 2026, Steinberger announced he was joining OpenAI and that OpenClaw would move to a foundation to stay open and independent , and the project continues to ship weekly releases driven by its community.Monitoring OpenClaw with LeanMCP
Because OpenClaw makes its Claude calls through a standard Anthropic-compatible client, you can point it at the LeanMCP AI Gateway instead of the Anthropic API directly. Every request then flows through LeanMCP, where it gets logged, scanned for sensitive data, attributed to a user, and counted against your spending limits — without changing anything about how you talk to your assistant from Discord, Telegram, or WhatsApp.Prerequisites
Enable Billing
Before anything else, sign in at app.leanmcp.com and enable billing on your account. Until billing is enabled, gateway requests will be rejected even if you have an API key. Add a payment method and top up credits from the Billing section of the dashboard.
Create an API Key
Create an API key at app.leanmcp.com/api-keys with SDK permissions. Your key will start with
leanmcp_.Configuration
Environment Variables
Point OpenClaw at the LeanMCP AI Gateway by setting the Anthropic environment variables on the host running the OpenClaw gateway:~/.openclaw/.env (or your shell profile) and restart the gateway:
Configuration File
If you prefer to configure OpenClaw via its config file rather than environment variables:How It Works
Benefits for OpenClaw Users
User Monitoring
Track which messaging users are talking to your assistant and how much
Cost Control
Set spending limits to prevent runaway costs from heavy usage or loops
Content Filtering
Block sensitive prompts before they reach Claude
Usage Analytics
Understand how OpenClaw is being used across all your channels
Adding Per-User Tracking
OpenClaw runs across many channels. To attribute usage to the right person and channel, attach identifying headers when OpenClaw calls the Anthropic SDK:Verifying the Setup
- Restart your OpenClaw gateway after changing environment variables.
- Send a message to your assistant on any connected channel (Discord, Telegram, WhatsApp, etc.).
- Open the LeanMCP Dashboard and confirm the request appears in the logs.
Setting Up Rate Limits
Protect your assistant from runaway loops or abusive users:Troubleshooting
Assistant not responding
Assistant not responding
- Check that the OpenClaw gateway daemon is running (
openclaw status) - Verify your LeanMCP API key is valid and billing is enabled
- Tail the gateway logs for errors
API errors
API errors
- Ensure the base URL ends with
/v1/anthropic(no trailing slash) - Verify your API key starts with
leanmcp_ - Confirm billing is enabled and you have remaining credits at app.leanmcp.com
Requests not showing in dashboard
Requests not showing in dashboard
- Confirm OpenClaw is actually using the custom base URL (check the env vars inside the running process)
- Restart the gateway after configuration changes
- Make sure you’re looking at the same workspace in the dashboard that owns the API key
Resources
Next Steps
Set Up Alerts
Get notified of unusual usage
Optimize Costs
Reduce token usage

