Add streamable HTTP transport for clients (#70)

* Rename file to Transport.swift

* Rename file to StdioTransportTests.swift

* Add .index-build/ to .gitignore

* Implement HTTP client transport

* Add test coverage for streamable HTTP client transport

* Conditionally import FoundationNetworking

* Conditionalize streaming for unsupported platforms

* Import FoundationNetworking in tests

* Add 5 minute timeout to CI jobs

* Remove debug logging

* Formatting

* Skip SSE tests on platforms that don't support streaming
This commit is contained in:
Mattt 2025-04-15 09:06:29 -07:00 • committed by GitHub
commit d583151871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,20 @@
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>
}