- Kotlin 98%
- TypeScript 1.7%
- Shell 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps `kotest` from 6.0.7 to 6.1.1. Updates `io.kotest:kotest-assertions-core` from 6.0.7 to 6.1.1 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/kotest/kotest/releases">io.kotest:kotest-assertions-core's releases</a>.</em></p> <blockquote> <h2>v6.1.1</h2> <h2>What's Changed</h2> <ul> <li>Simpify engine implementation and mark EngineContext fully internal by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5585">kotest/kotest#5585</a></li> <li>Remove use of coroutineContext as per intellij recommendations by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5586">kotest/kotest#5586</a></li> <li>Bump Ktor to 3.3.3 and remove unused <code>ktor-server-core</code> dependency. by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5587">kotest/kotest#5587</a></li> <li>re-add koin and fix current docs version by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5590">kotest/kotest#5590</a></li> <li>DOC - add koin to 6.1 - create next of 6.2 by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5591">kotest/kotest#5591</a></li> <li>Remove ExperimentalKotest from test execution mode by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5596">kotest/kotest#5596</a></li> <li>Add MatcherResultBuilder for third parties to integrate matchers by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5594">kotest/kotest#5594</a></li> <li>Add action-junit-report to PRs by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5593">kotest/kotest#5593</a></li> <li>Restore JS tests module by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5597">kotest/kotest#5597</a></li> <li>Fix xmethod focus using DSL by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5588">kotest/kotest#5588</a></li> <li>Fix Test Execution fails when gradle configuration cache is enabled by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5603">kotest/kotest#5603</a></li> <li>Update KSP generation to skip private classes by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5604">kotest/kotest#5604</a></li> <li>reintroduce string spec tests with config to be root tests by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5608">kotest/kotest#5608</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/kotest/kotest/compare/v6.1.0...v6.1.1">https://github.com/kotest/kotest/compare/v6.1.0...v6.1.1</a></p> <h2>v6.1.0</h2> <p>The first Kotest release of 2026 is here - <strong>6.1 'Bouncing Boimler'</strong></p> <ul> <li>Compatible with Kotlin 2.0, 2.1, 2.2 and 2.3</li> <li>Enhanced data-testing with new syntax that <a href="https://kotest.io/docs/next/framework/datatesting/data-driven-testing.html#withxxx-variants">mirrors the spec style</a> to enable more intuitive tests. This also gives you control over how data tests interact with test lifecycle callbacks!</li> <li>Much improved IDE plugin support including running individual tests for native targets and fixes for many long standing issues. Re-run tests and jump to source for all nested tests in JVM mode</li> <li>The test framework has been updated with <a href="https://jasmine.github.io/api/3.0/global.html#fdescribe">Jasmine</a> style <a href="https://kotest.io/docs/next/framework/conditional/conditional-tests-with-x-methods.html">f-focused syntax</a> to mirror the x-disabled syntax.</li> <li>Support for JUnit 6 via the new kotest-runner-junit6 module.</li> <li>The popular <a href="https://kotest.io/docs/extensions/test_containers.html">TestContainers</a> extension has been updated to support Docker <a href="https://java.testcontainers.org/modules/docker_compose/">ComposeContainers</a>. Also now with an option to <a href="https://kotest.io/docs/next/extensions/test_containers.html#container-logs">pipe the container logs</a> directly into the test output for easier debugging!</li> <li>Full support for the Gradle <a href="https://github.com/gradle/test-retry-gradle-plugin">test-retry plugin</a>.</li> <li>Many improvements and bug fixes to our assertions library including support for <a href="https://kotest.io/docs/next/assertions/shouldbe.html">custom equality</a> in shouldBe assertions</li> <li>New assertions added such as shouldBeAtMost(x) and shouldBeAtLeast(y) for primitives. <em>A reminder that assertions don't require the Kotest test framework. They are still the best Kotlin assertions library, in our opinion, even if you are using JUnit or another test framework.</em></li> <li>Recreate race conditions easily using our <a href="https://kotest.io/docs/next/framework/race_conditions.html">parallel runner</a>.</li> <li>Various property test improvements such as new Arb types for arrays and support for specifying Arb collection sizes globally. <em>Just like assertions, the property testing library doesn't require the Kotest test framework.</em></li> </ul> <h2>What's Changed</h2> <ul> <li>Removing deprecated EqualityMatcherResult by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5239">kotest/kotest#5239</a></li> <li>Migrate to Test Containers version 2 by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5240">kotest/kotest#5240</a></li> <li>Add specific JUnit 6 runner by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5230">kotest/kotest#5230</a></li> <li>Makes <code>beBoolean</code> matcher public by <a href="https://github.com/LeoColman"><code>@LeoColman</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5241">kotest/kotest#5241</a></li> <li>update kdoc for ComposeContainerProjectExtension by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5247">kotest/kotest#5247</a></li> <li>Fix compatibility note for shouldThrowSoftly by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5250">kotest/kotest#5250</a></li> <li>support-nullable-primitive-arrays in Arb by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5249">kotest/kotest#5249</a></li> <li>Clarify assertions in core.md documentation by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5253">kotest/kotest#5253</a></li> <li>Add additional blog links to documentation by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5254">kotest/kotest#5254</a></li> <li>docs: fix typo in property test shrinking documentation by <a href="https://github.com/jongheon1"><code>@jongheon1</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5256">kotest/kotest#5256</a></li> <li>Bump <code>kotlin-compile-testing</code> to version 0.11.0 in <code>libs.versions.toml</code>. by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5251">kotest/kotest#5251</a></li> <li>Added backwards compatible methods for nondeterministic testing by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5258">kotest/kotest#5258</a></li> <li>Fix config being loaded twice by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5259">kotest/kotest#5259</a></li> <li>Add <code>shouldContainAllInAnyOrder</code> matchers for collections by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5228">kotest/kotest#5228</a></li> <li>make containAllInAnyOrder ignore elements not in expected (<a href="https://redirect.github.com/kotest/kotest/issues/5264">#5264</a>) by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5265">kotest/kotest#5265</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
| .github | ||
| .idea | ||
| buildSrc | ||
| conformance-test | ||
| docs | ||
| gradle | ||
| integration-test | ||
| kotlin-sdk | ||
| kotlin-sdk-client | ||
| kotlin-sdk-core | ||
| kotlin-sdk-server | ||
| samples | ||
| test-utils | ||
| .editorconfig | ||
| .gitignore | ||
| AGENTS.md | ||
| build.gradle.kts | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| detekt.yml | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| README.md | ||
| settings.gradle.kts | ||
MCP Kotlin SDK
Kotlin Multiplatform implementation of the Model Context Protocol (MCP), providing both client and server capabilities for integrating with LLM surfaces across various platforms.
Overview
The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This SDK implements the MCP specification for Kotlin, enabling you to build applications that can communicate using MCP on the JVM, WebAssembly and iOS.
- Build MCP clients that can connect to any MCP server
- Create MCP servers that expose resources, prompts and tools
- Use standard transports like stdio, SSE, and WebSocket
- Handle all MCP protocol messages and lifecycle events
Samples
- kotlin-mcp-server: demonstrates a multiplatform (JVM, Wasm) MCP server setup with various features and transports.
- weather-stdio-server: shows how to build a Kotlin MCP server providing weather forecast and alerts using STDIO transport.
- kotlin-mcp-client: demonstrates building an interactive Kotlin MCP client that connects to an MCP server via STDIO and integrates with Anthropic’s API.
Installation
Add the new repository to your build file:
repositories {
mavenCentral()
}
Add the dependency:
dependencies {
// See the badge above for the latest version
implementation("io.modelcontextprotocol:kotlin-sdk:$mcpVersion")
}
MCP SDK uses Ktor, but does not come with a specific engine dependency. You should add Ktor client and/or Ktor server dependency to your project yourself, e.g.:
dependencies {
// for client:
implementation("io.ktor:ktor-client-cio:$ktorVersion")
// for server:
implementation("io.ktor:ktor-server-netty:$ktorVersion")
}
Quick Start
Creating a Client
import io.modelcontextprotocol.kotlin.sdk.client.Client
import io.modelcontextprotocol.kotlin.sdk.client.StdioClientTransport
import io.modelcontextprotocol.kotlin.sdk.Implementation
val client = Client(
clientInfo = Implementation(
name = "example-client",
version = "1.0.0"
)
)
val transport = StdioClientTransport(
inputStream = processInputStream,
outputStream = processOutputStream
)
// Connect to server
client.connect(transport)
// List available resources
val resources = client.listResources()
// Read a specific resource
val resourceContent = client.readResource(
ReadResourceRequest(uri = "file:///example.txt")
)
Creating a Server
import io.modelcontextprotocol.kotlin.sdk.server.Server
import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions
import io.modelcontextprotocol.kotlin.sdk.server.StdioServerTransport
import io.modelcontextprotocol.kotlin.sdk.ServerCapabilities
val server = Server(
serverInfo = Implementation(
name = "example-server",
version = "1.0.0"
),
options = ServerOptions(
capabilities = ServerCapabilities(
resources = ServerCapabilities.Resources(
subscribe = true,
listChanged = true
)
)
)
){
"This server provides example resources and demonstrates MCP capabilities."
}
// Add a resource
server.addResource(
uri = "file:///example.txt",
name = "Example Resource",
description = "An example text file",
mimeType = "text/plain"
) { request ->
ReadResourceResult(
contents = listOf(
TextResourceContents(
text = "This is the content of the example resource.",
uri = request.uri,
mimeType = "text/plain"
)
)
)
}
// Start server with stdio transport
val transport = StdioServerTransport()
server.connect(transport)
Using SSE Transport
Directly in Ktor's Application:
import io.ktor.server.application.*
import io.modelcontextprotocol.kotlin.sdk.server.mcp
fun Application.module() {
mcp {
Server(
serverInfo = Implementation(
name = "example-sse-server",
version = "1.0.0"
),
options = ServerOptions(
capabilities = ServerCapabilities(
prompts = ServerCapabilities.Prompts(listChanged = null),
resources = ServerCapabilities.Resources(subscribe = null, listChanged = null)
)
),
) {
"This SSE server provides prompts and resources via Server-Sent Events."
}
}
}
Inside a custom Ktor's Route:
import io.ktor.server.application.*
import io.ktor.server.sse.SSE
import io.modelcontextprotocol.kotlin.sdk.server.mcp
fun Application.module() {
install(SSE)
routing {
route("myRoute") {
mcp {
Server(
serverInfo = Implementation(
name = "example-sse-server",
version = "1.0.0"
),
options = ServerOptions(
capabilities = ServerCapabilities(
prompts = ServerCapabilities.Prompts(listChanged = null),
resources = ServerCapabilities.Resources(subscribe = null, listChanged = null)
)
),
) {
"Connect via SSE to interact with this MCP server."
}
}
}
}
}
Contributing
Please see the contribution guide and the Code of conduct before contributing.
License
This project is licensed under Apache 2.0 for new contributions, with existing code under MIT—see the LICENSE file for details.