Skip to content

OpenClaw

OpenClaw reads MCP servers from ~/.openclaw/openclaw.json, under mcp.servers. That file usually already has other settings, so add the mcp block below rather than replacing the whole file.

The EMCP Tools → Connection screen generates every block on this page for your exact site in four steps:

  1. Choose your AI client: pick OpenClaw.
  2. Pick how it signs in: OAuth (recommended) or Application password.
  3. Add EMCP to OpenClaw: copy what it shows. For OAuth, that is the mcp block and the openclaw mcp login command. For an application password, click Create password first (it is shown once and the blocks already contain it), or open Use a password I already have; you then get the openclaw mcp set terminal command, a direct HTTP block and a Node proxy (npx) block. Click I’ve added it, continue.
  4. Test the connection: the screen waits for OpenClaw’s first MCP call and shows “OpenClaw is connected”.

The generated blocks name the server after your site (for example emcp-your-site-com); the examples below use emcp-tools.

Add the server with auth: oauth, then run one login command:

"mcp": {
"servers": {
"emcp-tools": {
"url": "https://your-site.test/wp-json/mcp/emcp-tools-server",
"transport": "streamable-http",
"auth": "oauth"
}
}
}
Terminal window
openclaw mcp login emcp-tools

OpenClaw prints a sign-in URL. Open it, approve access from your WordPress login, then follow OpenClaw’s instruction to finish (recent builds ask you to paste the code back with openclaw mcp login emcp-tools --code <code>).

Paste only the code, the part between code= and & in the callback URL, not the whole query string. On PowerShell an unescaped & throws a parser error.

Requires an HTTPS site with OAuth sign-in on (EMCP Tools → Connection → Advanced settings, on by default on HTTPS). Only administrators can approve. Authorization codes last 5 minutes, so complete the login in one pass and do not re-run openclaw mcp login before exchanging the code (that regenerates the security check and invalidates the first code).

"mcp": {
"servers": {
"emcp-tools": {
"url": "https://your-site.test/wp-json/mcp/emcp-tools-server",
"transport": "streamable-http",
"headers": {
"Authorization": "Basic BASE64_ENCODED_CREDENTIALS"
}
}
}
}

Or set it from the terminal:

Terminal window
openclaw mcp set emcp-tools '{"url":"https://your-site.test/wp-json/mcp/emcp-tools-server","transport":"streamable-http","headers":{"Authorization":"Basic BASE64_ENCODED_CREDENTIALS"}}'

Generate the base64 credentials:

Terminal window
echo -n "admin:xxxx xxxx xxxx xxxx xxxx xxxx" | base64

You can also create an application password yourself under WordPress admin → Users → Profile → Application Passwords.

If the direct HTTP transport times out during the handshake, run the bundled proxy over stdio instead. It handles the session and protocol negotiation and is the most dependable path:

"mcp": {
"servers": {
"emcp-tools": {
"command": "npx",
"args": ["-y", "@msrbuilds/emcp-proxy@latest"],
"env": {
"WP_URL": "https://your-site.test",
"WP_USERNAME": "admin",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
"MCP_PROTOCOL_VERSION": "2024-11-05"
}
}
}
}

Note WP_URL is the bare site (no /wp-json/..., the proxy adds the route), and the app password goes in plain.

Two things trip up OpenClaw on Windows specifically:

  • spawn npx ENOENT. OpenClaw launches the command without a shell, and Windows cannot resolve bare npx that way (the real file is npx.cmd). Wrap it in cmd:

    "command": "cmd",
    "args": ["/c", "npx", "-y", "@msrbuilds/emcp-proxy@latest"]
  • Slow start / Request timed out. npx -y @latest re-checks the npm registry on every launch, which can add five to seven seconds and blow past OpenClaw’s probe timeout. Install the proxy once and point straight at it:

    Terminal window
    npm install -g @msrbuilds/emcp-proxy
    "command": "cmd",
    "args": ["/c", "%APPDATA%\\npm\\emcp-proxy.cmd"]
Terminal window
openclaw mcp probe emcp-tools

If probe reports a timeout but the server is otherwise healthy, that is usually the probe’s short timeout against a remote round-trip, not a real failure, the server still works in a normal session. Step 4 of the Connection wizard is a second check: it confirms the first real call from OpenClaw. A clean HTTP 401 means the application password or username is wrong; a text/html response means the URL is missing the /wp-json/mcp/emcp-tools-server path and is hitting the site homepage.

If the server is unreachable, returns no tools, or lists fewer tools than expected, follow missing-tool diagnosis. Check the failing stage before changing the enabled catalog.