| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps [io.modelcontextprotocol:kotlin-sdk-client](https://github.com/modelcontextprotocol/kotlin-sdk) from 0.12.0 to 0.13.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/modelcontextprotocol/kotlin-sdk/releases">io.modelcontextprotocol:kotlin-sdk-client's releases</a>.</em></p> <blockquote> <h2>0.13.0</h2> <h2>Description</h2> <p>Adds a <code>tasks</code> capability and a typed <code>elicitation</code> capability, hardens transport lifecycle, dispatchers, and back-pressure, and enables DNS rebinding protection by default.</p> <h3>Breaking Changes</h3> <p><strong>Typed <code>elicitation</code> capability and new <code>tasks</code> capability</strong> by <a href="https://github.com/devcrocod"><code>@devcrocod</code></a> in <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/pull/732">#732</a></p> <p><code>ClientCapabilities.elicitation</code> is now a typed <code>ClientCapabilities.Elicitation</code> (<code>form</code>, <code>url</code>) instead of a raw <code>JsonObject?</code>, and both <code>ClientCapabilities</code> and <code>ServerCapabilities</code> gained a typed <code>tasks</code> capability. The constructors of both types changed and are binary-incompatible; recompilation is required.</p> <p><strong>Transport handlers now run on <code>Dispatchers.Default</code></strong> by <a href="https://github.com/devcrocod"><code>@devcrocod</code></a> in <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/pull/778">#778</a></p> <p>Handlers moved from <code>Dispatchers.IO</code> to <code>Dispatchers.Default</code> (override via <code>handlerDispatcher</code>), <code>send()</code> now suspends under back-pressure instead of buffering unbounded, and the two-argument <code>StdioServerTransport(input, output)</code> constructor is deprecated in favor of the builder-lambda form. Also fixes a <code>start()</code>/<code>close()</code> race, consistent <code>CancellationException</code> propagation, and an input-<code>Source</code> leak (closes <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/573">#573</a>, <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/574">#574</a>, <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/708">#708</a>).</p> <p><strong>DNS rebinding protection enabled by default</strong> by <a href="https://github.com/devcrocod"><code>@devcrocod</code></a> in <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/pull/659">#659</a></p> <p><code>enableDnsRebindingProtection</code> now defaults to <code>true</code> on <code>mcpStreamableHttp</code>/<code>mcpStatelessStreamableHttp</code>, and the <code>Route.mcp()</code> / <code>Application.mcp()</code> overloads gained <code>enableDnsRebindingProtection</code>, <code>allowedHosts</code>, and <code>allowedOrigins</code> parameters (binary-incompatible on JVM). Only <code>localhost</code>, <code>127.0.0.1</code>, and <code>[::1]</code> are allowed by default; opt out with <code>enableDnsRebindingProtection = false</code>. The <code>Configuration.enableDnsRebindingProtection</code>, <code>.allowedHosts</code>, and <code>.allowedOrigins</code> properties are deprecated in favor of the new <code>DnsRebindingProtection</code> plugin.</p> <h3>Features</h3> <ul> <li>Add a <code>tasks</code> capability (<code>list</code>, <code>cancel</code>, and per-request augmentation for sampling and elicitation) on <code>ClientCapabilities</code> and <code>ServerCapabilities</code>, with assertions for <code>tasks/*</code> and <code>notifications/tasks/status</code> enforced by <code>Client</code> and <code>ServerSession</code> by <a href="https://github.com/devcrocod"><code>@devcrocod</code></a> in <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/pull/732">#732</a></li> <li>Configurable <code>handlerDispatcher</code> and <code>ioDispatcher</code>, plus an optional caller-supplied <code>CoroutineScope</code>, on transports by <a href="https://github.com/devcrocod"><code>@devcrocod</code></a> in <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/pull/778">#778</a></li> </ul> <h3>Fixed</h3> <ul> <li>Fire <code>onClose</code> callbacks on <code>SseClientTransport</code> when the SSE session ends — whether closed gracefully or terminated by an error — matching the other client transports by <a href="https://github.com/jskjw157"><code>@jskjw157</code></a> in <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/pull/738">#738</a></li> </ul> <h3>Security</h3> <ul> <li>Enable DNS rebinding protection by default across all HTTP transports, including the SSE endpoints that previously had none (see Breaking Changes for migration) by <a href="https://github.com/devcrocod"><code>@devcrocod</code></a> in <a href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/pull/659">#659</a></li> <li>Cap a single stdio JSON-RPC frame at 16 MiB, throwing the new <code>TooLongFrameException</code> instead of buffering unbounded when a peer never sends a newline terminator by <a href="https://github.com/devcrocod"><code>@devcrocod</code></a> in <a href=" |
||
| .. | ||
| kotlin-mcp-client | ||
| kotlin-mcp-server | ||
| kotlinlang-mcp-server | ||
| notebooks | ||
| simple-streamable-server | ||
| weather-stdio-server | ||
| README.md | ||
Kotlin MCP SDK Samples
Runnable projects demonstrating MCP server and client implementations with the Kotlin MCP SDK. For background on the protocol itself, see the MCP documentation.
Overview
| Sample | Type | Transport | MCP Features |
|---|---|---|---|
| simple-streamable-server | Server | Streamable HTTP | Tools, Resources, Prompts, Logging |
| kotlinlang-mcp-server | Server | Streamable HTTP | Tools |
| kotlin-mcp-server | Server | STDIO, SSE | Tools, Resources, Prompts |
| weather-stdio-server | Server | STDIO | Tools |
| kotlin-mcp-client | Client | STDIO | Tool discovery & invocation |
| notebooks | Client (Notebook) | Streamable HTTP | Tool discovery & invocation |
Getting Started
- Building a server? Start with simple-streamable-server — it uses the recommended Streamable HTTP transport and covers tools, resources, prompts, and logging.
- Building a client? Open the notebooks sample for a step-by-step walkthrough, or see kotlin-mcp-client for a full CLI client with Anthropic API integration.
Samples
Simple Streamable HTTP Server
A minimal Streamable HTTP server with optional Bearer token authentication. Demonstrates tools
(greet, multi-greet), a prompt template, a resource, and server-to-client logging notifications.
Read more →
Kotlinlang MCP Server
A Streamable HTTP server that exposes the official Kotlin documentation (kotlinlang.org) to LLM clients — full-text search via Algolia and page retrieval in markdown. Demonstrates wrapping a real external API in an MCP server with in-memory caching. Read more →
Kotlin MCP Server
A multi-transport server supporting STDIO, SSE (plain), and SSE (Ktor plugin). Useful for exploring different transport modes side by side. Read more →
Weather STDIO Server
A focused STDIO server that exposes weather forecast and alert tools backed by the weather.gov API. Includes Claude Desktop integration instructions. Read more →
Kotlin MCP Client
An interactive CLI client that connects to any MCP server over STDIO and routes queries through Anthropic's Claude API, bridging MCP tools with LLM conversations. Read more →
MCP Client Notebook
A Kotlin notebook that connects to a remote MCP server via Streamable HTTP and demonstrates ping, tool listing, and tool invocation — all in an interactive cell-by-cell format. Read more →