| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps the other-dependencies group with 2 updates in the /samples/kotlinlang-mcp-server directory: [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) and [com.gradleup.shadow](https://github.com/GradleUp/shadow). Bumps the other-dependencies group with 2 updates in the /samples/simple-streamable-server directory: [com.gradleup.shadow](https://github.com/GradleUp/shadow) and [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit-framework). Updates `ch.qos.logback:logback-classic` from 1.5.37 to 1.5.38 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/qos-ch/logback/releases">ch.qos.logback:logback-classic's releases</a>.</em></p> <blockquote> <h2>Logback 1.5.38</h2> <p><strong>2026-07-09 Release of logback version 1.5.38</strong></p> <p>• In <code>HardenedObjectInputStream</code>, fixed a typo preventing <code>Throwable</code> objects from being white-filtered. This issue was reported in [PR <a href="https://redirect.github.com/qos-ch/logback/issues/1045">#1045</a>](<a href="https://redirect.github.com/qos-ch/logback/pull/1045">qos-ch/logback#1045</a>) by <a href="https://github.com/t0rchwo0d">t0rchwo0d</a>.</p> <p>• A bitwise identical binary of this version can be reproduced by building from source code at commit d04984a41fce42977466f45a2f076f0ee5cc4207 associated with the tag v_1.5.38. Release built using Java "21" 2023-10-17 LTS build 21.0.1.+12-LTS-29 under Linux Debian 11.6.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
| .. | ||
| gradle | ||
| src | ||
| build.gradle.kts | ||
| Dockerfile | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
Kotlinlang MCP Server
A Streamable HTTP MCP server that exposes the official
Kotlin documentation to LLM clients — full-text search via
Algolia plus page retrieval in markdown through kotlinlang.org's
_llms endpoints.
Overview
This sample demonstrates an MCP server that wraps a real external documentation source. It uses the recommended Streamable HTTP transport, supports multiple concurrent client sessions, and caches responses in memory to reduce upstream load. The server is intentionally read-only — it exposes two tools, no prompts, no resources.
Prerequisites
- JDK 21+
- Algolia credentials for
kotlinlang.org(exported as environment variables, see Configuration)
Build & Run
export ALGOLIA_APP_ID=...
export ALGOLIA_API_KEY=...
export ALGOLIA_INDEX_NAME=...
./gradlew run
The server starts on http://localhost:8080/mcp by default.
Connect with the MCP Inspector:
npx @modelcontextprotocol/inspector
In the Inspector UI, select Streamable HTTP transport and enter http://localhost:8080/mcp.
MCP Capabilities
Tools
| Name | Description |
|---|---|
search_kotlinlang |
Full-text search across Kotlin documentation. Returns up to 5 results filtered to /docs/ pages. Responses cached for 10 minutes. |
get_kotlinlang_page |
Fetches a documentation page as markdown via kotlinlang.org's _llms endpoint. Accepts a path relative to /docs/. Cached for 1 hour. |
Example paths accepted by get_kotlinlang_page: coroutines-overview,
multiplatform/compose-multiplatform-and-jetpack-compose. Leading/trailing slashes and an optional
.html suffix are normalized before resolution.
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
ALGOLIA_APP_ID |
yes | — | Algolia application ID |
ALGOLIA_API_KEY |
yes | — | Algolia search API key |
ALGOLIA_INDEX_NAME |
yes | — | Algolia index name |
SERVER_PORT |
no | 8080 |
HTTP server port |
SERVER_HOST |
no | 0.0.0.0 |
HTTP server bind address |
The server does not provide fallback values for ALGOLIA_*. Startup fails if any of those
variables are missing.
Docker
Multi-stage build with Alpine-based images. Runs as a non-root user.
docker build -t kotlinlang-mcp-server .
docker run \
-p 8080:8080 \
-e ALGOLIA_APP_ID=... \
-e ALGOLIA_API_KEY=... \
-e ALGOLIA_INDEX_NAME=... \
kotlinlang-mcp-server
Connecting an MCP client
Any MCP client that supports Streamable HTTP transport can connect:
{
"mcpServers": {
"kotlinlang": {
"url": "http://localhost:8080/mcp"
}
}
}
Limitations
This sample is intended for demonstration only. Before production use, consider:
- In-memory cache only — cached data is lost on server restart.
- No authentication or authorization — run behind a trusted proxy or restrict network access.
- No rate limiting on outgoing requests to Algolia and kotlinlang.org.
- Permissive CORS (
anyHost()) — restrict to specific origins for any non-local deployment. - Streamable HTTP only — no STDIO transport for local-only usage.
- Tools only — no MCP resources or prompts are exposed.