Skip to main content

Module protocol

Module protocol 

Source
Expand description

JSON-RPC protocol handling for MCP server.

Implements the Content-Length framed JSON-RPC transport used by the Model Context Protocol over stdio.

Functionsยง

build_error_message
Build a JSON-RPC 2.0 error message.
build_notification
Build a JSON-RPC 2.0 notification (no id, no response expected).
build_result_message
Build a JSON-RPC 2.0 result message.
read_payload
Read a JSON-RPC payload from a buffered reader.
write_message
Write a Content-Length framed JSON-RPC message to a writer.