* Conditionally import Glibc on Linux for fcntl calls * Extract transport implementations into separate files * Fix warning in test * Add ubuntu-latest to CI test matrix * Switch to vapor/swiftly-action for setup step * Configure Prettier extension to format GitHub Actions workflows * Setup with different actions depending on platform * Rename step * Rename job * Update README
20 lines
496 B
Swift
20 lines
496 B
Swift
import Logging
|
|
|
|
import struct Foundation.Data
|
|
|
|
/// Protocol defining the transport layer for MCP communication
|
|
public protocol Transport: Actor {
|
|
var logger: Logger { get }
|
|
|
|
/// Establishes connection with the transport
|
|
func connect() async throws
|
|
|
|
/// Disconnects from the transport
|
|
func disconnect() async
|
|
|
|
/// Sends data
|
|
func send(_ data: Data) async throws
|
|
|
|
/// Receives data in an async sequence
|
|
func receive() -> AsyncThrowingStream<Data, Swift.Error>
|
|
}
|