From 8f180bcb3755557ac1789f884f546f2a0c8dfda0 Mon Sep 17 00:00:00 2001 From: Daniel Peng Date: Thu, 20 Aug 2026 08:38:13 +0800 Subject: [PATCH] Add Kotlin SDK BOM (#351) --- README.md | 12 ++++++++++++ kotlin-sdk-bom/build.gradle.kts | 12 ++++++++++++ settings.gradle.kts | 1 + 3 files changed, 25 insertions(+) create mode 100644 kotlin-sdk-bom/build.gradle.kts diff --git a/README.md b/README.md index aefadcf6a..98e9d3d3c 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ This Kotlin SDK implements the MCP specification, making it easy to: ### Artifacts - `io.modelcontextprotocol:kotlin-sdk` – umbrella SDK (client + server APIs) +- `io.modelcontextprotocol:kotlin-sdk-bom` – version alignment for the core, client, and server artifacts - `io.modelcontextprotocol:kotlin-sdk-client` – client-only APIs - `io.modelcontextprotocol:kotlin-sdk-server` – server-only APIs @@ -99,6 +100,17 @@ dependencies { } ``` +To keep the core, client, and server artifacts on the same version, import the BOM and omit versions from the +individual SDK dependencies: + +```kotlin +dependencies { + implementation(platform("io.modelcontextprotocol:kotlin-sdk-bom:$mcpVersion")) + implementation("io.modelcontextprotocol:kotlin-sdk-client") + implementation("io.modelcontextprotocol:kotlin-sdk-server") +} +``` + ### Multiplatform In a Kotlin Multiplatform project you can add the SDK to commonMain: diff --git a/kotlin-sdk-bom/build.gradle.kts b/kotlin-sdk-bom/build.gradle.kts new file mode 100644 index 000000000..f9c137247 --- /dev/null +++ b/kotlin-sdk-bom/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + `java-platform` + id("mcp.publishing") +} + +dependencies { + constraints { + api(project(":kotlin-sdk-core")) + api(project(":kotlin-sdk-client")) + api(project(":kotlin-sdk-server")) + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 60e3d1cd3..51581c889 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,6 +22,7 @@ include( ":kotlin-sdk-core", ":kotlin-sdk-client", ":kotlin-sdk-server", + ":kotlin-sdk-bom", ":kotlin-sdk-testing", ":kotlin-sdk", ":integration-test",