OpenClaw MCP Server
v2.0.0MCP server bridging Claude.ai/Desktop with self-hosted OpenClaw via OAuth 2.1.
Values you need
| Variable | What it is | |
|---|---|---|
OPENCLAW_URL | required | URL of your OpenClaw gateway Default: http://127.0.0.1:18789 |
OPENCLAW_GATEWAY_TOKEN | required secret | Bearer token for OpenClaw gateway authentication |
OPENCLAW_MODEL | optional | Model name for chat completions Default: openclaw |
OPENCLAW_TIMEOUT_MS | optional | 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.0Add 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.0Add 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
- 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.
- 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).
- Restart or reload the client so it starts the server.
- 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.
- 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