★ 1361 Kotlin NOASSERTION sse 更新 9小时前

Kotlin Sdk

The official Kotlin SDK for Model Context Protocol servers and clients. Maintained in collaboration with JetBrains

安装配置

npx -y @modelcontextprotocol/inspector

README 摘要

# MCP Kotlin SDK [![Maven Central](https://img.shields.io/maven-central/v/io.modelcontextprotocol/kotlin-sdk.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/io.modelcontextprotocol/kotlin-sdk) [![Build](https://github.com/modelcontextprotocol/kotlin-sdk/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/modelcontextprotocol/kotlin-sdk/actions/workflows/build.yml) [![Kotlin](https://img.shields.io/badge/kotlin-2.2+-blueviolet.svg?logo=kotlin)](http://kotlinlang.org) [![Kotlin Multiplatform](https://img.shields.io/badge/Platforms-%20JVM%20%7C%20Wasm%2FJS%20%7C%20Native%20-blueviolet?logo=kotlin)](https://kotlinlang.org/docs/multiplatform.html) [![JVM](https://img.shields.io/badge/JVM-11+-red.svg?logo=jvm)](http://java.com) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) Kotlin Multiplatform SDK for the [Model Context Protocol](https://modelcontextprotocol.io). It enables Kotlin applications targeting JVM, Native, JS, and Wasm to implement MCP clients and servers using a standardized protocol interface. ## Table of Contents * [Overview](#overview) * [Installation](#installation) * [Artifacts](#artifacts) * [Gradle setup (JVM)](#gradle-setup-jvm) * [Multiplatform](#multiplatform) * [Ktor dependencies](#ktor-dependencies) * [Quickstart](#quickstart) * [Creating a Client](#creating-a-client) * [Creating a Server](#creating-a-server) * [Core Concepts](#core-concepts) * [MCP Primitives](#mcp-primitives) * [Capabilities](#capabilities) * [Server Capabilities](#server-capabilities) * [Client Capabilities](#client-capabilities) * [Server Features](#server-features) * [Prompts](#prompts) * [Resources](#resources) * [Tools](#tools) * [Completion](#completion) * [Logging](#logging) * [Pagination](#pagination) * [Client Features](#client-features) * [Roots](#roots) * [Sampling](#sampling) * [Transports](#transports) * [STDIO Transport](#stdio-transport) * [Streamable HTTP Transport](#streamable-http-transport) * [SSE Transport](#sse-transport) * [WebSocket Transport](#websocket-transport) * [ChannelTransport (testing)](#channeltransport-testing) * [Connecting your server](#connecting-your-server) * [Examples](#examples) * [Documentation](#documentation) * [Contributing](#contributing) * [License](#license) ## Overview The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This Kotlin SDK implements the MCP specification, making it easy to: - Build MCP **clients** that can connect to any MCP server - Create MCP **servers** that expose resources, prompts, and tools - Target **JVM, Native, JS, and Wasm** from a single codebase - Use standard transports like **stdio**, **SSE**, **Streamable HTTP**, and **WebSocket** - Handle MCP protocol messages and lifecycle events with coroutine-friendly APIs ## Installation ### Artifacts - `io.modelcontextprotocol:kotlin-sdk` – umbrella SDK (client + server APIs) - `io.modelcontextprotocol:kotlin-sdk-client` – client-only APIs - `io.modelcontextprotocol:kotlin-sdk-server` – server-only APIs ### Gradle setup (JVM) Add the Maven Central repository and the SDK dependency: ```kotlin repositories { mavenCentral() } dependencies { // See the badge above for the latest version implementation("io.modelcontextprotocol:kotlin-sdk:$mcpVersio...

相关 MCP

Fastapi

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

★ 11868 Python sse 待补充
mcp Python sse

Chrome

Chrome MCP Server is a Chrome extension-based Model Context Protocol (MCP) server that exposes your Chrome browser funct...

★ 11659 TypeScript sse 有配置
mcp sse TypeScript

Unity

Unity MCP acts as a bridge, allowing AI assistants (like Claude, Cursor) to interact directly with your Unity Editor via...

★ 9756 C# sse 有配置
mcp sse C#

Go

A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and exte...

★ 8720 Go sse 待补充
mcp sse Go

Agent

Build effective agents using Model Context Protocol and simple workflow patterns

★ 8327 Python sse 待补充
mcp Python sse

Registry

A community driven registry service for Model Context Protocol (MCP) servers.

★ 6836 Go sse 待补充
mcp sse Go