McpContext
While PingGateway processes a Model Context Protocol (MCP) exchange, this context provides access to the MCP request from a client application and the responses from an MCP server.
| This feature has Evolving interface stability. It’s subject to change without notice, even in a minor or maintenance release. |
Access the context at ${contexts.mcp}.
Properties
"clientMessageType": enumeration-
One of these types of MCP client messages:
-
MCP_MESSAGE: Standard MCP request message. -
MCP_SSE_OPENING_REQUEST: Request a server-sent events (SSE) stream. -
MCP_SESSION_TERMINATION: Request to terminate the MCP session.
-
"clientMcpPayload": JSON-
JSON-RPC message or null if empty.
This feature requires PingGateway 2026.6 or later.
"clientPayload": JSON-
JSON-RPC message.
PingGateway 2026.3 only.
"mcpClientRequest": McpClientRequest object-
The client request object when the context contains a request, otherwise
null.The object has the following properties:
"clientName": string-
The client name for an initialize request, otherwise
null. "clientVersion": string-
The client version for an initialize request, otherwise
null. "id": JSON-
The request ID if known, either a number or a string.
"isInitialize": boolean-
Whether this is an initialize request.
"isNotification": boolean-
Whether this is a notification request.
"method": string-
The request method.
"params": JSON-
The request parameters.
This feature requires PingGateway 2026.9 or later.
"mcpServerResponse": McpServerResponse object-
The server response object when the context contains a response, otherwise
null.The object has the following properties:
"errorCode": number-
The error code when this is an error response, otherwise
0. "id": JSON-
The response ID if known, either a number or a string.
"isError": boolean-
Whether this is an error response.
"isInitialize": boolean-
Whether this is a response to an initialize request.
"serverName": string-
The server name for an initialize response, otherwise
null. "serverVersion": string-
The server version for an initialize response, otherwise
null.
This feature requires PingGateway 2026.9 or later.
"protocolVersion": string-
The MCP protocol version requested by the client application.
"serverMcpPayload": JSON-
JSON-RPC response payload received from the MCP server or null if empty.
This feature requires PingGateway 2026.6 or later.
"serverPayload": JSON-
JSON-RPC response payload received from the MCP server.
PingGateway 2026.3 only.
"serverMessageType": enumeration-
One of these types of MCP server messages:
-
MCP_MESSAGE: Standard MCP response message. -
MCP_SSE_STREAM_INITIALIZATION: Initial response to an SSE opening request.
-
"sessionId": string-
The MCP session identifier for the client application.