v3
MCP

Mcp Http Post

Handle MCP JSON-RPC requests via HTTP Streamable transport.

This endpoint implements the MCP Streamable HTTP transport (spec 2025-03-26).

  • Accepts JSON-RPC requests via POST
  • Returns either immediate JSON response OR SSE stream on same connection
  • Session management via Mcp-Session-Id header
  • Content negotiation via Accept header

The response format is determined by:

  1. Message type (notifications return 202 Accepted)
  2. Accept header (must include text/event-stream for SSE)
  3. Tool execution characteristics (long-running tools may stream)

Args: request: FastAPI request message: JSON-RPC message auth_api_key: API key authentication mcp_session_id: Optional session ID from header mcp_protocol_version: MCP-Protocol-Version header (defaults to 2025-03-26 if absent) accept: Accept header for content negotiation

Returns: JSONResponse with immediate result OR EventSourceResponse with SSE stream

post/v3/mcp/http

Headers

Mcp-Session-Idstring nullable
MCP-Protocol-Versionstring nullable
X-Thread-Idstring nullable
X-Definite-MCP-Clientstring nullable
acceptstring nullable

Request body

object required

Response

Successful Response

{"stackTrail":"paths:/v3/mcp/http:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes