---
title: McpContext
description: 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.
component: pinggateway
version: 2026
page_id: pinggateway:reference:McpContext
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/McpContext.html
revdate: 2025-11-25
section_ids:
  properties: Properties
---

# McpContext

While PingGateway processes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro) exchange, this context provides access to the MCP request from a client application and the responses from an MCP server.

|   |                                                                                                                                                                                                                             |
| - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | This feature has [Evolving](https://docs.pingidentity.com/pinggateway/release-notes/stability.html#interface-stability) 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](preface.html#definition-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.

* `"clientPayload"`: [JSON](preface.html#definition-jsonvalue)

  JSON-RPC message.

* `"protocolVersion"`: [string](preface.html#definition-string)

  The MCP protocol version requested by the client application.

* `"serverPayload"`: [JSON](preface.html#definition-jsonvalue)

  JSON-RPC response payload received from the MCP server.

* `"serverMessageType"`: [enumeration](preface.html#definition-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](preface.html#definition-string)

  The MCP session identifier for the client application.
