diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3371dcc6..fd848b4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,9 +49,9 @@ jobs: working-directory: ./samples/kotlin-mcp-client run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT -# - name: Build Kotlin-MCP-Server Sample -# working-directory: ./samples/kotlin-mcp-server -# run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT + - name: Build Kotlin-MCP-Server Sample + working-directory: ./samples/kotlin-mcp-server + run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT - name: Build Weather-Stdio-Server Sample working-directory: ./samples/weather-stdio-server diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index f023e4fe..7ef265de 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -23,7 +23,7 @@ jobs: matrix: sample: - kotlin-mcp-client -# - kotlin-mcp-server + - kotlin-mcp-server - weather-stdio-server name: Build Sample diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d937c395..0283a646 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,6 +8,7 @@ kover = "0.9.3" netty = "4.2.7.Final" mavenPublish = "0.34.0" binaryCompatibilityValidatorPlugin = "0.18.1" +openapi-generator = "7.17.0" # libraries version serialization = "1.9.0" @@ -23,45 +24,46 @@ mokksy = "0.6.1" [libraries] # Plugins +dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } kotlinx-atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" } -dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "mavenPublish" } # Kotlinx libraries -kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } +kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version.ref = "logging" } +kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "collections-immutable" } kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" } kotlinx-coroutines-core-wasm = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core-wasm-js", version.ref = "coroutines" } kotlinx-io-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-io-core", version.ref = "kotlinx-io" } -kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "collections-immutable" } -kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version.ref = "logging" } +kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } # Ktor ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" } -ktor-client-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" } -ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging"} ktor-client-apache5 = { group = "io.ktor", name = "ktor-client-apache5" } -ktor-server-sse = { group = "io.ktor", name = "ktor-server-sse", version.ref = "ktor" } -ktor-server-websockets = { group = "io.ktor", name = "ktor-server-websockets", version.ref = "ktor" } -ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" } +ktor-client-core = { group = "io.ktor", name = "ktor-client-core" } +ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging" } +ktor-server-core = { group = "io.ktor", name = "ktor-server-core" } +ktor-server-sse = { group = "io.ktor", name = "ktor-server-sse" } +ktor-server-websockets = { group = "io.ktor", name = "ktor-server-websockets" } # Testing awaitility = { group = "org.awaitility", name = "awaitility-kotlin", version.ref = "awaitility" } kotest-assertions-core = { group = "io.kotest", name = "kotest-assertions-core", version.ref = "kotest" } kotest-assertions-json = { group = "io.kotest", name = "kotest-assertions-json", version.ref = "kotest" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" } -ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock", version.ref = "ktor" } -ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host", version.ref = "ktor" } +ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock" } +ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host" } mokksy = { group = "dev.mokksy", name = "mokksy", version.ref = "mokksy" } -slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" } netty-bom = { group = "io.netty", name = "netty-bom", version.ref = "netty" } +slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" } # Samples -ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" } -ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio", version.ref = "ktor" } +ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio" } +ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio" } [plugins] kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidatorPlugin" } -ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } +ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } +openapi-generator = { id = "org.openapi.generator", version.ref = "openapi-generator" } diff --git a/kotlin-sdk-client/build.gradle.kts b/kotlin-sdk-client/build.gradle.kts index 2466f8ef..838afcea 100644 --- a/kotlin-sdk-client/build.gradle.kts +++ b/kotlin-sdk-client/build.gradle.kts @@ -32,6 +32,7 @@ kotlin { sourceSets { commonMain { dependencies { + implementation(dependencies.platform(libs.ktor.bom)) api(project(":kotlin-sdk-core")) api(libs.ktor.client.core) implementation(libs.kotlin.logging) @@ -41,7 +42,6 @@ kotlin { commonTest { dependencies { implementation(kotlin("test")) - implementation(dependencies.platform(libs.ktor.bom)) implementation(libs.ktor.client.mock) implementation(libs.ktor.server.websockets) implementation(libs.kotlinx.coroutines.test) diff --git a/kotlin-sdk-core/build.gradle.kts b/kotlin-sdk-core/build.gradle.kts index 186e1684..9e07904b 100644 --- a/kotlin-sdk-core/build.gradle.kts +++ b/kotlin-sdk-core/build.gradle.kts @@ -7,7 +7,7 @@ plugins { id("mcp.publishing") id("mcp.dokka") alias(libs.plugins.kotlinx.binary.compatibility.validator) - id("org.openapi.generator") version "7.17.0" + alias(libs.plugins.openapi.generator) } /* @@ -110,6 +110,7 @@ kotlin { commonMain { kotlin.srcDir(generateLibVersion) dependencies { + implementation(dependencies.platform(libs.ktor.bom)) api(libs.kotlinx.serialization.json) api(libs.kotlinx.coroutines.core) api(libs.kotlinx.io.core) diff --git a/kotlin-sdk-server/build.gradle.kts b/kotlin-sdk-server/build.gradle.kts index 64a27497..f00fc404 100644 --- a/kotlin-sdk-server/build.gradle.kts +++ b/kotlin-sdk-server/build.gradle.kts @@ -9,6 +9,7 @@ kotlin { sourceSets { commonMain { dependencies { + implementation(dependencies.platform(libs.ktor.bom)) api(project(":kotlin-sdk-core")) api(libs.ktor.server.core) api(libs.ktor.server.sse) diff --git a/kotlin-sdk-test/build.gradle.kts b/kotlin-sdk-test/build.gradle.kts index 41bf5458..b8532e1e 100644 --- a/kotlin-sdk-test/build.gradle.kts +++ b/kotlin-sdk-test/build.gradle.kts @@ -11,6 +11,7 @@ kotlin { sourceSets { commonTest { dependencies { + implementation(dependencies.platform(libs.ktor.bom)) implementation(project(":kotlin-sdk")) implementation(kotlin("test")) implementation(libs.kotest.assertions.json) diff --git a/kotlin-sdk/build.gradle.kts b/kotlin-sdk/build.gradle.kts index e59df60e..c59ba69c 100644 --- a/kotlin-sdk/build.gradle.kts +++ b/kotlin-sdk/build.gradle.kts @@ -7,6 +7,7 @@ kotlin { sourceSets { commonMain { dependencies { + implementation(dependencies.platform(libs.ktor.bom)) api(project(":kotlin-sdk-core")) api(project(":kotlin-sdk-client")) api(project(":kotlin-sdk-server")) diff --git a/samples/kotlin-mcp-client/build.gradle.kts b/samples/kotlin-mcp-client/build.gradle.kts index 3e3ad859..61774cb6 100644 --- a/samples/kotlin-mcp-client/build.gradle.kts +++ b/samples/kotlin-mcp-client/build.gradle.kts @@ -12,6 +12,7 @@ group = "org.example" version = "0.1.0" dependencies { + implementation(dependencies.platform(libs.ktor.bom)) implementation(libs.mcp.kotlin.client) implementation(libs.ktor.client.cio) implementation(libs.anthropic.java) diff --git a/samples/kotlin-mcp-client/gradle/libs.versions.toml b/samples/kotlin-mcp-client/gradle/libs.versions.toml index 7490ed61..99cde114 100644 --- a/samples/kotlin-mcp-client/gradle/libs.versions.toml +++ b/samples/kotlin-mcp-client/gradle/libs.versions.toml @@ -8,7 +8,8 @@ slf4j = "2.0.17" [libraries] anthropic-java = { group = "com.anthropic", name = "anthropic-java", version.ref = "anthropic" } -ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" } +ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" } +ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio" } mcp-kotlin-client = { group = "io.modelcontextprotocol", name = "kotlin-sdk-client", version.ref = "mcp-kotlin" } slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" } diff --git a/samples/kotlin-mcp-server/build.gradle.kts b/samples/kotlin-mcp-server/build.gradle.kts index 0bf45d86..48789db2 100644 --- a/samples/kotlin-mcp-server/build.gradle.kts +++ b/samples/kotlin-mcp-server/build.gradle.kts @@ -12,6 +12,7 @@ application { } dependencies { + implementation(dependencies.platform(libs.ktor.bom)) implementation(libs.mcp.kotlin.server) implementation(libs.ktor.server.cio) implementation(libs.slf4j.simple) diff --git a/samples/kotlin-mcp-server/gradle/libs.versions.toml b/samples/kotlin-mcp-server/gradle/libs.versions.toml index 37eb1609..c4c437a7 100644 --- a/samples/kotlin-mcp-server/gradle/libs.versions.toml +++ b/samples/kotlin-mcp-server/gradle/libs.versions.toml @@ -6,7 +6,8 @@ slf4j = "2.0.17" serialization = "1.9.0" [libraries] -ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio", version.ref = "ktor" } +ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" } +ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio" } mcp-kotlin-server = { group = "io.modelcontextprotocol", name = "kotlin-sdk-server", version.ref = "mcp-kotlin" } slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" } diff --git a/samples/weather-stdio-server/build.gradle.kts b/samples/weather-stdio-server/build.gradle.kts index 2b087d93..0420cc0d 100644 --- a/samples/weather-stdio-server/build.gradle.kts +++ b/samples/weather-stdio-server/build.gradle.kts @@ -13,6 +13,7 @@ group = "org.example" version = "0.1.0" dependencies { + implementation(dependencies.platform(libs.ktor.bom)) implementation(libs.ktor.client.content.negotiation) implementation(libs.ktor.serialization.kotlinx.json) implementation(libs.mcp.kotlin.server) diff --git a/samples/weather-stdio-server/gradle/libs.versions.toml b/samples/weather-stdio-server/gradle/libs.versions.toml index 87efc887..3ac5426c 100644 --- a/samples/weather-stdio-server/gradle/libs.versions.toml +++ b/samples/weather-stdio-server/gradle/libs.versions.toml @@ -12,9 +12,10 @@ slf4j = "2.0.17" kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging-jvm", version.ref = "logging" } kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable-jvm", version.ref = "collections-immutable" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" } -ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" } -ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" } -ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json-jvm", version.ref = "ktor" } +ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" } +ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio" } +ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation" } +ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json-jvm" } ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio", version.ref = "ktor" } mcp-kotlin-client = { group = "io.modelcontextprotocol", name = "kotlin-sdk-client", version.ref = "mcp-kotlin" } mcp-kotlin-server = { group = "io.modelcontextprotocol", name = "kotlin-sdk-server", version.ref = "mcp-kotlin" }