kotlin-sdk/samples/kotlin-mcp-server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dependabot[bot] 04e6d56fd6
chore(deps): bump mcp-kotlin from 0.13.0 to 0.14.0 in /samples/kotlin-mcp-server (#876)
Bumps `mcp-kotlin` from 0.13.0 to 0.14.0.
Updates `io.modelcontextprotocol:kotlin-sdk-client` from 0.13.0 to
0.14.0
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fc7916fdc7"><code>fc7916f</code></a>
release: 0.14.0 (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/867">#867</a>)</li>
<li><a
href="57e546d378"><code>57e546d</code></a>
feat: SEP-1686 Tasks (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/844">#844</a>)</li>
<li><a
href="35da063c23"><code>35da063</code></a>
fix: bound request body size in SSE and Streamable HTTP transports (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/839">#839</a>)</li>
<li><a
href="bbf77bae93"><code>bbf77ba</code></a>
chore(deps): bump <code>@​types/node</code> from 26.0.0 to 26.0.1 in
/integration-test/src/...</li>
<li><a
href="d2b1509147"><code>d2b1509</code></a>
chore(deps): bump the other-dependencies group across 5 directories with
5 up...</li>
<li><a
href="0221b8db3d"><code>0221b8d</code></a>
fix(client): close stdio read sources during shutdown (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/798">#798</a>)</li>
<li><a
href="19db4b04e3"><code>19db4b0</code></a>
fix(client): gate completion/complete on the completions capability (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/846">#846</a>)</li>
<li><a
href="64cf29fea7"><code>64cf29f</code></a>
chore(deps): bump gradle-wrapper from 9.6.0 to 9.6.1 (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/856">#856</a>)</li>
<li><a
href="cd91652be1"><code>cd91652</code></a>
fix: validate Origin against localhost by default in DNS rebinding
protection...</li>
<li><a
href="4103b87d69"><code>4103b87</code></a>
chore(deps): bump org.jetbrains.kotlinx:kotlinx-io-core from 0.9.0 to
0.9.1 i...</li>
<li>Additional commits viewable in <a
href="https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.13.0...0.14.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `io.modelcontextprotocol:kotlin-sdk-server` from 0.13.0 to
0.14.0
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fc7916fdc7"><code>fc7916f</code></a>
release: 0.14.0 (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/867">#867</a>)</li>
<li><a
href="57e546d378"><code>57e546d</code></a>
feat: SEP-1686 Tasks (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/844">#844</a>)</li>
<li><a
href="35da063c23"><code>35da063</code></a>
fix: bound request body size in SSE and Streamable HTTP transports (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/839">#839</a>)</li>
<li><a
href="bbf77bae93"><code>bbf77ba</code></a>
chore(deps): bump <code>@​types/node</code> from 26.0.0 to 26.0.1 in
/integration-test/src/...</li>
<li><a
href="d2b1509147"><code>d2b1509</code></a>
chore(deps): bump the other-dependencies group across 5 directories with
5 up...</li>
<li><a
href="0221b8db3d"><code>0221b8d</code></a>
fix(client): close stdio read sources during shutdown (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/798">#798</a>)</li>
<li><a
href="19db4b04e3"><code>19db4b0</code></a>
fix(client): gate completion/complete on the completions capability (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/846">#846</a>)</li>
<li><a
href="64cf29fea7"><code>64cf29f</code></a>
chore(deps): bump gradle-wrapper from 9.6.0 to 9.6.1 (<a
href="https://redirect.github.com/modelcontextprotocol/kotlin-sdk/issues/856">#856</a>)</li>
<li><a
href="cd91652be1"><code>cd91652</code></a>
fix: validate Origin against localhost by default in DNS rebinding
protection...</li>
<li><a
href="4103b87d69"><code>4103b87</code></a>
chore(deps): bump org.jetbrains.kotlinx:kotlinx-io-core from 0.9.0 to
0.9.1 i...</li>
<li>Additional commits viewable in <a
href="https://github.com/modelcontextprotocol/kotlin-sdk/compare/0.13.0...0.14.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-07-06 13:28:48 +02:00
..
gradle chore(deps): bump mcp-kotlin from 0.13.0 to 0.14.0 in /samples/kotlin-mcp-server (#876) 2026-07-06 13:28:48 +02: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 5 directories with 3 updates (#854) 2026-06-24 15:31:46 +02:00
gradlew.bat chore(deps): bump the other-dependencies group across 5 directories with 3 updates (#854) 2026-06-24 15:31:46 +02: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.