openclaw-mcp
v1.0.2
Published
Model Context Protocol (MCP) server for OpenClaw AI assistant integration
Maintainers
Readme
OpenClaw MCP Server
🦞 Model Context Protocol (MCP) server for OpenClaw AI assistant integration.
Demo
Why I Built This
Hey! I created this MCP server because I didn't want to rely solely on messaging channels to communicate with OpenClaw. What really excites me is the ability to connect OpenClaw to the Claude web UI. Essentially, my chat can delegate tasks to my Claw bot, which then handles everything else — like spinning up Claude Code to fix issues for me.
Think of it as an AI assistant orchestrating another AI assistant. Pretty cool, right?
Quick Start
Local (Claude Desktop)
npx openclaw-mcpAdd to your Claude Desktop config:
{
"mcpServers": {
"openclaw": {
"command": "npx",
"args": ["openclaw-mcp"],
"env": {
"OPENCLAW_URL": "http://127.0.0.1:18789",
"OPENCLAW_GATEWAY_TOKEN": "your-gateway-token"
}
}
}
}Remote (Claude.ai)
AUTH_ENABLED=true MCP_CLIENT_ID=openclaw MCP_CLIENT_SECRET=your-secret \
MCP_ISSUER_URL=https://mcp.your-domain.com \
CORS_ORIGINS=https://claude.ai OPENCLAW_GATEWAY_TOKEN=your-gateway-token \
npx openclaw-mcp --transport sse --port 3000Important: When running behind a reverse proxy (Caddy, nginx, etc.), you must set
MCP_ISSUER_URL(or--issuer-url) to your public HTTPS URL. Without this, OAuth metadata will advertisehttp://localhost:3000and clients will fail to authenticate.
Then in Claude.ai add a custom connector with your MCP_CLIENT_ID and MCP_CLIENT_SECRET.
See Installation Guide for details.
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Your Server │
│ │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ OpenClaw │ │ OpenClaw MCP │ │
│ │ Gateway │◄────►│ Bridge Server │ │
│ │ :18789 │ │ :3000 │ │
│ │ │ │ │ │
│ │ OpenAI-compat │ │ - OAuth 2.1 auth │ │
│ │ /v1/chat/... │ │ - CORS protection │ │
│ └─────────────────┘ │ - Input validation │ │
│ └──────────┬──────────────┘ │
│ │ │
└──────────────────────────────────────┼──────────────────────────┘
│ HTTPS + OAuth 2.1
▼
┌─────────────────┐
│ Claude.ai │
│ (MCP Client) │
└─────────────────┘Available Tools
Sync Tools
| Tool | Description |
|------|-------------|
| openclaw_chat | Send messages to OpenClaw and get responses |
| openclaw_status | Check OpenClaw gateway health |
Async Tools (for long-running operations)
| Tool | Description |
|------|-------------|
| openclaw_chat_async | Queue a message, get task_id immediately |
| openclaw_task_status | Check task progress and get results |
| openclaw_task_list | List all tasks with filtering |
| openclaw_task_cancel | Cancel a pending task |
Documentation
- Installation — Setup for Claude Desktop & Claude.ai
- Configuration — Environment variables & options
- Deployment — Docker & production setup
- Development — Contributing & adding tools
- Security — Security policy & best practices
Security
⚠️ Always enable authentication in production!
# Generate secure client secret
export MCP_CLIENT_SECRET=$(openssl rand -hex 32)
# Run with auth enabled
AUTH_ENABLED=true MCP_CLIENT_ID=openclaw MCP_CLIENT_SECRET=$MCP_CLIENT_SECRET \
openclaw-mcp --transport sseConfigure CORS to restrict access:
CORS_ORIGINS=https://claude.ai,https://your-app.comSee Configuration for all security options.
Requirements
- Node.js ≥ 20
- OpenClaw gateway running with HTTP API enabled:
// openclaw.json { "gateway": { "http": { "endpoints": { "chatCompletions": { "enabled": true } } } } }
License
MIT
Author
Created by Tomáš Grasl
Related Projects
- OpenClaw — The AI assistant this MCP connects to
- MCP Specification — Model Context Protocol docs
