kotlin-sdk  by modelcontextprotocol

Kotlin SDK for Model Context Protocol (MCP) servers and clients

created 7 months ago
958 stars

Top 39.2% on sourcepulse

GitHubView on GitHub
Project Summary

The Model Context Protocol (MCP) Kotlin SDK provides a standardized way for applications to manage context for Large Language Models (LLMs), separating context provision from LLM interaction. It enables developers to build both MCP clients and servers, supporting various transports like stdio, SSE, and WebSocket, and handling the full MCP message lifecycle.

How It Works

The SDK implements the MCP specification, offering a Kotlin-native API for creating clients that connect to MCP servers and servers that expose resources, prompts, and tools. It abstracts away the complexities of message serialization, transport handling, and protocol state management, allowing developers to focus on defining and serving context. The design supports flexible integration with existing applications, including Ktor for SSE transport.

Quick Start & Requirements

  • Installation: Add mavenCentral() to repositories and implementation("io.modelcontextprotocol:kotlin-sdk:0.5.0") to dependencies.
  • Prerequisites: Kotlin, Java Runtime Environment.
  • Quick Start: Examples for client and server setup using stdio and SSE transports are provided in the README.

Highlighted Details

  • Full implementation of the Model Context Protocol specification.
  • Support for multiple transports: stdio, SSE, WebSocket.
  • Client and server capabilities for resource exposure and prompt interaction.
  • Integration examples with Ktor for SSE.

Maintenance & Community

  • Maintained in collaboration with JetBrains.
  • Contribution guide and Code of Conduct are available.

Licensing & Compatibility

  • Licensed under the MIT License.
  • Permissive license suitable for commercial use and integration into closed-source projects.

Limitations & Caveats

The current version is 0.5.0, indicating it may still be under active development and subject to change. Specific details on supported LLM integrations or advanced server configurations beyond the provided examples are not elaborated.

Health Check
Last commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
45
Issues (30d)
44
Star History
354 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.