Adds a comprehensive conformance test suite for the Kotlin MCP SDK, covering core protocol operations, tool calls, elicitation, resources, prompts, and 20 OAuth/auth scenarios - Conformance server and client implementations - OAuth/auth test scenarios: JWT, authorization code flow, client credentials, PKCE, scope handling, cross-app access, client registration - CI workflow - Baseline file for tracking expected failures - Shell script fixes: - #592 - #593 - #596 ## Remaining known failures (tracked issues, will be fixed directly in `main`) - [x] `tools-call-with-logging`, `tools-call-with-progress`, `tools-call-sampling`, `tools-call-elicitation`, `elicitation-sep1034-defaults`- see #599, - [x] `elicitation-sep1330-enums` - #587 #600 - [x] `initialize` - #588 - [x] `tools_call`, `auth/scope-step-up`, `auth/scope-retry-limit` - #589 - [ ] `elicitation-sep1034-client-defaults` - #414 - [x] `sse-retry` - #590 - [ ] `resources-templates-read` - #591 ## Breaking Changes from #596 - `StreamableHttpClientTransport` and `mcpStreamableHttp`/`mcpStreamableHttpTransport`: old constructors accepting `Duration` timeout are now `@Deprecated` — use the new overloads with `ReconnectionOptions` instead - `StreamableHttpClientTransport.close()` no longer calls `terminateSession()` automatically ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [x] 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 - [x] I have added appropriate error handling - [x] I have added or updated documentation as needed --------- Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
This commit is contained in:
parent
338f94804f
commit
e88b34170c
1 changed files with 3186 additions and 1122 deletions
|
|
@ -1,39 +1,34 @@
|
|||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
application
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("io.modelcontextprotocol.kotlin.sdk.conformance.ConformanceServerKt")
|
||||
}
|
||||
|
||||
tasks.register<CreateStartScripts>("conformanceClientScripts") {
|
||||
mainClass.set("io.modelcontextprotocol.kotlin.sdk.conformance.ConformanceClientKt")
|
||||
applicationName = "conformance-client"
|
||||
outputDir = tasks.named<CreateStartScripts>("startScripts").get().outputDir
|
||||
classpath = tasks.named<Jar>("jar").get().outputs.files + configurations.named("runtimeClasspath").get()
|
||||
}
|
||||
|
||||
tasks.named("installDist") {
|
||||
dependsOn("conformanceClientScripts")
|
||||
}
|
||||
|
||||
tasks.named<Delete>("clean") {
|
||||
delete("results")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(project(":kotlin-sdk"))
|
||||
testImplementation(project(":test-utils"))
|
||||
testImplementation(kotlin("test"))
|
||||
testImplementation(libs.kotlin.logging)
|
||||
testImplementation(libs.ktor.client.cio)
|
||||
testImplementation(libs.ktor.server.cio)
|
||||
testImplementation(libs.ktor.server.websockets)
|
||||
testRuntimeOnly(libs.slf4j.simple)
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
|
||||
testLogging {
|
||||
events("passed", "skipped", "failed")
|
||||
showStandardStreams = true
|
||||
showExceptions = true
|
||||
showCauses = true
|
||||
showStackTraces = true
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
}
|
||||
|
||||
doFirst {
|
||||
systemProperty("test.classpath", classpath.asPath)
|
||||
|
||||
println("\n" + "=".repeat(60))
|
||||
println("MCP CONFORMANCE TESTS")
|
||||
println("=".repeat(60))
|
||||
println("These tests validate compliance with the MCP specification.")
|
||||
println("=".repeat(60) + "\n")
|
||||
}
|
||||
implementation(project(":kotlin-sdk"))
|
||||
implementation(libs.ktor.server.cio)
|
||||
implementation(libs.ktor.server.content.negotiation)
|
||||
implementation(libs.ktor.serialization)
|
||||
implementation(libs.ktor.client.cio)
|
||||
implementation(libs.ktor.client.auth)
|
||||
implementation(libs.kotlin.logging)
|
||||
runtimeOnly(libs.slf4j.simple)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue