Fix kotlin-mcp-server example and update samples (#345)

- updated the sdk version in all examples
- fixed `kotlin-mcp-server` example (#331)

## Motivation and Context
Removed the WASM example, as it duplicates the JVM example and only adds
unnecessary complexity

## How Has This Been Tested?
Locally

## Breaking Changes
No

## Types of changes
- [x] 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

## Checklist
- [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
- [ ] I have added appropriate error handling
- [x] I have added or updated documentation as needed
This commit is contained in:
Pavel Gorgulov 2025-10-31 12:21:46 +01:00 • committed by GitHub
commit 458a49a5fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,50 +1,26 @@
@file:OptIn(ExperimentalWasmDsl::class, ExperimentalKotlinGradlePluginApi::class)
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
application
}
group = "org.example"
version = "0.1.0"
val jvmMainClass = "Main_jvmKt"
application {
mainClass.set("io.modelcontextprotocol.sample.server.MainKt")
}
dependencies {
implementation(libs.mcp.kotlin.server)
implementation(libs.ktor.server.cio)
implementation(libs.slf4j.simple)
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
jvm {
binaries {
executable {
mainClass.set(jvmMainClass)
}
}
val jvmJar by tasks.getting(org.gradle.jvm.tasks.Jar::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
doFirst {
manifest {
attributes["Main-Class"] = jvmMainClass
}
from(configurations["jvmRuntimeClasspath"].map { if (it.isDirectory) it else zipTree(it) })
}
}
}
wasmJs {
nodejs()
binaries.executable()
}
sourceSets {
commonMain.dependencies {
implementation(libs.mcp.kotlin.server)
implementation(libs.ktor.server.cio)
}
jvmMain.dependencies {
implementation(libs.slf4j.simple)
}
wasmJsMain.dependencies {}
}
}