Add Ktor BOM for dependency management across all modules, run Kotlin-MCP-Server Sample (#367)

## Motivation and Context
- 📦 Unifies Ktor library versioning by introducing the Ktor BOM
dependency.
- ✅  Re-enable build of MCP Server Sample

## How Has This Been Tested?
Regression tests

## Breaking Changes
No

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Build configuration update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
This commit is contained in:
Konstantin Pavlov 2025-11-04 11:44:39 +02:00 • committed by GitHub
commit 935a1eddbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 38 additions and 26 deletions

View file

@ -49,9 +49,9 @@ jobs:
working-directory: ./samples/kotlin-mcp-client working-directory: ./samples/kotlin-mcp-client
run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT
# - name: Build Kotlin-MCP-Server Sample - name: Build Kotlin-MCP-Server Sample
# working-directory: ./samples/kotlin-mcp-server working-directory: ./samples/kotlin-mcp-server
# run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT
- name: Build Weather-Stdio-Server Sample - name: Build Weather-Stdio-Server Sample
working-directory: ./samples/weather-stdio-server working-directory: ./samples/weather-stdio-server

View file

@ -23,7 +23,7 @@ jobs:
matrix: matrix:
sample: sample:
- kotlin-mcp-client - kotlin-mcp-client
# - kotlin-mcp-server - kotlin-mcp-server
- weather-stdio-server - weather-stdio-server
name: Build Sample name: Build Sample

View file

@ -8,6 +8,7 @@ kover = "0.9.3"
netty = "4.2.7.Final" netty = "4.2.7.Final"
mavenPublish = "0.34.0" mavenPublish = "0.34.0"
binaryCompatibilityValidatorPlugin = "0.18.1" binaryCompatibilityValidatorPlugin = "0.18.1"
openapi-generator = "7.17.0"
# libraries version # libraries version
serialization = "1.9.0" serialization = "1.9.0"
@ -23,45 +24,46 @@ mokksy = "0.6.1"
[libraries] [libraries]
# Plugins # 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-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", 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" } 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" } maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "mavenPublish" }
# Kotlinx libraries # 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 = { 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-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-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" } 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" }
# Ktor # Ktor
ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "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-client-apache5 = { group = "io.ktor", name = "ktor-client-apache5" }
ktor-server-sse = { group = "io.ktor", name = "ktor-server-sse", version.ref = "ktor" } ktor-client-core = { group = "io.ktor", name = "ktor-client-core" }
ktor-server-websockets = { group = "io.ktor", name = "ktor-server-websockets", version.ref = "ktor" } ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging" }
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" } 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 # Testing
awaitility = { group = "org.awaitility", name = "awaitility-kotlin", version.ref = "awaitility" } 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-core = { group = "io.kotest", name = "kotest-assertions-core", version.ref = "kotest" }
kotest-assertions-json = { group = "io.kotest", name = "kotest-assertions-json", 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" } 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-client-mock = { group = "io.ktor", name = "ktor-client-mock" }
ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host", version.ref = "ktor" } ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host" }
mokksy = { group = "dev.mokksy", name = "mokksy", version.ref = "mokksy" } 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" } netty-bom = { group = "io.netty", name = "netty-bom", version.ref = "netty" }
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
# Samples # Samples
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" } ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio" }
ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio", version.ref = "ktor" } ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio" }
[plugins] [plugins]
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidatorPlugin" } 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" } 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" }

View file

@ -32,6 +32,7 @@ kotlin {
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
api(project(":kotlin-sdk-core")) api(project(":kotlin-sdk-core"))
api(libs.ktor.client.core) api(libs.ktor.client.core)
implementation(libs.kotlin.logging) implementation(libs.kotlin.logging)
@ -41,7 +42,6 @@ kotlin {
commonTest { commonTest {
dependencies { dependencies {
implementation(kotlin("test")) implementation(kotlin("test"))
implementation(dependencies.platform(libs.ktor.bom))
implementation(libs.ktor.client.mock) implementation(libs.ktor.client.mock)
implementation(libs.ktor.server.websockets) implementation(libs.ktor.server.websockets)
implementation(libs.kotlinx.coroutines.test) implementation(libs.kotlinx.coroutines.test)

View file

@ -7,7 +7,7 @@ plugins {
id("mcp.publishing") id("mcp.publishing")
id("mcp.dokka") id("mcp.dokka")
alias(libs.plugins.kotlinx.binary.compatibility.validator) 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 { commonMain {
kotlin.srcDir(generateLibVersion) kotlin.srcDir(generateLibVersion)
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
api(libs.kotlinx.serialization.json) api(libs.kotlinx.serialization.json)
api(libs.kotlinx.coroutines.core) api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.io.core) api(libs.kotlinx.io.core)

View file

@ -9,6 +9,7 @@ kotlin {
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
api(project(":kotlin-sdk-core")) api(project(":kotlin-sdk-core"))
api(libs.ktor.server.core) api(libs.ktor.server.core)
api(libs.ktor.server.sse) api(libs.ktor.server.sse)

View file

@ -11,6 +11,7 @@ kotlin {
sourceSets { sourceSets {
commonTest { commonTest {
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
implementation(project(":kotlin-sdk")) implementation(project(":kotlin-sdk"))
implementation(kotlin("test")) implementation(kotlin("test"))
implementation(libs.kotest.assertions.json) implementation(libs.kotest.assertions.json)

View file

@ -7,6 +7,7 @@ kotlin {
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
api(project(":kotlin-sdk-core")) api(project(":kotlin-sdk-core"))
api(project(":kotlin-sdk-client")) api(project(":kotlin-sdk-client"))
api(project(":kotlin-sdk-server")) api(project(":kotlin-sdk-server"))

View file

@ -12,6 +12,7 @@ group = "org.example"
version = "0.1.0" version = "0.1.0"
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
implementation(libs.mcp.kotlin.client) implementation(libs.mcp.kotlin.client)
implementation(libs.ktor.client.cio) implementation(libs.ktor.client.cio)
implementation(libs.anthropic.java) implementation(libs.anthropic.java)

View file

@ -8,7 +8,8 @@ slf4j = "2.0.17"
[libraries] [libraries]
anthropic-java = { group = "com.anthropic", name = "anthropic-java", version.ref = "anthropic" } 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" } 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" } slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }

View file

@ -12,6 +12,7 @@ application {
} }
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
implementation(libs.mcp.kotlin.server) implementation(libs.mcp.kotlin.server)
implementation(libs.ktor.server.cio) implementation(libs.ktor.server.cio)
implementation(libs.slf4j.simple) implementation(libs.slf4j.simple)

View file

@ -6,7 +6,8 @@ slf4j = "2.0.17"
serialization = "1.9.0" serialization = "1.9.0"
[libraries] [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" } 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" } slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }

View file

@ -13,6 +13,7 @@ group = "org.example"
version = "0.1.0" version = "0.1.0"
dependencies { dependencies {
implementation(dependencies.platform(libs.ktor.bom))
implementation(libs.ktor.client.content.negotiation) implementation(libs.ktor.client.content.negotiation)
implementation(libs.ktor.serialization.kotlinx.json) implementation(libs.ktor.serialization.kotlinx.json)
implementation(libs.mcp.kotlin.server) implementation(libs.mcp.kotlin.server)

View file

@ -12,9 +12,10 @@ slf4j = "2.0.17"
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging-jvm", version.ref = "logging" } 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-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" } 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-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" }
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" } ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio" }
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json-jvm", version.ref = "ktor" } 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" } 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-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" } mcp-kotlin-server = { group = "io.modelcontextprotocol", name = "kotlin-sdk-server", version.ref = "mcp-kotlin" }