Kotlin MCP SDK Samples

April 27, 2026 · View on GitHub

Runnable projects demonstrating MCP server and client implementations with the Kotlin MCP SDK. For background on the protocol itself, see the MCP documentation.

Overview

SampleTypeTransportMCP Features
simple-streamable-serverServerStreamable HTTPTools, Resources, Prompts, Logging
kotlinlang-mcp-serverServerStreamable HTTPTools
kotlin-mcp-serverServerSTDIO, SSETools, Resources, Prompts
weather-stdio-serverServerSTDIOTools
kotlin-mcp-clientClientSTDIOTool discovery & invocation
notebooksClient (Notebook)Streamable HTTPTool 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 →