You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(server): #573, #574: add customizable builder to StdioServerTransport
Scope lifecycle is fixed (#574 resolved), processing dispatcher defaults to `Dispatchers.Default` (#573 resolved), scope context is clean (no spurious dispatcher stacking), and @volatile on the three job vars addresses the visibility race.
- Introduce a `Configuration` class for `StdioServerTransport` to improve API flexibility and readability.
- Updated transport initialization to use a builder block for configuring parameters such as I/O streams, buffer sizes, dispatchers, and parent coroutine scope.
Test: Added integration test validating the builder functionality.
Copy file name to clipboardExpand all lines: kotlin-sdk-server/api/kotlin-sdk-server.api
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -186,12 +186,35 @@ public final class io/modelcontextprotocol/kotlin/sdk/server/SseServerTransport
186
186
}
187
187
188
188
public final class io/modelcontextprotocol/kotlin/sdk/server/StdioServerTransport : io/modelcontextprotocol/kotlin/sdk/shared/AbstractTransport {
189
+
public fun <init> (Lkotlin/jvm/functions/Function1;)V
189
190
public fun <init> (Lkotlinx/io/Source;Lkotlinx/io/Sink;)V
190
191
public fun close (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
191
192
public fun send (Lio/modelcontextprotocol/kotlin/sdk/types/JSONRPCMessage;Lio/modelcontextprotocol/kotlin/sdk/shared/TransportSendOptions;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
192
193
public fun start (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
193
194
}
194
195
196
+
public final class io/modelcontextprotocol/kotlin/sdk/server/StdioServerTransport$Configuration {
197
+
public fun <init> ()V
198
+
public final fun getCoroutineScope ()Lkotlinx/coroutines/CoroutineScope;
199
+
public final fun getProcessingJobDispatcher ()Lkotlinx/coroutines/CoroutineDispatcher;
200
+
public final fun getReadBufferSize ()J
201
+
public final fun getReadChannelBufferSize ()I
202
+
public final fun getReadingJobDispatcher ()Lkotlinx/coroutines/CoroutineDispatcher;
203
+
public final fun getSink ()Lkotlinx/io/Sink;
204
+
public final fun getSource ()Lkotlinx/io/Source;
205
+
public final fun getWriteChannelBufferSize ()I
206
+
public final fun getWritingJobDispatcher ()Lkotlinx/coroutines/CoroutineDispatcher;
207
+
public final fun setCoroutineScope (Lkotlinx/coroutines/CoroutineScope;)V
208
+
public final fun setProcessingJobDispatcher (Lkotlinx/coroutines/CoroutineDispatcher;)V
209
+
public final fun setReadBufferSize (J)V
210
+
public final fun setReadChannelBufferSize (I)V
211
+
public final fun setReadingJobDispatcher (Lkotlinx/coroutines/CoroutineDispatcher;)V
212
+
public final fun setSink (Lkotlinx/io/Sink;)V
213
+
public final fun setSource (Lkotlinx/io/Source;)V
214
+
public final fun setWriteChannelBufferSize (I)V
215
+
public final fun setWritingJobDispatcher (Lkotlinx/coroutines/CoroutineDispatcher;)V
216
+
}
217
+
195
218
public final class io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport : io/modelcontextprotocol/kotlin/sdk/shared/AbstractTransport {
196
219
public static final field STANDALONE_SSE_STREAM_ID Ljava/lang/String;
Copy file name to clipboardExpand all lines: kotlin-sdk-server/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/server/StdioServerTransportTest.kt
0 commit comments