using System.Threading.Channels; using McpDotNet.Protocol.Messages; namespace McpDotNet.Protocol.Transport; /// /// Represents a transport mechanism for MCP communication. /// public interface IMcpTransport : IAsyncDisposable { /// /// Gets whether the transport is currently connected. /// bool IsConnected { get; } /// /// Channel for receiving messages from the transport. /// ChannelReader MessageReader { get; } /// /// Establishes the transport connection. /// /// Token to cancel the operation. Task ConnectAsync(CancellationToken cancellationToken = default); /// /// Sends a message through the transport. /// /// The message to send. /// Token to cancel the operation. Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default); }