Remove fixed suffix /sse (#108)
* Simplify URL handling in SSE client transport. * fix the sse integration test --------- Co-authored-by: devcrocod <devcrocod@gmail.com>
This commit is contained in:
parent
1bd9734c6a
commit
aa00fc3d5e
2 changed files with 9 additions and 2 deletions
|
|
@ -68,7 +68,7 @@ public class SseClientTransport(
|
|||
|
||||
session = urlString?.let {
|
||||
client.sseSession(
|
||||
urlString = "$it/sse",
|
||||
urlString = it,
|
||||
reconnectionTime = reconnectionTime,
|
||||
block = requestBuilder,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@ package io.modelcontextprotocol.kotlin.sdk.integration
|
|||
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.plugins.sse.SSE
|
||||
import io.ktor.server.application.install
|
||||
import io.ktor.server.cio.CIOApplicationEngine
|
||||
import io.ktor.server.engine.EmbeddedServer
|
||||
import io.ktor.server.engine.embeddedServer
|
||||
import io.ktor.server.routing.routing
|
||||
import io.modelcontextprotocol.kotlin.sdk.Implementation
|
||||
import io.modelcontextprotocol.kotlin.sdk.ServerCapabilities
|
||||
import io.modelcontextprotocol.kotlin.sdk.client.Client
|
||||
|
|
@ -52,7 +54,12 @@ class SseIntegrationTest {
|
|||
ServerOptions(capabilities = ServerCapabilities()),
|
||||
)
|
||||
|
||||
return embeddedServer(ServerCIO, host = URL, port = PORT) { mcp { server } }.startSuspend(wait = false)
|
||||
return embeddedServer(ServerCIO, host = URL, port = PORT) {
|
||||
install(io.ktor.server.sse.SSE)
|
||||
routing {
|
||||
mcp { server }
|
||||
}
|
||||
}.startSuspend(wait = false)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
Loading…
Reference in a new issue