File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,29 @@ try await client.connect(transport: transport)
3939let result = try await client.initialize ()
4040```
4141
42+ ### Streaming HTTP Transport
43+
44+ The HTTP transport supports streaming mode for real-time communication using Server-Sent Events (SSE):
45+
46+ ``` swift
47+ import MCP
48+
49+ // Create a streaming HTTP transport
50+ let transport = HTTPClientTransport (
51+ endpoint : URL (string : " http://localhost:8080" )! ,
52+ )
53+
54+ // Initialize the client with streaming transport
55+ let client = Client (name : " MyApp" , version : " 1.0.0" )
56+ try await client.connect (transport : transport)
57+
58+ // Initialize the connection
59+ let result = try await client.initialize ()
60+
61+ // The transport will automatically handle SSE events
62+ // and deliver them through the client's notification handlers
63+ ```
64+
4265### Basic Server Setup
4366
4467``` swift
You can’t perform that action at this time.
0 commit comments