openclaw-mcp

🦞 MCP server for OpenClaw - secure bridge between Claude.ai and your self-hosted OpenClaw assistant with OAuth2 authentication

183
Stars
25
Forks
TypeScript
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/freema/openclaw-mcp

Getting Started

Guides for using skills like openclaw-mcp.

Security Report

Verified

Last scanned: β€”

{
  "status": "PASSED",
  "issues": []
}

README.md

OpenClaw MCP Server

npm version CI License: MIT GHCR Website

🦞 Model Context Protocol (MCP) server for OpenClaw AI assistant integration.

Demo

OpenClaw MCP in Claude.ai

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

Docker (Recommended)

Pre-built images are published to GitHub Container Registry on every release.

docker pull ghcr.io/freema/openclaw-mcp:latest

Create a docker-compose.yml:

services:
  mcp-bridge:
    image: ghcr.io/freema/openclaw-mcp:latest
    container_name: openclaw-mcp
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - OPENCLAW_URL=http://host.docker.internal:18789
      - OPENCLAW_GATEWAY_TOKEN=${OPENCLAW_GATEWAY_TOKEN}
      - OPENCLAW_AGENT_ID=${OPENCLAW_AGENT_ID:-}
      - OPENCLAW_MODEL=openclaw
      - AUTH_ENABLED=true
      - MCP_CLIENT_ID=openclaw
      - MCP_CLIENT_SECRET=${MCP_CLIENT_SECRET}
      - MCP_ISSUER_URL=${MCP_ISSUER_URL:-}
      - MCP_REDIRECT_URIS=https://claude.ai/api/mcp/auth_callback,https://claude.com/api/mcp/auth_callback
      - TRUST_PROXY=1
      - CORS_ORIGINS=https://claude.ai
    extra_hosts:
      - "host.docker.internal:host-gateway"
    read_only: true
    security_opt:
      - no-new-privileges

Generate secrets and start:

export MCP_CLIENT_SECRET=$(openssl rand -hex 32)
export OPENCLAW_GATEWAY_TOKEN=your-gateway-token
docker compose up -d

Then in Claude.ai add a custom MCP connector pointing to https://your-domain.com/mcp with MCP_CLIENT_ID=openclaw and your MCP_CLIENT_SECRET.

Important: The connector URL must end with /mcp β€” that's the Streamable HTTP endpoint. A bare domain (https://your-domain.com) hits the server root and returns 404 after OAuth completes.

Tip: Pin a specific version instead of latest for production: ghcr.io/freema/openclaw-mcp:1.1.0

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",
        "OPENCLAW_AGENT_ID": "main",
        "OPENCLAW_MODEL": "openclaw",
        "OPENCLAW_TIMEOUT_MS": "300000"
      }
    }
  }
}

Remote (Claude.ai) without Docker

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 http --port 3000

Important: When running behind a reverse proxy (Caddy, nginx, Traefik, Cloudflare Tunnel, etc.) you must set:

  • MCP_ISSUER_URL (or --issuer-url) to your public HTTPS URL β€” otherwise OAuth metadata advertises http://localhost:3000 and clients fail to authenticate.
  • TRUST_PROXY=1 (or --trust-proxy 1) β€” otherwise express-rate-limit rejects the proxy's X-Forwarded-For header and /token crashes with ERR_ERL_UNEXPECTED_X_FORWARDED_FOR.

Recommended: Set MCP_REDIRECT_URIS=https://claude.ai/api/mcp/auth_callback,https://claude.com/api/mcp/auth_callback so authorization codes can only be delivered to Claude's callbacks. Note the exact /api/mcp/auth_callback path β€” matching is exact, and getting it wrong fails OAuth with Unregistered redirect_uri (see Troubleshooting).

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

ToolDescription
openclaw_chatSend messages to OpenClaw and get responses
openclaw_statusCheck OpenClaw gateway health
openclaw_instancesList all configured OpenClaw instances

Async Tools (for long-running operations)

ToolDescription
openclaw_chat_asyncQueue a message, get task_id immediately
openclaw_task_statusCheck task progress and get results
openclaw_task_listList your tasks with filtering
openclaw_task_cancelCancel a pending task

Tasks are scoped to the MCP connection that created them. In HTTP mode, where one process serves many clients, a client can only see and cancel its own tasks β€” another client's task_id reads as "not found" even if it is known. Reconnecting starts a fresh scope, so poll a task on the connection that queued it.

Multi-Instance Mode

Orchestrate multiple OpenClaw gateways from a single MCP server. One bridge, many claws β€” route requests to prod, staging, dev, or whatever you name them (lobster-supreme and the-claw-abides are perfectly valid names).

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Claude.ai / Claude Desktop                    β”‚
β”‚                              (MCP Client)                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     OpenClaw MCP Bridge Server                        β”‚
β”‚                                                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚  Instance     β”‚  β”‚  Instance     β”‚  β”‚  Instance     β”‚              β”‚
β”‚  β”‚  Registry     β”‚  β”‚  Resolver     β”‚  β”‚  Validator    β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚         β”‚                 β”‚                  β”‚                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚              Per-Instance OpenClaw Clients          β”‚              β”‚
β”‚  β”‚     (separate auth, timeout, URL per instance)     β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚              β”‚              β”‚
            β–Ό              β–Ό              β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  🦞 prod     β”‚ β”‚  🦞 staging  β”‚ β”‚  🦞 dev      β”‚
   β”‚  (default)   β”‚ β”‚              β”‚ β”‚              β”‚
   β”‚  :18789      β”‚ β”‚  :18789      β”‚ β”‚  :18789      β”‚
   β”‚  OpenClaw GW β”‚ β”‚  OpenClaw GW β”‚ β”‚  OpenClaw GW β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Setup

OPENCLAW_INSTANCES='[
  {"name": "prod", "url": "http://prod:18789", "token": "tok1", "default": true},
  {"name": "staging", "url": "http://staging:18789", "token": "tok2"},
  {"name": "dev", "url": "http://dev:18789", "token": "tok3"}
]'

Usage

All tools accept an optional instance parameter to target a specific gateway:

# Chat with staging instance
openclaw_chat message="Deploy status?" instance="staging"

# Check health of prod
openclaw_status instance="prod"

# List all configured instances
openclaw_instances

# Async task targeting dev
openclaw_chat_async message="Run tests" instance="dev"

When instance is omitted, the default instance is used. Each instance has its own auth token, timeout, and URL β€” fully isolated.

Key Features

  • Zero-migration upgrade β€” existing single-instance deployments work without any config change
  • Per-instance isolation β€” separate auth tokens, timeouts, and URLs
  • Dynamic routing β€” Claude picks the right instance per request
  • Task tracking β€” async tasks remember which instance they target
  • Security β€” tokens are never exposed via openclaw_instances

See Configuration β€” Multi-Instance Mode for the full reference.

Documentation

  • Installation β€” Setup for Claude Desktop & Claude.ai
  • Configuration β€” Environment variables & options
  • Deployment β€” Docker & production setup
  • Threat Model β€” What Claude can/can't trigger, trust boundaries & attack surfaces
  • Logging β€” What gets logged, where, and what is never logged
  • 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 http

CORS is disabled unless you opt in. Set CORS_ORIGINS only when a browser client needs to reach the server directly:

CORS_ORIGINS=https://claude.ai,https://your-app.com

See Configuration for all security options.

Upgrading to 1.7.0

Two defaults changed for security. Both only affect HTTP mode; stdio is unchanged.

  • CORS is now off by default. Previously an unset CORS_ORIGINS sent Access-Control-Allow-Origin: *. If a browser client depends on that, set the origins explicitly (CORS_ORIGINS=https://your-app.com), or CORS_ORIGINS=* to restore the old behaviour.
  • Async tasks are scoped to the connection that created them. A client that used to poll a task_id queued by a different connection will now get "not found".

Migrating from SSE to HTTP transport

Starting with v1.5.0, the primary transport is Streamable HTTP (--transport http). The legacy SSE transport (--transport sse) is deprecated but still works for backward compatibility.

What changed

BeforeAfter
--transport sse--transport http (recommended)
Primary endpoint: GET /ssePrimary endpoint: POST/GET/DELETE /mcp
Health: "transport": "sse"Health: "transport": "streamable-http"

Migration steps

  1. CLI / Docker: Replace --transport sse with --transport http

    # Before
    openclaw-mcp --transport sse --port 3000
    # After
    openclaw-mcp --transport http --port 3000
    
  2. Claude.ai connector URL: No change needed β€” Claude.ai already uses /mcp (Streamable HTTP)

  3. Legacy clients: The /sse and /messages endpoints still work. A deprecation warning is logged on each SSE connection.

  4. Dockerfile ENTRYPOINT: Updated automatically if using the official Docker image

Note: --transport sse will continue to work as a deprecated alias. Both transports are served simultaneously regardless of which flag you use.

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

Frequently Asked Questions

What is openclaw-mcp?βŒ„

openclaw-mcp is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by freema. 🦞 MCP server for OpenClaw - secure bridge between Claude.ai and your self-hosted OpenClaw assistant with OAuth2 authentication. It has 183 GitHub stars.

Is openclaw-mcp safe to use?βŒ„

openclaw-mcp returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.

How do I install openclaw-mcp?βŒ„

Clone the repository with "git clone https://github.com/freema/openclaw-mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is openclaw-mcp written in?βŒ„

openclaw-mcp is primarily written in TypeScript. It is open-source under freema on GitHub, so you can review or fork the full source.

Are there alternatives to openclaw-mcp?βŒ„

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh openclaw-mcp against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

⭐ 242,219β‘‚ 36,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details β†’
15

An agentic skills framework & software development methodology that works.

⭐ 234,966β‘‚ 20,863Shell
AI Agentsai-agentsbrainstorming
View details β†’

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

⭐ 185,940β‘‚ 28,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details β†’

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

⭐ 128,868β‘‚ 8,826Rust
AI Agentsclaude-codeai-tools
View details β†’

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

⭐ 120,031β‘‚ 19,897Shell
AI Agents
View details β†’

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

⭐ 242,219β‘‚ 36,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details β†’
15

An agentic skills framework & software development methodology that works.

⭐ 234,966β‘‚ 20,863Shell
AI Agentsai-agentsbrainstorming
View details β†’

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

⭐ 201,881β‘‚ 60,308TypeScript
MCP Serversapisai-tools
View details β†’

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

⭐ 185,940β‘‚ 28,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details β†’

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

⭐ 128,868β‘‚ 8,826Rust
AI Agentsclaude-codeai-tools
View details β†’