sigildocs

(sigil mcp protocol)

(sigil mcp protocol) - JSON-RPC 2.0 protocol implementation for MCP.

Provides message parsing, generation, and error handling for the JSON-RPC 2.0 protocol used by MCP.

Exports

Construct a jsonrpc-request struct.

Test if a value is a jsonrpc-request struct.

Get the id field of a jsonrpc-request struct.

Get the method field of a jsonrpc-request struct.

Get the params field of a jsonrpc-request struct.

Construct a jsonrpc-notification struct.

Test if a value is a jsonrpc-notification struct.

Get the method field of a jsonrpc-notification struct.

Get the params field of a jsonrpc-notification struct.

Construct a jsonrpc-response struct.

Test if a value is a jsonrpc-response struct.

Get the id field of a jsonrpc-response struct.

Get the result field of a jsonrpc-response struct.

Construct a jsonrpc-error-response struct.

Test if a value is a jsonrpc-error-response struct.

Get the id field of a jsonrpc-error-response struct.

Get the code field of a jsonrpc-error-response struct.

Get the message field of a jsonrpc-error-response struct.

Get the data field of a jsonrpc-error-response struct.

Parse a JSON-RPC message from a JSON string.

Returns a jsonrpc-request, jsonrpc-notification, or #f on parse error. Does not handle batch requests (arrays).

parse-messageprocedure

Parse a JSON-RPC message from a parsed JSON value (dict).

Returns a jsonrpc-request, jsonrpc-notification, or #f if invalid.

Serialize a successful response to JSON string.

Serialize an error response to JSON string.

Serialize a notification to JSON string.

request->jsonprocedure

Serialize a request to JSON string.

make-responseprocedure

Create a successful response for a request.

Create an error response for a request.

Create a notification (server to client).