Skip to content

Commit 935a1ed

Browse files
authored
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 -->
1 parent ab9ba54 commit 935a1ed

File tree

14 files changed

+38
-26
lines changed

14 files changed

+38
-26
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ jobs:
4949
working-directory: ./samples/kotlin-mcp-client
5050
run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT
5151

52-
# - name: Build Kotlin-MCP-Server Sample
53-
# working-directory: ./samples/kotlin-mcp-server
54-
# run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT
52+
- name: Build Kotlin-MCP-Server Sample
53+
working-directory: ./samples/kotlin-mcp-server
54+
run: ./gradlew --no-daemon clean build -Pmcp.kotlin.overrideVersion=0.0.1-SNAPSHOT
5555

5656
- name: Build Weather-Stdio-Server Sample
5757
working-directory: ./samples/weather-stdio-server

.github/workflows/samples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
matrix:
2424
sample:
2525
- kotlin-mcp-client
26-
# - kotlin-mcp-server
26+
- kotlin-mcp-server
2727
- weather-stdio-server
2828

2929
name: Build Sample

gradle/libs.versions.toml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ kover = "0.9.3"
88
netty = "4.2.7.Final"
99
mavenPublish = "0.34.0"
1010
binaryCompatibilityValidatorPlugin = "0.18.1"
11+
openapi-generator = "7.17.0"
1112

1213
# libraries version
1314
serialization = "1.9.0"
@@ -23,45 +24,46 @@ mokksy = "0.6.1"
2324

2425
[libraries]
2526
# Plugins
27+
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
2628
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
2729
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
2830
kotlinx-atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }
29-
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
3031
maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "mavenPublish" }
3132

3233
# Kotlinx libraries
33-
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
34+
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version.ref = "logging" }
35+
kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "collections-immutable" }
3436
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
3537
kotlinx-coroutines-core-wasm = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core-wasm-js", version.ref = "coroutines" }
3638
kotlinx-io-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-io-core", version.ref = "kotlinx-io" }
37-
kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "collections-immutable" }
38-
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version.ref = "logging" }
39+
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
3940

4041
# Ktor
4142
ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" }
42-
ktor-client-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
43-
ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging"}
4443
ktor-client-apache5 = { group = "io.ktor", name = "ktor-client-apache5" }
45-
ktor-server-sse = { group = "io.ktor", name = "ktor-server-sse", version.ref = "ktor" }
46-
ktor-server-websockets = { group = "io.ktor", name = "ktor-server-websockets", version.ref = "ktor" }
47-
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" }
44+
ktor-client-core = { group = "io.ktor", name = "ktor-client-core" }
45+
ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging" }
46+
ktor-server-core = { group = "io.ktor", name = "ktor-server-core" }
47+
ktor-server-sse = { group = "io.ktor", name = "ktor-server-sse" }
48+
ktor-server-websockets = { group = "io.ktor", name = "ktor-server-websockets" }
4849

4950
# Testing
5051
awaitility = { group = "org.awaitility", name = "awaitility-kotlin", version.ref = "awaitility" }
5152
kotest-assertions-core = { group = "io.kotest", name = "kotest-assertions-core", version.ref = "kotest" }
5253
kotest-assertions-json = { group = "io.kotest", name = "kotest-assertions-json", version.ref = "kotest" }
5354
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
54-
ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock", version.ref = "ktor" }
55-
ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host", version.ref = "ktor" }
55+
ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock" }
56+
ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host" }
5657
mokksy = { group = "dev.mokksy", name = "mokksy", version.ref = "mokksy" }
57-
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
5858
netty-bom = { group = "io.netty", name = "netty-bom", version.ref = "netty" }
59+
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
5960

6061
# Samples
61-
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
62-
ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio", version.ref = "ktor" }
62+
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio" }
63+
ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio" }
6364

6465
[plugins]
6566
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidatorPlugin" }
66-
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
6767
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
68+
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
69+
openapi-generator = { id = "org.openapi.generator", version.ref = "openapi-generator" }

kotlin-sdk-client/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ kotlin {
3232
sourceSets {
3333
commonMain {
3434
dependencies {
35+
implementation(dependencies.platform(libs.ktor.bom))
3536
api(project(":kotlin-sdk-core"))
3637
api(libs.ktor.client.core)
3738
implementation(libs.kotlin.logging)
@@ -41,7 +42,6 @@ kotlin {
4142
commonTest {
4243
dependencies {
4344
implementation(kotlin("test"))
44-
implementation(dependencies.platform(libs.ktor.bom))
4545
implementation(libs.ktor.client.mock)
4646
implementation(libs.ktor.server.websockets)
4747
implementation(libs.kotlinx.coroutines.test)

kotlin-sdk-core/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id("mcp.publishing")
88
id("mcp.dokka")
99
alias(libs.plugins.kotlinx.binary.compatibility.validator)
10-
id("org.openapi.generator") version "7.17.0"
10+
alias(libs.plugins.openapi.generator)
1111
}
1212

1313
/*
@@ -110,6 +110,7 @@ kotlin {
110110
commonMain {
111111
kotlin.srcDir(generateLibVersion)
112112
dependencies {
113+
implementation(dependencies.platform(libs.ktor.bom))
113114
api(libs.kotlinx.serialization.json)
114115
api(libs.kotlinx.coroutines.core)
115116
api(libs.kotlinx.io.core)

kotlin-sdk-server/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ kotlin {
99
sourceSets {
1010
commonMain {
1111
dependencies {
12+
implementation(dependencies.platform(libs.ktor.bom))
1213
api(project(":kotlin-sdk-core"))
1314
api(libs.ktor.server.core)
1415
api(libs.ktor.server.sse)

kotlin-sdk-test/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ kotlin {
1111
sourceSets {
1212
commonTest {
1313
dependencies {
14+
implementation(dependencies.platform(libs.ktor.bom))
1415
implementation(project(":kotlin-sdk"))
1516
implementation(kotlin("test"))
1617
implementation(libs.kotest.assertions.json)

kotlin-sdk/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ kotlin {
77
sourceSets {
88
commonMain {
99
dependencies {
10+
implementation(dependencies.platform(libs.ktor.bom))
1011
api(project(":kotlin-sdk-core"))
1112
api(project(":kotlin-sdk-client"))
1213
api(project(":kotlin-sdk-server"))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ group = "org.example"
1212
version = "0.1.0"
1313

1414
dependencies {
15+
implementation(dependencies.platform(libs.ktor.bom))
1516
implementation(libs.mcp.kotlin.client)
1617
implementation(libs.ktor.client.cio)
1718
implementation(libs.anthropic.java)

samples/kotlin-mcp-client/gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ slf4j = "2.0.17"
88

99
[libraries]
1010
anthropic-java = { group = "com.anthropic", name = "anthropic-java", version.ref = "anthropic" }
11-
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
11+
ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" }
12+
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio" }
1213
mcp-kotlin-client = { group = "io.modelcontextprotocol", name = "kotlin-sdk-client", version.ref = "mcp-kotlin" }
1314
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
1415

0 commit comments

Comments
 (0)