openclaw-mcp
π¦ MCP server for OpenClaw - secure bridge between Claude.ai and your self-hosted OpenClaw assistant with OAuth2 authentication
README
OpenClaw MCP Server
<a href="https://glama.ai/mcp/servers/@freema/openclaw-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@freema/openclaw-mcp/badge" /> </a>
π¦ Model Context Protocol (MCP) server for OpenClaw AI assistant integration.
Demo
<p align="center"> <img src="docs/assets/claude-ai-demo.gif" alt="OpenClaw MCP in Claude.ai" width="720" /> </p>
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-mcp
Add 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 3000
Important: 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 sse
Configure CORS to restrict access:
CORS_ORIGINS=https://claude.ai,https://your-app.com
See 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.