OpenClaw MCP Server

v2.0.0
io.github.freema/openclaw-mcp Checked 1 hour ago Published 7 days ago

MCP server bridging Claude.ai/Desktop with self-hosted OpenClaw via OAuth 2.1.

Values you need

VariableWhat it is
OPENCLAW_URLrequired URL of your OpenClaw gateway Default: http://127.0.0.1:18789
OPENCLAW_GATEWAY_TOKENrequired secret Bearer token for OpenClaw gateway authentication
OPENCLAW_MODELoptional Model name for chat completions Default: openclaw
OPENCLAW_TIMEOUT_MSoptional Gateway request timeout in milliseconds (idle timeout for streamed async tasks) Default: 120000

npm (npx) verified

Requires Node.js 18+

Run in a terminal
claude mcp add openclaw-mcp -e 'OPENCLAW_GATEWAY_TOKEN=<OPENCLAW_GATEWAY_TOKEN>' -e OPENCLAW_URL=http://127.0.0.1:18789 -- npx -y openclaw-mcp@2.0.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "openclaw-mcp": {
      "args": [
        "-y",
        "openclaw-mcp@2.0.0"
      ],
      "command": "npx",
      "env": {
        "OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
        "OPENCLAW_URL": "http://127.0.0.1:18789"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "openclaw-mcp": {
      "args": [
        "-y",
        "openclaw-mcp@2.0.0"
      ],
      "command": "npx",
      "env": {
        "OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
        "OPENCLAW_URL": "http://127.0.0.1:18789"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "OPENCLAW_GATEWAY_TOKEN",
      "id": "openclaw-gateway-token",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "OPENCLAW_URL",
      "id": "openclaw-url",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "openclaw-mcp": {
      "args": [
        "-y",
        "openclaw-mcp@2.0.0"
      ],
      "command": "npx",
      "env": {
        "OPENCLAW_GATEWAY_TOKEN": "${input:openclaw-gateway-token}",
        "OPENCLAW_URL": "${input:openclaw-url}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.openclaw-mcp]
command = "npx"
args = ["-y", "openclaw-mcp@2.0.0"]
env = { "OPENCLAW_GATEWAY_TOKEN" = "<OPENCLAW_GATEWAY_TOKEN>", "OPENCLAW_URL" = "http://127.0.0.1:18789" }

Docker

Requires Docker

Run in a terminal
claude mcp add openclaw-mcp -e 'OPENCLAW_GATEWAY_TOKEN=<OPENCLAW_GATEWAY_TOKEN>' -e OPENCLAW_URL=http://127.0.0.1:18789 -- docker run -i --rm -e OPENCLAW_GATEWAY_TOKEN -e OPENCLAW_URL ghcr.io/freema/openclaw-mcp:2.0.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "openclaw-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "OPENCLAW_GATEWAY_TOKEN",
        "-e",
        "OPENCLAW_URL",
        "ghcr.io/freema/openclaw-mcp:2.0.0"
      ],
      "command": "docker",
      "env": {
        "OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
        "OPENCLAW_URL": "http://127.0.0.1:18789"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "openclaw-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "OPENCLAW_GATEWAY_TOKEN",
        "-e",
        "OPENCLAW_URL",
        "ghcr.io/freema/openclaw-mcp:2.0.0"
      ],
      "command": "docker",
      "env": {
        "OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
        "OPENCLAW_URL": "http://127.0.0.1:18789"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "OPENCLAW_GATEWAY_TOKEN",
      "id": "openclaw-gateway-token",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "OPENCLAW_URL",
      "id": "openclaw-url",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "openclaw-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "OPENCLAW_GATEWAY_TOKEN",
        "-e",
        "OPENCLAW_URL",
        "ghcr.io/freema/openclaw-mcp:2.0.0"
      ],
      "command": "docker",
      "env": {
        "OPENCLAW_GATEWAY_TOKEN": "${input:openclaw-gateway-token}",
        "OPENCLAW_URL": "${input:openclaw-url}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.openclaw-mcp]
command = "docker"
args = ["run", "-i", "--rm", "-e", "OPENCLAW_GATEWAY_TOKEN", "-e", "OPENCLAW_URL", "ghcr.io/freema/openclaw-mcp:2.0.0"]
env = { "OPENCLAW_GATEWAY_TOKEN" = "<OPENCLAW_GATEWAY_TOKEN>", "OPENCLAW_URL" = "http://127.0.0.1:18789" }

For AI agents

  1. Ask the user for: OPENCLAW_URL, OPENCLAW_GATEWAY_TOKEN. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: openclaw_chat, openclaw_status, openclaw_instances, openclaw_chat_async, openclaw_task_status, openclaw_task_list, openclaw_task_cancel.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json