Bridges Claude.ai to a self-hosted OpenClaw assistant with OAuth2, delegating tasks to OpenClaw agents via sync and async tools.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add openclaw --env OPENCLAW_URL='<OPENCLAW_URL>' --env OPENCLAW_GATEWAY_TOKEN='<OPENCLAW_GATEWAY_TOKEN>' --env OPENCLAW_GATEWAY_URL='<OPENCLAW_GATEWAY_URL>' -- npx -y openclaw-mcp~/.codex/config.toml
[mcp_servers.openclaw]
command = "npx"
args = ["-y", "openclaw-mcp"]
env = { OPENCLAW_URL = "<OPENCLAW_URL>", OPENCLAW_GATEWAY_TOKEN = "<OPENCLAW_GATEWAY_TOKEN>", OPENCLAW_GATEWAY_URL = "<OPENCLAW_GATEWAY_URL>" }
# codex mcp add openclaw --env OPENCLAW_URL='<OPENCLAW_URL>' --env OPENCLAW_GATEWAY_TOKEN='<OPENCLAW_GATEWAY_TOKEN>' --env OPENCLAW_GATEWAY_URL='<OPENCLAW_GATEWAY_URL>' -- npx -y openclaw-mcp~/.cursor/mcp.json
{
"mcpServers": {
"openclaw": {
"command": "npx",
"args": [
"-y",
"openclaw-mcp"
],
"env": {
"OPENCLAW_URL": "<OPENCLAW_URL>",
"OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
"OPENCLAW_GATEWAY_URL": "<OPENCLAW_GATEWAY_URL>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"openclaw": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"openclaw-mcp"
],
"env": {
"OPENCLAW_URL": "<OPENCLAW_URL>",
"OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
"OPENCLAW_GATEWAY_URL": "<OPENCLAW_GATEWAY_URL>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"openclaw": {
"command": "npx",
"args": [
"-y",
"openclaw-mcp"
],
"env": {
"OPENCLAW_URL": "<OPENCLAW_URL>",
"OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
"OPENCLAW_GATEWAY_URL": "<OPENCLAW_GATEWAY_URL>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"openclaw": {
"command": "npx",
"args": [
"-y",
"openclaw-mcp"
],
"env": {
"OPENCLAW_URL": "<OPENCLAW_URL>",
"OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
"OPENCLAW_GATEWAY_URL": "<OPENCLAW_GATEWAY_URL>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"openclaw": {
"command": "npx",
"args": [
"-y",
"openclaw-mcp"
],
"env": {
"OPENCLAW_URL": "<OPENCLAW_URL>",
"OPENCLAW_GATEWAY_TOKEN": "<OPENCLAW_GATEWAY_TOKEN>",
"OPENCLAW_GATEWAY_URL": "<OPENCLAW_GATEWAY_URL>"
}
}
}
}Environment variables
OPENCLAW_URLOPENCLAW_GATEWAY_TOKENOPENCLAW_GATEWAY_URL
Replace the placeholders with your own credentials and keep them out of version control.