Package-level declarations

Types

Link copied to clipboard

Abstract base class representing a client-side transport layer for communication.

Link copied to clipboard
abstract class AbstractTransport : Transport

Implements onClose, onError and onMessage functions of Transport providing corresponding _onClose, _onError and _onMessage properties to use for an implementation.

Link copied to clipboard

States of a client transport within the protocol lifecycle

Link copied to clipboard
typealias ProgressCallback = (Progress) -> Unit

Callback for progress notifications.

Link copied to clipboard
abstract class Protocol(options: ProtocolOptions?)

Implements MCP protocol framing on top of a pluggable transport, including features like request/response linking, notifications, and progress.

Link copied to clipboard
open class ProtocolOptions(var enforceStrictCapabilities: Boolean = false, var timeout: Duration = DEFAULT_REQUEST_TIMEOUT)

Additional initialization options.

Link copied to clipboard

Buffers a continuous stdio stream into discrete JSON-RPC messages.

Link copied to clipboard

Extra data given to request handlers.

Link copied to clipboard
class RequestOptions(relatedRequestId: RequestId? = null, resumptionToken: String? = null, onResumptionToken: (String) -> Unit? = null, val onProgress: ProgressCallback? = null, val timeout: Duration = DEFAULT_REQUEST_TIMEOUT) : TransportSendOptions

Options that can be given per request.

Link copied to clipboard
interface Transport

Describes the minimal contract for MCP transport that a client or server can communicate over.

Link copied to clipboard
open class TransportSendOptions(val relatedRequestId: RequestId? = null, val resumptionToken: String? = null, val onResumptionToken: (String) -> Unit? = null)

Options for sending a JSON-RPC message through transport.

Link copied to clipboard

Abstract class representing a WebSocket transport for the Model Context Protocol (MCP). Handles communication over a WebSocket session.

Properties

Link copied to clipboard

The default request timeout.

Link copied to clipboard

Default implementation name used in MCP handshake.

Link copied to clipboard

WebSocket subprotocol identifier for MCP connections.

Functions

Link copied to clipboard

Serializes a JSONRPCMessage to its JSON string representation with a trailing newline.