Module transport

Source
Expand description

§MCP Transport Layer

This module implements the transport layer for the Model Context Protocol (MCP). It provides abstractions for sending and receiving JSON-RPC messages between clients and servers using different transport mechanisms.

The transport layer:

  • Handles serialization and deserialization of messages
  • Provides interfaces for sending and receiving messages
  • Defines transport-specific implementations (SSE, stdio)
  • Abstracts the underlying communication protocol

The core component is the Transport trait, which defines the operations that any MCP transport must support, regardless of the underlying mechanism.

Structs§

ClientStdioTransport
Client transport that communicates with an MCP server over standard I/O.
JsonRpcError
Represents a JSON-RPC error.
JsonRpcNotification
Represents a JSON-RPC notification.
JsonRpcRequest
Represents a JSON-RPC request.
JsonRpcResponse
Represents a JSON-RPC response.
JsonRpcVersion
Represents a JSON-RPC protocol version.
ServerStdioTransport
Server transport that communicates with MCP clients over standard I/O.

Enums§

JsonRpcMessage
Represents a JSON-RPC message.

Traits§

Transport
Core trait that defines operations for MCP transports.

Type Aliases§

Message
A message in the MCP protocol.
RequestId
Type representing a JSON-RPC request ID.