Skip to content

WP-CLI bridge

The WordPress MCP Adapter plugin ships a wp mcp-adapter serve command that exposes any registered MCP server as a stdio process. This is the lowest-latency way to talk to EMCP Tools: no HTTP, no sessions, no auth config.

  • WP-CLI installed and on PATH (or path-referenced explicitly)
  • The WordPress MCP Adapter plugin active on your WordPress install
  • The plugin install accessible from the machine running WP-CLI
Terminal window
wp mcp-adapter list --path=/path/to/wordpress

Should print:

+-----------------------+----------+
| server_id | tool_count |
+-----------------------+----------+
| emcp-tools-server | 113 |
+-----------------------+----------+

(Tool count varies, see Requirements.)

If you get wp: command not found, install WP-CLI: https://wp-cli.org/

If you get Command 'mcp-adapter' not found, the WordPress MCP Adapter plugin isn’t active.

Terminal window
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | \
wp mcp-adapter serve --server=emcp-tools-server --user=admin --path=/path/to/wordpress

You should get an initialize response printed to stdout. If you don’t, check:

  • The --user exists in WordPress and has edit_posts
  • The --path is the absolute WordPress root path (the directory containing wp-config.php)

See the matching guide for each client:

Cursor and the VS Code MCP extension default to HTTP. Use HTTP for those even on local dev, unless you have a specific reason to wire stdio.

For interactive testing without any AI client:

Terminal window
npx @modelcontextprotocol/inspector \
wp mcp-adapter serve --server=emcp-tools-server --user=admin --path=/path/to/wordpress

Inspector opens in a browser, lists every tool, and lets you call them with JSON arguments. Best way to learn what each tool returns and which arguments it accepts.

WP-CLI on Windows usually needs explicit paths to php.exe and wp-cli.phar. Replace wp in the commands above with:

"C:\laragon\bin\php\php-8.4.15-nts-Win32-vs17-x64\php.exe" "C:\wp-cli\wp-cli.phar"

(Adjust paths to your install.)