REST API (Direct)
All MCPWP functionality is also available as a standard REST API. Use this for custom integrations, automation scripts, or when you don’t need an MCP client.
Authentication
Section titled “Authentication”Pass your API key in the X-API-Key header:
curl https://YOUR-SITE.com/wp-json/mcpwp/v1/site-info \ -H "X-API-Key: mcpwp_YOUR_KEY"Or as a Bearer token:
curl https://YOUR-SITE.com/wp-json/mcpwp/v1/site-info \ -H "Authorization: Bearer mcpwp_YOUR_KEY"Base URL
Section titled “Base URL”https://YOUR-SITE.com/wp-json/mcpwp/v1/Quick examples
Section titled “Quick examples”# Site infocurl -s https://YOUR-SITE.com/wp-json/mcpwp/v1/site-info \ -H "X-API-Key: $KEY" | jq
# List pagescurl -s https://YOUR-SITE.com/wp-json/mcpwp/v1/pages \ -H "X-API-Key: $KEY" | jq '.[].title.rendered'
# Create a pagecurl -s -X POST https://YOUR-SITE.com/wp-json/mcpwp/v1/pages \ -H "X-API-Key: $KEY" \ -H "Content-Type: application/json" \ -d '{"title":"My New Page","status":"draft"}' | jq
# MCP tool call (JSON-RPC)curl -s -X POST https://YOUR-SITE.com/wp-json/mcpwp/v1/mcp \ -H "X-API-Key: $KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"tools/call","id":1,"params":{"name":"wp_site_info","arguments":{}}}' | jqMCP endpoint
Section titled “MCP endpoint”The /mcp endpoint accepts JSON-RPC 2.0. Supported methods:
| Method | Purpose |
|---|---|
initialize | Handshake — returns server info and capabilities |
tools/list | List all available tools |
tools/call | Call a tool by name |
resources/list | List available resources |
resources/read | Read a resource |
prompts/list | List prompt templates |
prompts/get | Get a prompt |
ping | Health check |
→ See All Endpoints for the full REST API reference.