Skip to content

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.

Pass your API key in the X-API-Key header:

Terminal window
curl https://YOUR-SITE.com/wp-json/mcpwp/v1/site-info \
-H "X-API-Key: mcpwp_YOUR_KEY"

Or as a Bearer token:

Terminal window
curl https://YOUR-SITE.com/wp-json/mcpwp/v1/site-info \
-H "Authorization: Bearer mcpwp_YOUR_KEY"
https://YOUR-SITE.com/wp-json/mcpwp/v1/
Terminal window
# Site info
curl -s https://YOUR-SITE.com/wp-json/mcpwp/v1/site-info \
-H "X-API-Key: $KEY" | jq
# List pages
curl -s https://YOUR-SITE.com/wp-json/mcpwp/v1/pages \
-H "X-API-Key: $KEY" | jq '.[].title.rendered'
# Create a page
curl -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":{}}}' | jq

The /mcp endpoint accepts JSON-RPC 2.0. Supported methods:

MethodPurpose
initializeHandshake — returns server info and capabilities
tools/listList all available tools
tools/callCall a tool by name
resources/listList available resources
resources/readRead a resource
prompts/listList prompt templates
prompts/getGet a prompt
pingHealth check

→ See All Endpoints for the full REST API reference.