Skip to content

Commit 2a1b2c9

Browse files
devcrocodPavel Gorgulov
authored andcommitted
update README to reflect multiplatform support and clarify server setup for JVM and WASM
1 parent ba73fef commit 2a1b2c9

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# MCP Kotlin SDK
22

3-
Kotlin implementation of the [Model Context Protocol](https://modelcontextprotocol.io) (MCP), providing both client and server capabilities for integrating with LLM surfaces.
3+
[![Kotlin Multiplatform](https://img.shields.io/badge/Kotlin-Multiplatform-blueviolet?logo=kotlin)](https://kotlinlang.org/docs/multiplatform.html)
4+
[![Platforms](https://img.shields.io/badge/Platforms-JVM%20%7C%20Wasm%2FJS%20%7C%20Native%20(iOS%2FiOS%20Simulator)-blue)](https://kotlinlang.org/docs/multiplatform.html)
5+
[![Maven Central](https://img.shields.io/maven-central/v/io.modelcontextprotocol/kotlin-sdk.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:io.modelcontextprotocol%20a:kotlin-sdk)
6+
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7+
8+
Kotlin Multiplatform implementation of the [Model Context Protocol](https://modelcontextprotocol.io) (MCP),
9+
providing both client and server capabilities for integrating with LLM surfaces across various platforms.
410

511
## Overview
612

7-
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 full MCP specification, making it easy to:
13+
The Model Context Protocol allows applications to provide context for LLMs in a standardized way,
14+
separating the concerns of providing context from the actual LLM interaction.
15+
This SDK implements the MCP specification for Kotlin,
16+
enabling you to build applications that can communicate using MCP on the JVM, WebAssembly and iOS.
817

918
- Build MCP clients that can connect to any MCP server
1019
- Create MCP servers that expose resources, prompts and tools
@@ -13,7 +22,7 @@ The Model Context Protocol allows applications to provide context for LLMs in a
1322

1423
## Samples
1524

16-
- [kotlin-mcp-server](./samples/kotlin-mcp-server): shows how to set up a Kotlin MCP server with different tools and other features.
25+
- [kotlin-mcp-server](./samples/kotlin-mcp-server): demonstrates a multiplatform (JVM, Wasm) MCP server setup with various features and transports.
1726
- [weather-stdio-server](./samples/weather-stdio-server): shows how to build a Kotlin MCP server providing weather forecast and alerts using STDIO transport.
1827
- [kotlin-mcp-client](./samples/kotlin-mcp-client): demonstrates building an interactive Kotlin MCP client that connects to an MCP server via STDIO and integrates with Anthropic’s API.
1928

@@ -31,7 +40,8 @@ Add the dependency:
3140

3241
```kotlin
3342
dependencies {
34-
implementation("io.modelcontextprotocol:kotlin-sdk:0.5.0")
43+
// Use the badge above for the latest version
44+
implementation("io.modelcontextprotocol:kotlin-sdk:$mcpVersion")
3545
}
3646
```
3747

samples/kotlin-mcp-server/README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# MCP Kotlin Server Sample
22

3-
A sample implementation of an MCP (Model Communication Protocol) server in Kotlin that demonstrates different server configurations and transport methods.
3+
A sample implementation of an MCP (Model Communication Protocol) server in Kotlin that demonstrates different server
4+
configurations and transport methods for both JVM and WASM targets.
45

56
## Features
67

78
- Multiple server operation modes:
8-
- Standard I/O server
9-
- SSE (Server-Sent Events) server with plain configuration
10-
- SSE server using Ktor plugin
9+
- Standard I/O server (JVM only)
10+
- SSE (Server-Sent Events) server with plain configuration (JVM, WASM)
11+
- SSE server using Ktor plugin (JVM, WASM)
12+
- Multiplatform support
1113
- Built-in capabilities for:
1214
- Prompts management
1315
- Resources handling
@@ -17,17 +19,30 @@ A sample implementation of an MCP (Model Communication Protocol) server in Kotli
1719

1820
### Running the Server
1921

20-
To run the server in SSE mode on the port 3001, run:
22+
You can run the server on the JVM or using Kotlin/WASM on Node.js.
23+
24+
25+
#### JVM:
26+
27+
To run the server on the JVM (defaults to SSE mode with Ktor plugin on port 3001):
28+
29+
```bash
30+
./gradlew runJvm
31+
```
32+
33+
#### WASM:
34+
35+
To run the server using Kotlin/WASM on Node.js (defaults to SSE mode with Ktor plugin on port 3001):
2136

2237
```bash
23-
./gradlew run
38+
./gradlew wasmJsNodeDevelopmentRun
2439
```
2540

2641
### Connecting to the Server
2742

28-
For SSE servers (both plain and Ktor plugin versions):
43+
For servers on JVM or WASM:
2944
1. Start the server
30-
2. Use the MCP inspector to connect to `http://localhost:<port>/sse`
45+
2. Use the [MCP inspector](https://modelcontextprotocol.io/docs/tools/inspector) to connect to `http://localhost:<port>/sse`
3146

3247
## Server Capabilities
3348

@@ -42,3 +57,4 @@ The server is implemented using:
4257
- Kotlin coroutines for asynchronous operations
4358
- SSE for real-time communication
4459
- Standard I/O for command-line interface
60+
- Common Kotlin code shared between JVM and WASM targets

0 commit comments

Comments
 (0)