Module json_rpc_responses

Module json_rpc_responses 

Source
Expand description

JSON-RPC 2.0 response builders for HTTP transport

This module provides functions that always return JSON-RPC 2.0 conformant HTTP responses with proper headers and body content.

Functionsยง

bad_request_response
Build HTTP response for bad request (400) with JSON-RPC parse error.
jsonrpc_error_response
Build an HTTP response containing a JSON-RPC error object. Always returns a proper JSON-RPC 2.0 conformant response.
jsonrpc_notification_response
Build an HTTP response for JSON-RPC notifications (202 Accepted per MCP 2025-06-18).
jsonrpc_response_with_session
Build a generic JSON-RPC response with session header support.
jsonrpc_success_response
Build an HTTP response containing a successful JSON-RPC response.
method_not_allowed_response
Build HTTP response for method not allowed (405).
not_found_response
Build HTTP response for not found (404).
options_response
Build HTTP response for OPTIONS preflight requests.
sse_response_headers
Build HTTP response for SSE stream (proper headers for text/event-stream).