kotlin-sdk  by modelcontextprotocol

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

Created 1 year ago
1,269 stars

Top 30.8% 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

1 day ago

Responsiveness

1 day

Pull Requests (30d)
52
Issues (30d)
25
Star History
43 stars in the last 30 days

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research), Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), and
9 more.

python-sdk by modelcontextprotocol

0.5%
22k
Python SDK for Model Context Protocol (MCP) servers/clients
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.