- Kotlin 98%
- TypeScript 1.7%
- Shell 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps `kotest` from 6.0.4 to 6.0.7. Updates `io.kotest:kotest-assertions-core` from 6.0.4 to 6.0.7 <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.0.7</h2> <h2>What's Changed</h2> <ul> <li>Update dependency com.google.jimfs:jimfs to v1.3.1 by <a href="https://github.com/renovate"><code>@renovate</code></a>[bot] in <a href="https://redirect.github.com/kotest/kotest/pull/5235">kotest/kotest#5235</a></li> <li>Update dependency io.github.pdvrieze.xmlutil:serialization to v0.91.3 by <a href="https://github.com/renovate"><code>@renovate</code></a>[bot] in <a href="https://redirect.github.com/kotest/kotest/pull/5236">kotest/kotest#5236</a></li> <li>Update dependency io.projectreactor.tools:blockhound to v1.0.15.RELEASE by <a href="https://github.com/renovate"><code>@renovate</code></a>[bot] in <a href="https://redirect.github.com/kotest/kotest/pull/5238">kotest/kotest#5238</a></li> <li>Update dependency io.mockk:mockk to v1.14.6 by <a href="https://github.com/renovate"><code>@renovate</code></a>[bot] in <a href="https://redirect.github.com/kotest/kotest/pull/5237">kotest/kotest#5237</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/kotest/kotest/compare/v6.0.6...v6.0.7">https://github.com/kotest/kotest/compare/v6.0.6...v6.0.7</a></p> <h2>v6.0.6</h2> <h2>What's Changed</h2> <ul> <li>Clarify mock features in Kotest documentation by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5205">kotest/kotest#5205</a></li> <li>Specific data test methods for various specs by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5144">kotest/kotest#5144</a></li> <li>Another example for race conditions - mocking LocalDateTime.now() by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5209">kotest/kotest#5209</a></li> <li>atMost-for-int (<a href="https://redirect.github.com/kotest/kotest/issues/5210">#5210</a>) by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5211">kotest/kotest#5211</a></li> <li>atMost-for-long (<a href="https://redirect.github.com/kotest/kotest/issues/5212">#5212</a>) by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5213">kotest/kotest#5213</a></li> <li>Update shouldBeOneOf assertion description by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5214">kotest/kotest#5214</a></li> <li>Clarify shouldContainAll assertion description by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5215">kotest/kotest#5215</a></li> <li>remove-code-duplication-in-GreaterThanOrEqual.kt by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5224">kotest/kotest#5224</a></li> <li>Update to Gradle 9.2.1 & remove some potentially old workarounds by <a href="https://github.com/nhajratw"><code>@nhajratw</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5176">kotest/kotest#5176</a></li> <li>more-info-for-oneOf by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5222">kotest/kotest#5222</a></li> <li>Remove all uses of deprecated ComparableMatcherResult by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5231">kotest/kotest#5231</a></li> <li>add-atLeast-atMost-for-BigDecimal by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5226">kotest/kotest#5226</a></li> <li>Add project config option for concurrency order by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5232">kotest/kotest#5232</a></li> <li>Reenable koin by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5233">kotest/kotest#5233</a></li> <li>Remove usage of toFile in path matchers by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5229">kotest/kotest#5229</a></li> <li>Avoid creating fresh root for the first test in <code>InstancePerLeaf</code> by <a href="https://github.com/T45K"><code>@T45K</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5201">kotest/kotest#5201</a></li> <li>Alex/arbs support arrays of primitives by <a href="https://github.com/AlexCue987"><code>@AlexCue987</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5220">kotest/kotest#5220</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/kotest/kotest/compare/v6.0.5...v6.0.6">https://github.com/kotest/kotest/compare/v6.0.5...v6.0.6</a></p> <h2>v6.0.5</h2> <h2>What's Changed</h2> <ul> <li>Fix: <code>InstancePerLeaf</code> tests fail when a test leaf has siblings by <a href="https://github.com/T45K"><code>@T45K</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5139">kotest/kotest#5139</a></li> <li>fix(arrow): collect clues on failures by <a href="https://github.com/RafeArnold"><code>@RafeArnold</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5140">kotest/kotest#5140</a></li> <li>add max timeout bounds to continually and retry by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5145">kotest/kotest#5145</a></li> <li>Move <code>spring.boot.starter.web</code> dependency from <code>jvmMain</code> to <code>jvmTest</code>. by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5146">kotest/kotest#5146</a></li> <li>Remove uuid usage to fix JS on certain version of node by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5150">kotest/kotest#5150</a></li> <li>Remove periods from test names only at TCSM stage by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5149">kotest/kotest#5149</a></li> <li>Fix wasmJS support for browser tests by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5148">kotest/kotest#5148</a></li> <li>Fix PR workflow for windows by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5151">kotest/kotest#5151</a></li> <li>Expand behavior spec tags to given and when by <a href="https://github.com/sksamuel"><code>@sksamuel</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5152">kotest/kotest#5152</a></li> <li>update to kotlin 2.2.20 by <a href="https://github.com/nhajratw"><code>@nhajratw</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5153">kotest/kotest#5153</a></li> <li>update to gradle 9.1.0 by <a href="https://github.com/nhajratw"><code>@nhajratw</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5158">kotest/kotest#5158</a></li> <li>docs: Update Maven links and badges in Extensions docs by <a href="https://github.com/noojung"><code>@noojung</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5173">kotest/kotest#5173</a></li> <li>allow to verify if json schema prop is null (addresses <a href="https://redirect.github.com/kotest/kotest/issues/5172">#5172</a>) by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5175">kotest/kotest#5175</a></li> <li>allow to verify if Boolean property in jsonSchema is true or false (addresses <a href="https://redirect.github.com/kotest/kotest/issues/5171">#5171</a>) by <a href="https://github.com/alfonsoristorato"><code>@alfonsoristorato</code></a> in <a href="https://redirect.github.com/kotest/kotest/pull/5174">kotest/kotest#5174</a></li> <li>fix(deps): update dependency com.zaxxer:hikaricp to v6.3.3 by <a href="https://github.com/renovate"><code>@renovate</code></a>[bot] in <a href="https://redirect.github.com/kotest/kotest/pull/5179">kotest/kotest#5179</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
| .github | ||
| buildSrc | ||
| conformance-test | ||
| docs | ||
| gradle | ||
| kotlin-sdk | ||
| kotlin-sdk-client | ||
| kotlin-sdk-core | ||
| kotlin-sdk-server | ||
| kotlin-sdk-test | ||
| samples | ||
| .editorconfig | ||
| .gitignore | ||
| AGENTS.md | ||
| build.gradle.kts | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| 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 the MIT License—see the LICENSE file for details.