Skip to content

Commit f072424

Browse files
authored
Merge branch 'main' into sean/tool-annotations
2 parents 6a77567 + c3efd65 commit f072424

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

samples/kotlin-mcp-server/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,13 @@ tasks.test {
2323
kotlin {
2424
jvmToolchain(21)
2525
}
26+
27+
tasks.jar {
28+
manifest {
29+
attributes["Main-Class"] = "MainKt"
30+
}
31+
32+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
33+
34+
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
35+
}

src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/ReadBuffer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ReadBuffer {
2424
-1L -> return null
2525
0L -> {
2626
buffer.skip(1)
27-
""
27+
return null
2828
}
2929

3030
else -> {

src/jvmTest/kotlin/shared/ReadBufferTest.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ class ReadBufferTest {
4141
assertNull(readBuffer.readMessage())
4242
}
4343

44+
@Test
45+
fun `skip empty line`() {
46+
val readBuffer = ReadBuffer()
47+
readBuffer.append("\n".toByteArray(StandardCharsets.UTF_8))
48+
assertNull(readBuffer.readMessage())
49+
}
50+
4451
@Test
4552
fun `should be reusable after clearing`() {
4653
val readBuffer = ReadBuffer()

0 commit comments

Comments
 (0)