Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ See [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/

* To build MCP Kotlin SDK, JDK version 21 or higher is required. Make sure this is your default JDK (`JAVA_HOME` is set
accordingly)
* To build for MacOS/iOS targets, Xcode/Command Line Tools should be installed. See Apple Developer [documentation](https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components) for details.
* To build JS/Wasm targets, [Node.js](https://nodejs.org/) must be installed.
* The project can be opened in IntelliJ IDEA without additional prerequisites.

### Building MCP Kotlin SDK from source
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# MCP Kotlin SDK

[![Kotlin](https://img.shields.io/badge/kotlin-2.1-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin Multiplatform](https://img.shields.io/badge/Kotlin-Multiplatform-blueviolet?logo=kotlin)](https://kotlinlang.org/docs/multiplatform.html)
[![Platforms](https://img.shields.io/badge/Platforms-JVM%20%7C%20Wasm%2FJS%20%7C%20Native%20(iOS%2FiOS%20Simulator)-blue)](https://kotlinlang.org/docs/multiplatform.html)
[![Platforms](https://img.shields.io/badge/Platforms-JVM%20%7C%20Wasm%2FJS%20%7C%20Native-blue)](https://kotlinlang.org/docs/multiplatform.html)
[![Maven Central](https://img.shields.io/maven-central/v/io.modelcontextprotocol/kotlin-sdk.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:io.modelcontextprotocol%20a:kotlin-sdk)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Expand Down
31 changes: 27 additions & 4 deletions buildSrc/src/main/kotlin/mcp.multiplatform.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1

plugins {
kotlin("multiplatform")
Expand All @@ -24,18 +25,40 @@ val generateLibVersion by tasks.registering {

public const val LIB_VERSION: String = "${project.version}"

""".trimIndent()
""".trimIndent(),
)
}
}

kotlin {

compilerOptions {
languageVersion = KOTLIN_2_1
apiVersion = KOTLIN_2_1
// TODO: allWarningsAsErrors = true
extraWarnings = true
freeCompilerArgs =
listOf(
"-Xwhen-guards",
)
}
coreLibrariesVersion = "2.1.21"

jvm {
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
javaParameters = true
}
}
macosX64(); macosArm64()
linuxX64(); linuxArm64()

macosX64()
macosArm64()

linuxX64()
linuxArm64()

mingwX64()

js { nodejs() }
wasmJs { nodejs() }

Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
# Kotlin
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx4G
kotlin.native.ignoreDisabledTargets=true
# MPP
kotlin.mpp.enableCInteropCommonization=true

# Build JS targets using npm package manager https://kotlinlang.org/docs/js-project-setup.html#npm-dependencies
kotlin.js.yarn=false
23 changes: 13 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[versions]
# plugins version
kotlin = "2.2.0"
kotlin = "2.1.21"
dokka = "2.0.0"
atomicfu = "0.29.0"
atomicfu = "0.28.0"
ktlint = "13.0.0"

# libraries version
serialization = "1.9.0"
binaryCompatibilityValidatorPlugin = "0.18.1"
collections-immutable = "0.4.0"
coroutines = "1.10.2"
kotlinx-io = "0.8.0"
jreleaser = "1.19.0"
kotest = "5.9.1"
kotlinx-datetime = "0.6.2"
kotlinx-io = "0.7.0"
ktor = "3.2.3"
logging = "7.0.7"
jreleaser = "1.19.0"
binaryCompatibilityValidatorPlugin = "0.18.1"
serialization = "1.8.1"
slf4j = "2.0.17"
kotest = "5.9.1"

# Samples
mcp-kotlin = "0.6.0"
Expand All @@ -31,11 +32,13 @@ dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref
jreleaser-gradle = { module = "org.jreleaser:jreleaser-gradle-plugin", version.ref = "jreleaser" }

# 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-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
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-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
Expand Down
Loading
Loading