Skip to content
WP EngineDocumentation

MCP server (Streamable HTTP transport)

POST
/v1/mcp
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.ai.wpengine.com/v1/mcp', [
'body' => '{}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();

Exposes the gateway as a remote MCP server over the Streamable HTTP transport (JSON-RPC 2.0 over HTTP, optionally upgrading to Server-Sent Events for streamed responses). Accepts either a WP Engine API key (prefixed “wpe_”) carrying the mcp scope, scoped to the key’s project, or an Okta JWT with WPEngine-Account and WPEngine-Project headers (Console Coworker). Interactive OAuth sign-in for external MCP clients (e.g. Claude Desktop) is planned. The gateway does not preserve MCP session state between requests; clients should not rely on server-side session continuity across calls. The list_site_abilities, search_abilities, and run_site_ability tools additionally require a personal API key when using API-key auth; a project-scoped key resolves no acting user and these tools return an unauthorized error. Okta JWT callers use the verified subject instead.

WPEngine-Account
string

WP Engine account context. For API keys the account acted on is derived from the key and this header is informational only. For Okta JWT (Console Coworker) this header is required and must match the token’s account claim.

WPEngine-Project
string

WP Engine project context. Required for Okta JWT callers (Console Coworker). For API keys the project is derived from the key.

Agent-Session-Id
string

Optional. The agent session a knowledge-base tool call is being performed for, when the call answers a tool request from that session. Used only to group the call with the rest of the session’s activity in observability data. It is ignored unless it names a session in the same project as the caller, and it never changes the response.

Media typeapplication/json
One of:

A JSON-RPC 2.0 request or notification per the MCP spec.

object
key
additional properties
any
Examplegenerated
{}

One application/json JSON-RPC response for a single request, or an array of responses when the POST body was a JSON-RPC batch.

Media typeapplication/json
One of:

JSON-RPC 2.0 response for a single request.

object
key
additional properties
any
Examplegenerated
{}

Accepted with no body for JSON-RPC notifications (such as notifications/initialized) that do not expect a response.

Invalid MCP request — for example, a missing or invalid Accept header, an empty POST body, a JSON-RPC batch exceeding 10 messages, or malformed JSON-RPC payload. Oversized batches return HTTP 400 with a JSON-RPC Invalid Request error (code: -32600, message: batch exceeds maximum of 10 calls) before any message is dispatched. Most other validation failures return plain text; MCP standard header mismatches return a JSON-RPC error object instead.

string

Missing or invalid bearer token

Media typeapplication/json
object
error
required
object
message
required
string
type
required
string
code
required
integer
request_id
required

Correlation ID for this request, matching the X-Request-ID response header — a 32-character trace ID behind the load balancer, otherwise a UUID. Quote it in support reports.

string
Example
{
"error": {
"type": "invalid_request_error",
"request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5"
}
}
WWW-Authenticate
string
Example
Bearer realm="ai-services"

The token is valid, but the caller is not permitted to perform this action — either its scope/permission is insufficient or the authenticated user is not authorized for the target account (error type “permission_error”). On /v1/chat/completions specifically, a 403 with error type “content_policy_violation” instead means the request content was blocked by content moderation policy; that response never identifies which filter or category matched.

Media typeapplication/json
object
error
required
object
message
required
string
type
required
string
code
required
integer
request_id
required

Correlation ID for this request, matching the X-Request-ID response header — a 32-character trace ID behind the load balancer, otherwise a UUID. Quote it in support reports.

string
Example
{
"error": {
"type": "invalid_request_error",
"request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5"
}
}

Request Content-Type is not application/json.

Media typetext/plain
string

A required dependency is temporarily unavailable. Retry after a short delay with exponential back-off.

Media typeapplication/json
object
error
required
object
message
required
string
type
required
string
code
required
integer
request_id
required

Correlation ID for this request, matching the X-Request-ID response header — a 32-character trace ID behind the load balancer, otherwise a UUID. Quote it in support reports.

string
Example
{
"error": {
"type": "invalid_request_error",
"request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5"
}
}