Open a PyGen MCP event stream

GET https://{controlplane_path}/api/1/rest/public/platform_mcp/mcp/pygen

Overview

This API opens a persistent Server-Sent Events (SSE) stream for receiving server-initiated messages from the Platform MCP Server on the PyGen toolset.

Use this endpoint when your MCP client needs to receive asynchronous notifications or streaming responses initiated by the server for the PyGen toolset. The stream remains open until the client closes the connection or the session is terminated with DELETE /platform_mcp/mcp/pygen.

Prerequisites

  • Read access to the requested assets
  • An active PyGen toolset MCP session. Initialize a session with POST /platform_mcp/mcp/pygen and obtain the Mcp-Session-Id before opening a stream.

Request

GET https://{controlplane_path}/api/1/rest/public/platform_mcp/mcp/pygen
      

Path parameters

Key Description
controlplane_path Required. The path to the SnapLogic control plane: elastic.snaplogic.com
For the UAT or EMEA control plane, substitute the name for elastic. For example:
  • uat.elastic.snaplogic.com
  • emea.snaplogic.com

Request headers

Key Type Description
Authorization String Required. SLToken or HTTP Basic credentials.
Mcp-Session-Id String Required. The session identifier returned by the initialize response. Associates this SSE stream with an existing PyGen toolset MCP session.

Request body

None.

Response

Returns a chunked SSE stream with Content-Type: text/event-stream. Each event carries a JSON-RPC 2.0 message in the data field:

event: message
data: {"jsonrpc": "2.0", "method": "notifications/message", "params": { ... }}

HTTP status codes:

Key Description
200 OK The SSE stream is open and ready to receive server-initiated messages.
401 Unauthorized The request is missing a valid Authorization header.
502 Bad Gateway The Platform MCP Server is unreachable.

Examples

GET https://cdn.elastic.snaplogic.com/api/1/rest/public/platform_mcp/mcp/pygen
Authorization: SLToken <your_token>
Mcp-Session-Id: <session_id>