Skip to content

Commit 0666928

Browse files
authored
Merge branch 'main' into skarpov/workflow
2 parents ed40f3b + dcb4f21 commit 0666928

File tree

79 files changed

+3860
-2516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3860
-2516
lines changed

.github/workflows/apidocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
cache: gradle
3434

3535
- name: Setup Gradle
36-
uses: gradle/actions/setup-gradle@v4
36+
uses: gradle/actions/setup-gradle@v5
3737

3838
- name: Generate Dokka Site
3939
run: |-

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
distribution: 'temurin'
4444

4545
- name: Setup Gradle
46-
uses: gradle/actions/setup-gradle@v4
46+
uses: gradle/actions/setup-gradle@v5
4747
with:
4848
add-job-summary: 'always'
4949
cache-read-only: true

.github/workflows/gradle-publish.yml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,18 @@ jobs:
3131
distribution: 'temurin'
3232

3333
- name: Setup Gradle
34-
uses: gradle/actions/setup-gradle@v4
35-
36-
- name: Verify publication configuration
37-
run: ./gradlew jreleaserConfig
38-
env:
39-
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
40-
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
41-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
42-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
43-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
44-
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
uses: gradle/actions/setup-gradle@v5
4535

4636
- name: Clean Build with Gradle
4737
run: ./gradlew clean build
48-
env:
49-
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
50-
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
51-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
52-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
53-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
54-
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
55-
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
5638

5739
- name: Publish to Maven Central Portal
5840
id: publish
59-
run: ./gradlew publish jreleaserFullRelease --info --stacktrace -Djreleaser.verbose=true
41+
run: ./gradlew publishToMavenCentral --no-configuration-cache
6042
env:
61-
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
62-
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
63-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
64-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
65-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
66-
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
44+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_TOKEN }}
45+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
46+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSPHRASE }}
6747
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
6848
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ val server = Server(
112112
)
113113
)
114114
)
115-
)
115+
){
116+
"This server provides example resources and demonstrates MCP capabilities."
117+
}
116118

117119
// Add a resource
118120
server.addResource(
@@ -156,8 +158,10 @@ fun Application.module() {
156158
prompts = ServerCapabilities.Prompts(listChanged = null),
157159
resources = ServerCapabilities.Resources(subscribe = null, listChanged = null)
158160
)
159-
)
160-
)
161+
),
162+
) {
163+
"This SSE server provides prompts and resources via Server-Sent Events."
164+
}
161165
}
162166
}
163167
```
@@ -184,8 +188,10 @@ fun Application.module() {
184188
prompts = ServerCapabilities.Prompts(listChanged = null),
185189
resources = ServerCapabilities.Resources(subscribe = null, listChanged = null)
186190
)
187-
)
188-
)
191+
),
192+
) {
193+
"Connect via SSE to interact with this MCP server."
194+
}
189195
}
190196
}
191197
}

build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
allprojects {
88
group = "io.modelcontextprotocol"
9-
version = "0.7.1"
9+
version = "0.7.2"
1010
}
1111

1212
dependencies {
@@ -33,10 +33,18 @@ dokka {
3333
}
3434
}
3535

36+
ktlint {
37+
filter {
38+
exclude("**/generated*/**")
39+
}
40+
}
41+
3642
kover {
3743
reports {
3844
filters {
3945
includes.classes("io.modelcontextprotocol.kotlin.sdk.*")
46+
excludes.classes("io.modelcontextprotocol.kotlin.sdk.models.*") // temporary
47+
excludes.classes("io.modelcontextprotocol.kotlin.sdk.models.infrastructure.*") // generated
4048
}
4149
total {
4250
log {

buildSrc/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ dependencies {
1212
implementation(libs.kotlin.serialization)
1313
implementation(libs.kotlinx.atomicfu.gradle)
1414
implementation(libs.dokka.gradle)
15-
implementation(libs.jreleaser.gradle)
16-
}
15+
implementation(libs.maven.publish)
16+
}

buildSrc/src/main/kotlin/mcp.jreleaser.gradle.kts

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,60 @@
1+
import com.vanniktech.maven.publish.MavenPublishBaseExtension
2+
13
plugins {
24
`maven-publish`
5+
id("com.vanniktech.maven.publish")
36
signing
47
}
58

6-
val javadocJar by tasks.registering(Jar::class) {
7-
archiveClassifier.set("javadoc")
8-
}
9-
10-
publishing {
11-
publications.withType<MavenPublication>().configureEach {
12-
if (name.contains("jvm", ignoreCase = true)) {
13-
artifact(javadocJar)
14-
}
9+
mavenPublishing {
10+
publishToMavenCentral(automaticRelease = true)
11+
configureSigning(this)
1512

16-
pom {
17-
name = project.name
18-
description = "Kotlin implementation of the Model Context Protocol (MCP)"
19-
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
20-
21-
licenses {
22-
license {
23-
name = "MIT License"
24-
url = "https://github.com/modelcontextprotocol/kotlin-sdk/blob/main/LICENSE"
25-
distribution = "repo"
26-
}
27-
}
13+
pom {
14+
name = project.name
15+
description = "Kotlin implementation of the Model Context Protocol (MCP)"
16+
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
2817

29-
organization {
30-
name = "Anthropic"
31-
url = "https://www.anthropic.com"
18+
licenses {
19+
license {
20+
name = "MIT License"
21+
url = "https://github.com/modelcontextprotocol/kotlin-sdk/blob/main/LICENSE"
22+
distribution = "repo"
3223
}
24+
}
3325

34-
developers {
35-
developer {
36-
id = "JetBrains"
37-
name = "JetBrains Team"
38-
organization = "JetBrains"
39-
organizationUrl = "https://www.jetbrains.com"
40-
}
41-
}
26+
organization {
27+
name = "Anthropic"
28+
url = "https://www.anthropic.com"
29+
}
4230

43-
scm {
44-
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
45-
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
46-
developerConnection = "scm:git:[email protected]:modelcontextprotocol/kotlin-sdk.git"
31+
developers {
32+
developer {
33+
id = "JetBrains"
34+
name = "JetBrains Team"
35+
organization = "JetBrains"
36+
organizationUrl = "https://www.jetbrains.com"
4737
}
4838
}
49-
}
5039

51-
repositories {
52-
maven {
53-
name = "staging"
54-
url = uri(layout.buildDirectory.dir("staging-deploy"))
40+
scm {
41+
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
42+
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
43+
developerConnection = "scm:git:[email protected]:modelcontextprotocol/kotlin-sdk.git"
5544
}
5645
}
5746
}
5847

59-
signing {
60-
val gpgKeyName = "GPG_SIGNING_KEY"
48+
private fun Project.configureSigning(mavenPublishing: MavenPublishBaseExtension) {
49+
val gpgKeyName = "GPG_SECRET_KEY"
6150
val gpgPassphraseName = "SIGNING_PASSPHRASE"
6251
val signingKey = providers.environmentVariable(gpgKeyName)
6352
.orElse(providers.gradleProperty(gpgKeyName))
6453
val signingPassphrase = providers.environmentVariable(gpgPassphraseName)
6554
.orElse(providers.gradleProperty(gpgPassphraseName))
6655

6756
if (signingKey.isPresent) {
68-
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
69-
sign(publishing.publications)
57+
mavenPublishing.signAllPublications()
58+
signing.useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
7059
}
71-
}
60+
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
77
# Kotlin
88
kotlin.code.style=official
99
kotlin.daemon.jvmargs=-Xmx4G
10+
# Build JS targets using npm package manager https://kotlinlang.org/docs/js-project-setup.html#npm-dependencies
11+
kotlin.js.yarn=false
1012
# MPP
1113
kotlin.mpp.enableCInteropCommonization=true
1214
kotlin.native.ignoreDisabledTargets=true

gradle/libs.versions.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ kotlin = "2.2.10"
44
dokka = "2.0.0"
55
atomicfu = "0.29.0"
66
ktlint = "13.1.0"
7-
kover = "0.9.1"
7+
kover = "0.9.2"
8+
mavenPublish = "0.34.0"
9+
binaryCompatibilityValidatorPlugin = "0.18.1"
810

911
# libraries version
1012
serialization = "1.9.0"
@@ -13,14 +15,12 @@ coroutines = "1.10.2"
1315
kotlinx-io = "0.8.0"
1416
ktor = "3.3.0"
1517
logging = "7.0.13"
16-
jreleaser = "1.19.0"
17-
binaryCompatibilityValidatorPlugin = "0.18.1"
1818
slf4j = "2.0.17"
19-
kotest = "5.9.1"
19+
kotest = "6.0.3"
2020
awaitility = "4.3.0"
2121

2222
# Samples
23-
mcp-kotlin = "0.7.1"
23+
mcp-kotlin = "0.7.2"
2424
anthropic = "2.7.0"
2525
shadow = "8.1.1"
2626

@@ -30,7 +30,7 @@ kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.
3030
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
3131
kotlinx-atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }
3232
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
33-
jreleaser-gradle = { module = "org.jreleaser:jreleaser-gradle-plugin", version.ref = "jreleaser" }
33+
maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "mavenPublish" }
3434

3535
# Kotlinx libraries
3636
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
@@ -48,6 +48,7 @@ ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref =
4848

4949
# Testing
5050
awaitility = { group = "org.awaitility", name = "awaitility-kotlin", version.ref = "awaitility" }
51+
kotest-assertions-core = { group = "io.kotest", name = "kotest-assertions-core", version.ref = "kotest" }
5152
kotest-assertions-json = { group = "io.kotest", name = "kotest-assertions-json", version.ref = "kotest" }
5253
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
5354
ktor-client-mock = { group = "io.ktor", name = "ktor-client-mock", version.ref = "ktor" }
@@ -57,7 +58,8 @@ slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4
5758
# Samples
5859
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
5960
ktor-server-cio = { group = "io.ktor", name = "ktor-server-cio", version.ref = "ktor" }
60-
mcp-kotlin = { group = "io.modelcontextprotocol", name = "kotlin-sdk", version.ref = "mcp-kotlin" }
61+
mcp-kotlin-client = { group = "io.modelcontextprotocol", name = "kotlin-sdk-client", version.ref = "mcp-kotlin" }
62+
mcp-kotlin-server = { group = "io.modelcontextprotocol", name = "kotlin-sdk-server", version.ref = "mcp-kotlin" }
6163
anthropic-java = { group = "com.anthropic", name = "anthropic-java", version.ref = "anthropic" }
6264
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
6365
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }

0 commit comments

Comments
 (0)