modelcontextprotocol/kotlin-sdk
The official Kotlin SDK for Model Context Protocol servers and clients. Maintained in collaboration with JetBrains
What it solves
The Model Context Protocol (MCP) Kotlin SDK provides a standardized way for Kotlin applications to connect with Large Language Models (LLMs). It separates the logic of providing data and tools from the actual LLM interaction, allowing developers to build flexible clients and servers that can exchange resources, prompts, and executable tools.
How it works
The SDK implements the MCP specification using coroutine-friendly APIs. Developers define "capabilities" (such as tools, resources, or prompts) that the server supports. The SDK handles the communication lifecycle, allowing clients to discover and interact with these features over various transport layers like standard I/O (stdio), HTTP, or WebSockets. It is built to be platform-agnostic, supporting JVM, Native, JS, and Wasm environments.
Who it’s for
This SDK is for Kotlin developers building AI-integrated applications who need a reliable, standardized way to expose local data or functions to LLMs, or who are building clients that need to consume these services from diverse MCP-compliant servers.
Highlights
- Supports multiple platforms including JVM, Native, JS, and Wasm.
- Provides a modular architecture with separate client and server APIs.
- Includes built-in support for standard transports: stdio, SSE, Streamable HTTP, and WebSockets.
- Enables lazy, suspendable handlers for resources, prompts, and tools.
- Integrates seamlessly with Ktor for network-based communication.
Related
- Project
- Project
- Project
- Project
- Project