File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/client Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -119,4 +119,31 @@ class SseTransportTest : BaseTransportTest() {
119119 testClientRead(client)
120120 server.stop()
121121 }
122+
123+ @Test
124+ fun `test sse path not root path` () = runTest {
125+ val server = embeddedServer(CIO , port = PORT ) {
126+ install(io.ktor.server.sse.SSE )
127+ routing {
128+ mcpSseTransport(path = " /sse" , incomingPath = " /messages" ) {
129+ onMessage = {
130+ send(it)
131+ }
132+ }
133+ }
134+ }.start(wait = false )
135+
136+ val client = HttpClient {
137+ install(SSE )
138+ }.mcpSseTransport {
139+ url {
140+ host = " localhost"
141+ port = PORT
142+ pathSegments = listOf (" sse" )
143+ }
144+ }
145+
146+ testClientRead(client)
147+ server.stop()
148+ }
122149}
You can’t perform that action at this time.
0 commit comments