kotlin-sdk/samples/kotlin-mcp-server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dependabot[bot] 6e247f902d
chore(deps): bump mcp-kotlin from 0.9.0 to 0.10.0 in /samples/kotlin-mcp-server (#651)
Bumps `mcp-kotlin` from 0.9.0 to 0.10.0.
Updates `io.modelcontextprotocol:kotlin-sdk-client` from 0.9.0 to 0.10.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.10.0</h2>
<h2>Highlights</h2>
<p>This release adds MCP conformance testing infrastructure, SSE
reconnection support, Tasks protocol types, resource template matching,
and<br />
tool execution properties. It also completes a deprecation cycle —
removing all previously deprecated (error-level) symbols from
<code>io.modelcontextprotocol.kotlin.sdk</code> in favor of their
replacements in
<code>io.modelcontextprotocol.kotlin.sdk.types</code>.</p>
<h2>Breaking Changes</h2>
<ul>
<li><strong>Deprecation cycle completed</strong> — All symbols
deprecated at <code>ERROR</code> level in 0.9.0 have been removed by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/615">#615</a>).
This includes<br />
the entire <code>io.modelcontextprotocol.kotlin.sdk.types.kt</code>
compatibility file (type aliases such as <code>CallToolResult</code>,
<code>CancelledNotification</code>,
<code>ClientCapabilities</code>, <code>CompleteRequest</code>, etc.) and
the legacy <code>McpJson</code> in
<code>io.modelcontextprotocol.kotlin.sdk</code>. Migrate to the
equivalents
in <code>io.modelcontextprotocol.kotlin.sdk.types</code>.</li>
<li><strong>SSE/Streamable HTTP transport changes</strong> —
<code>StreamableHttpClientTransport</code> now accepts
<code>ReconnectionOptions</code> for configurable retry
behavior by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/585">#585</a>,
<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/596">#596</a>).
The previous constructor signatures remain available.</li>
</ul>
<h2>Features</h2>
<ul>
<li><strong>MCP conformance test infrastructure</strong> — Comprehensive
conformance test suite covering core protocol operations, tool calls,
elicitation,
resources, prompts, and 20 OAuth/auth scenarios. Includes CI workflow,
baseline tracking, and shell runner by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/585">#585</a>)</li>
<li><strong>SSE reconnection with retry support</strong> — Client
transports now support configurable reconnection with exponential
backoff via<br />
<code>ReconnectionOptions</code> (initial delay, max delay, multiplier,
max retries) by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/596">#596</a>)</li>
<li><strong>Tasks protocol types</strong> — Added <code>Task</code>,
<code>TaskStatus</code>, and related models per the MCP tasks
specification by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/566">#566</a>)</li>
<li><strong>Resource templates with basic template matcher</strong> —
Server-side support for URI template-based resource matching by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/502">#502</a>,
<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/606">#606</a>)</li>
<li><strong>Tool execution properties</strong> — <code>Tool</code> now
exposes execution properties for richer tool metadata by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/567">#567</a>)</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li><strong>Notifications not delivered over Streamable HTTP</strong> —
Fixed server-side notification delivery for Streamable HTTP transport
sessions by
<a href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/587">#587</a>,
<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/599">#599</a>)</li>
<li><strong>Conformance: SEP-1330 enum schemas</strong> — Corrected
elicitation enum schemas in conformance tests by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/600">#600</a>)</li>
</ul>
<h2>Documentation</h2>
<ul>
<li>New Streamable HTTP server sample by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/595">#595</a>)</li>
<li>Updated client and server samples by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/598">#598</a>)</li>
<li>Added Context7 config file by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/605">#605</a>)</li>
<li>Updated AGENTS.md by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/612">#612</a>)</li>
<li>Added missing KDoc for public API members by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/621">#621</a>)</li>
</ul>
<h2>Maintenance</h2>
<ul>
<li>Simplified and cleaned up CI workflows by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/617">#617</a>)</li>
<li>Modernized TypeScript integration tests, renamed SSE references to
HTTP by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/618">#618</a>)</li>
<li>Bumped Gradle wrapper from 9.3.1 to 9.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/614">#614</a>)</li>
<li>Fix Kotlin language and api version to 2.1 by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/620">#620</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.9.0...0.10.0">https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.9.0...0.10.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5ad049240b"><code>5ad0492</code></a>
chore: bump project version to 0.10.0 in gradle.properties</li>
<li><a
href="bd4cf0c948"><code>bd4cf0c</code></a>
docs: add missing KDoc comments for public functions, properties, and
classes...</li>
<li><a
href="c77ebe0c00"><code>c77ebe0</code></a>
refactor(core): Fix Kotlin language and api version to 2.1 in build
config (#...</li>
<li><a
href="cd91eed35d"><code>cd91eed</code></a>
chore: simplify and clean up CI workflows (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/617">#617</a>)</li>
<li><a
href="435698a611"><code>435698a</code></a>
refactor(integration-test): modernize ts tests, update versions, rename
SSE -...</li>
<li><a
href="558399039c"><code>5583990</code></a>
chore: deprecation cycle (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/615">#615</a>)</li>
<li><a
href="55afb63c27"><code>55afb63</code></a>
chore(deps): bump gradle-wrapper from 9.3.1 to 9.4.1 (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/614">#614</a>)</li>
<li><a
href="fd3a8583b8"><code>fd3a858</code></a>
feat: add tasks models (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/566">#566</a>)</li>
<li><a
href="62e4e50c67"><code>62e4e50</code></a>
docs: update AGENTS.md (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/612">#612</a>)</li>
<li><a
href="ee6561c185"><code>ee6561c</code></a>
feat: <a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/502">#502</a>
resource templates with basic template matcher (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/606">#606</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.9.0...0.10.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `io.modelcontextprotocol:kotlin-sdk-server` from 0.9.0 to 0.10.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/modelcontextprotocol/kotlin-sdk/releases">io.modelcontextprotocol:kotlin-sdk-server's
releases</a>.</em></p>
<blockquote>
<h2>0.10.0</h2>
<h2>Highlights</h2>
<p>This release adds MCP conformance testing infrastructure, SSE
reconnection support, Tasks protocol types, resource template matching,
and<br />
tool execution properties. It also completes a deprecation cycle —
removing all previously deprecated (error-level) symbols from
<code>io.modelcontextprotocol.kotlin.sdk</code> in favor of their
replacements in
<code>io.modelcontextprotocol.kotlin.sdk.types</code>.</p>
<h2>Breaking Changes</h2>
<ul>
<li><strong>Deprecation cycle completed</strong> — All symbols
deprecated at <code>ERROR</code> level in 0.9.0 have been removed by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/615">#615</a>).
This includes<br />
the entire <code>io.modelcontextprotocol.kotlin.sdk.types.kt</code>
compatibility file (type aliases such as <code>CallToolResult</code>,
<code>CancelledNotification</code>,
<code>ClientCapabilities</code>, <code>CompleteRequest</code>, etc.) and
the legacy <code>McpJson</code> in
<code>io.modelcontextprotocol.kotlin.sdk</code>. Migrate to the
equivalents
in <code>io.modelcontextprotocol.kotlin.sdk.types</code>.</li>
<li><strong>SSE/Streamable HTTP transport changes</strong> —
<code>StreamableHttpClientTransport</code> now accepts
<code>ReconnectionOptions</code> for configurable retry
behavior by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/585">#585</a>,
<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/596">#596</a>).
The previous constructor signatures remain available.</li>
</ul>
<h2>Features</h2>
<ul>
<li><strong>MCP conformance test infrastructure</strong> — Comprehensive
conformance test suite covering core protocol operations, tool calls,
elicitation,
resources, prompts, and 20 OAuth/auth scenarios. Includes CI workflow,
baseline tracking, and shell runner by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/585">#585</a>)</li>
<li><strong>SSE reconnection with retry support</strong> — Client
transports now support configurable reconnection with exponential
backoff via<br />
<code>ReconnectionOptions</code> (initial delay, max delay, multiplier,
max retries) by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/596">#596</a>)</li>
<li><strong>Tasks protocol types</strong> — Added <code>Task</code>,
<code>TaskStatus</code>, and related models per the MCP tasks
specification by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/566">#566</a>)</li>
<li><strong>Resource templates with basic template matcher</strong> —
Server-side support for URI template-based resource matching by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/502">#502</a>,
<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/606">#606</a>)</li>
<li><strong>Tool execution properties</strong> — <code>Tool</code> now
exposes execution properties for richer tool metadata by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/567">#567</a>)</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li><strong>Notifications not delivered over Streamable HTTP</strong> —
Fixed server-side notification delivery for Streamable HTTP transport
sessions by
<a href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/587">#587</a>,
<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/599">#599</a>)</li>
<li><strong>Conformance: SEP-1330 enum schemas</strong> — Corrected
elicitation enum schemas in conformance tests by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/600">#600</a>)</li>
</ul>
<h2>Documentation</h2>
<ul>
<li>New Streamable HTTP server sample by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/595">#595</a>)</li>
<li>Updated client and server samples by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/598">#598</a>)</li>
<li>Added Context7 config file by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/605">#605</a>)</li>
<li>Updated AGENTS.md by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/612">#612</a>)</li>
<li>Added missing KDoc for public API members by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/621">#621</a>)</li>
</ul>
<h2>Maintenance</h2>
<ul>
<li>Simplified and cleaned up CI workflows by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/617">#617</a>)</li>
<li>Modernized TypeScript integration tests, renamed SSE references to
HTTP by <a
href="https://github.com/devcrocod"><code>@​devcrocod</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/618">#618</a>)</li>
<li>Bumped Gradle wrapper from 9.3.1 to 9.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/614">#614</a>)</li>
<li>Fix Kotlin language and api version to 2.1 by <a
href="https://github.com/kpavlov"><code>@​kpavlov</code></a> (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/620">#620</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.9.0...0.10.0">https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.9.0...0.10.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5ad049240b"><code>5ad0492</code></a>
chore: bump project version to 0.10.0 in gradle.properties</li>
<li><a
href="bd4cf0c948"><code>bd4cf0c</code></a>
docs: add missing KDoc comments for public functions, properties, and
classes...</li>
<li><a
href="c77ebe0c00"><code>c77ebe0</code></a>
refactor(core): Fix Kotlin language and api version to 2.1 in build
config (#...</li>
<li><a
href="cd91eed35d"><code>cd91eed</code></a>
chore: simplify and clean up CI workflows (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/617">#617</a>)</li>
<li><a
href="435698a611"><code>435698a</code></a>
refactor(integration-test): modernize ts tests, update versions, rename
SSE -...</li>
<li><a
href="558399039c"><code>5583990</code></a>
chore: deprecation cycle (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/615">#615</a>)</li>
<li><a
href="55afb63c27"><code>55afb63</code></a>
chore(deps): bump gradle-wrapper from 9.3.1 to 9.4.1 (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/614">#614</a>)</li>
<li><a
href="fd3a8583b8"><code>fd3a858</code></a>
feat: add tasks models (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/566">#566</a>)</li>
<li><a
href="62e4e50c67"><code>62e4e50</code></a>
docs: update AGENTS.md (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/612">#612</a>)</li>
<li><a
href="ee6561c185"><code>ee6561c</code></a>
feat: <a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/502">#502</a>
resource templates with basic template matcher (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/606">#606</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.9.0...0.10.0">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 23:32:24 +03:00
..
gradle chore(deps): bump mcp-kotlin from 0.9.0 to 0.10.0 in /samples/kotlin-mcp-server (#651) 2026-03-30 23:32:24 +03:00
src Fix kotlin-mcp-server sample (#459) 2025-12-08 23:25:55 +02:00
build.gradle.kts Update Kotlin-MCP-Server with STDIO support, logging & CORS (#371) 2025-11-06 18:18:04 +02:00
gradle.properties #302 Update samples build workflow (#330) 2025-10-23 13:02:22 +03:00
gradlew chore(deps): bump the other-dependencies group across 4 directories with 4 updates (#634) 2026-03-27 00:58:15 +00:00
gradlew.bat chore(deps): bump the other-dependencies group across 4 directories with 4 updates (#634) 2026-03-27 00:58:15 +00:00
mcp-inspector-config.json Update Kotlin-MCP-Server with STDIO support, logging & CORS (#371) 2025-11-06 18:18:04 +02:00
README.md docs: streamable server sample (#595) 2026-03-10 12:45:21 +01:00
settings.gradle.kts #302 Update samples build workflow (#330) 2025-10-23 13:02:22 +03:00

Kotlin MCP Server

A sample MCP server demonstrating multiple transport modes: STDIO, SSE (plain), and SSE (Ktor plugin).

Note: The SSE transport modes are provided for backward compatibility. For new projects, consider using the simple-streamable-server sample, which uses the recommended Streamable HTTP transport.

Overview

This sample registers a prompt, a tool, and a resource, then lets you choose how to expose them. STDIO mode is the default and is best for process-based clients. The two SSE modes show how to serve MCP over HTTP using either a manual Ktor routing setup or the built-in mcp { } Ktor plugin.

Prerequisites

Build & Run

STDIO mode (default)

./gradlew run

Or explicitly:

./gradlew run --args="--stdio"

Connect with the MCP Inspector:

npx @modelcontextprotocol/inspector --config samples/kotlin-mcp-server/mcp-inspector-config.json --server stdio-server

SSE with Ktor plugin

./gradlew run --args="--sse-server-ktor 3002"

Connect with the MCP Inspector:

npx @modelcontextprotocol/inspector --config samples/kotlin-mcp-server/mcp-inspector-config.json --server sse-ktor-server

SSE with plain configuration

Known issue: This mode may not work correctly at this time.

./gradlew run --args="--sse-server 3001"

Connect with the MCP Inspector:

npx @modelcontextprotocol/inspector --config samples/kotlin-mcp-server/mcp-inspector-config.json --server sse-server

MCP Capabilities

Tools

Name Description
kotlin-sdk-tool A test tool that returns a "Hello, world!" greeting.

Prompts

Name Description
Kotlin Developer Generates a prompt to develop a small Kotlin application for a given project name.

Resources

Name URI Description
Web Search https://search.com/ A placeholder resource demonstrating resource handling.