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.
Prerequisites
Section titled “Prerequisites”- 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
Verify the bridge is available
Section titled “Verify the bridge is available”wp mcp-adapter list --path=/path/to/wordpressShould 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.
Test the stdio server manually
Section titled “Test the stdio server manually”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/wordpressYou should get an initialize response printed to stdout. If you don’t, check:
- The
--userexists in WordPress and hasedit_posts - The
--pathis the absolute WordPress root path (the directory containingwp-config.php)
Use with an MCP client
Section titled “Use with an MCP client”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.
Use with MCP Inspector
Section titled “Use with MCP Inspector”For interactive testing without any AI client:
npx @modelcontextprotocol/inspector \ wp mcp-adapter serve --server=emcp-tools-server --user=admin --path=/path/to/wordpressInspector 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.
Windows / Laragon notes
Section titled “Windows / Laragon notes”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.)