
OpenClaw MCP Server
Secure bridge between Claude.ai/Desktop and a self-hosted OpenClaw AI assistant, with OAuth2 and multi-instance routing.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx openclaw-mcpPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"openclaw-mcp-server": {
"command": "npx",
"args": [
"openclaw-mcp"
],
"env": {
"OPENCLAW_URL": "http://127.0.0.1:18789",
"OPENCLAW_GATEWAY_TOKEN": "your-gateway-token",
"OPENCLAW_MODEL": "openclaw",
"OPENCLAW_TIMEOUT_MS": "300000"
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Node.js >= 20
- An OpenClaw gateway running with the HTTP API enabled (gateway.http.endpoints.chatCompletions.enabled = true)
- OPENCLAW_GATEWAY_TOKEN for the OpenClaw gateway
- For remote (Claude.ai) use: AUTH_ENABLED with MCP_CLIENT_ID / MCP_CLIENT_SECRET, MCP_ISSUER_URL and TRUST_PROXY=1 behind a reverse proxy
- Docker (optional, for the GHCR image deployment)
About OpenClaw MCP Server
An MCP bridge server that connects Claude.ai or Claude Desktop to a self-hosted OpenClaw AI assistant gateway. It enables Claude to delegate chat and long-running tasks to one or more OpenClaw instances, with OAuth 2.1 auth for remote use and isolated per-instance configuration for multi-gateway orchestration.
Tools & capabilities (7)
openclaw_chatSend messages to OpenClaw and get responses (synchronous). Accepts an optional instance parameter to target a specific gateway.
openclaw_statusCheck OpenClaw gateway health. Accepts an optional instance parameter.
openclaw_instancesList all configured OpenClaw instances (tokens are never exposed).
openclaw_chat_asyncQueue a message for a long-running operation and get a task_id immediately. Accepts an optional instance parameter.
openclaw_task_statusCheck task progress and get results.
openclaw_task_listList all tasks with filtering.
openclaw_task_cancelCancel a pending task.
When to use it
- Delegating tasks from the Claude.ai web UI to a self-hosted OpenClaw bot that can spin up Claude Code to fix issues
- Orchestrating one AI assistant (Claude) to drive another (OpenClaw)
- Running long async jobs against OpenClaw and polling for results via task tools
- Routing requests across multiple OpenClaw gateways (prod, staging, dev) from a single MCP bridge
- Securely exposing a self-hosted OpenClaw assistant to Claude.ai over OAuth 2.1 + HTTPS
Security notes
Always enable authentication in production: set AUTH_ENABLED=true with MCP_CLIENT_ID and a strong MCP_CLIENT_SECRET (e.g. openssl rand -hex 32). Restrict origins via CORS_ORIGINS (e.g. https://claude.ai). When running behind a reverse proxy you must set MCP_ISSUER_URL to your public HTTPS URL and TRUST_PROXY=1, otherwise OAuth metadata and the /token rate limiter break. The remote connector URL must end with /mcp (the Streamable HTTP endpoint). OAuth 2.1 is used for the remote (Claude.ai) transport; the local stdio transport authenticates to the OpenClaw gateway via OPENCLAW_GATEWAY_TOKEN. Tokens are never exposed via openclaw_instances. The Docker image runs read_only with no-new-privileges.
OpenClaw MCP Server FAQ
Do I need Docker?
No. Docker is the recommended path for remote (Claude.ai) deployments via the GHCR image, but you can also run it locally with `npx openclaw-mcp` for Claude Desktop, or remotely with `npx openclaw-mcp --transport http --port 3000`.
Why does my Claude.ai connector return 404 after OAuth?
The connector URL must end with /mcp, which is the Streamable HTTP endpoint. A bare domain hits the server root and returns 404 after OAuth completes.
What must I set behind a reverse proxy?
Set MCP_ISSUER_URL (or --issuer-url) to your public HTTPS URL so OAuth metadata is correct, and TRUST_PROXY=1 (or --trust-proxy 1) so express-rate-limit accepts the proxy's X-Forwarded-For header instead of crashing /token.
Is SSE still supported?
Yes, but it is deprecated since v1.5.0. The primary transport is now Streamable HTTP (--transport http). --transport sse still works as a deprecated alias and both transports are served simultaneously.
How does multi-instance mode work?
Set OPENCLAW_INSTANCES to a JSON array of named gateways (each with url, token, and optional default). Every tool accepts an optional `instance` parameter; when omitted, the default instance is used. Existing single-instance deployments work unchanged.
Alternatives to OpenClaw MCP Server
Compare all alternatives →Official MCP server providing persistent, file-backed knowledge-graph memory across sessions.
Structured step-by-step reasoning tool for breaking problems into revisable thought sequences.
Fully managed remote server for AWS docs, blogs, What's-New and Well-Architected guidance — no key.
Compare OpenClaw MCP Server with: