| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps the other-dependencies group with 2 updates in the /samples/kotlin-mcp-client directory: [com.anthropic:anthropic-java](https://github.com/anthropics/anthropic-sdk-java) and [com.gradleup.shadow](https://github.com/GradleUp/shadow). Bumps the other-dependencies group with 1 update in the /samples/kotlin-mcp-server directory: [com.gradleup.shadow](https://github.com/GradleUp/shadow). Bumps the other-dependencies group with 1 update in the /samples/kotlinlang-mcp-server directory: [com.gradleup.shadow](https://github.com/GradleUp/shadow). Bumps the other-dependencies group with 1 update in the /samples/simple-streamable-server directory: [com.gradleup.shadow](https://github.com/GradleUp/shadow). Bumps the other-dependencies group with 1 update in the /samples/weather-stdio-server directory: [com.gradleup.shadow](https://github.com/GradleUp/shadow). Updates `com.anthropic:anthropic-java` from 2.45.0 to 2.48.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/anthropics/anthropic-sdk-java/releases">com.anthropic:anthropic-java's releases</a>.</em></p> <blockquote> <h2>v2.48.0</h2> <h2>2.48.0 (2026-07-02)</h2> <p>Full Changelog: <a href="https://github.com/anthropics/anthropic-sdk-java/compare/v2.47.1...v2.48.0">v2.47.1...v2.48.0</a></p> <h3>Features</h3> <ul> <li><strong>api:</strong> add agent-memory-2026-07-22 beta header (<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.