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
- Clear callMapping in close() method to prevent memory leaks
- Add comprehensive KDoc comments for all public APIs
- Fix Accept header validation to use proper matching instead of contains
- Fix ContentType header key to use HttpHeaders.ContentType
- Fix parseBody error message for invalid JSON format
- Add unit tests for StreamableHttpServerTransport
Copy file name to clipboardExpand all lines: src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport.kt
+62-8Lines changed: 62 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,11 @@ import kotlin.uuid.Uuid
24
24
* Server transport for StreamableHttp: this allows server to respond to GET, POST and DELETE requests. Server can optionally make use of Server-Sent Events (SSE) to stream multiple server messages.
25
25
*
26
26
* Creates a new StreamableHttp server transport.
27
+
*
28
+
* @param isStateful If true, the server will generate and maintain session IDs for each client connection.
29
+
* Session IDs are included in response headers and must be provided by clients in subsequent requests.
30
+
* @param enableJSONResponse If true, the server will return JSON responses instead of starting an SSE stream.
31
+
* This can be useful for simple request/response scenarios without streaming.
27
32
*/
28
33
@OptIn(ExperimentalAtomicApi::class)
29
34
publicclassStreamableHttpServerTransport(
@@ -38,6 +43,11 @@ public class StreamableHttpServerTransport(
0 commit comments