You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: quickstart/server.mdx
+370Lines changed: 370 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1032,6 +1032,376 @@ For more information, see the [MCP Client Boot Starters](https://docs.spring.io/
1032
1032
The [starter-webflux-server](https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/weather/starter-webflux-server) demonstrates how to create a MCP server using SSE transport.
1033
1033
It showcases how to define and register MCP Tools, Resources, and Prompts, using the Spring Boot's auto-configuration capabilities.
1034
1034
1035
+
</Tab>
1036
+
1037
+
<Tabtitle='Kotlin'>
1038
+
Let's get started with building our weather server! [You can find the complete code for what we'll be building here.](https://github.com/modelcontextprotocol/kotlin-sdk/tree/main/samples/weather-stdio-server)
1039
+
1040
+
### Prerequisite knowledge
1041
+
1042
+
This quickstart assumes you have familiarity with:
1043
+
- Kotlin
1044
+
- LLMs like Claude
1045
+
1046
+
### System requirements
1047
+
1048
+
- Java 17 or higher installed.
1049
+
1050
+
### Set up your environment
1051
+
1052
+
First, let's install `java` and `gradle` if you haven't already.
1053
+
You can download `java` from [official Oracle JDK website](https://www.oracle.com/java/technologies/downloads/).
1054
+
Verify your `java` installation:
1055
+
```bash
1056
+
java --version
1057
+
```
1058
+
1059
+
Now, let's create and set up your project:
1060
+
1061
+
<CodeGroup>
1062
+
```bash MacOS/Linux
1063
+
# Create a new directory for our project
1064
+
mkdir weather
1065
+
cd weather
1066
+
1067
+
# Initialize a new kotlin project
1068
+
gradle init
1069
+
```
1070
+
1071
+
```powershell Windows
1072
+
# Create a new directory for our project
1073
+
md weather
1074
+
cd weather
1075
+
1076
+
# Initialize a new kotlin project
1077
+
gradle init
1078
+
```
1079
+
</CodeGroup>
1080
+
1081
+
After running `gradle init`, you will be presented with options for creating your project.
1082
+
Select **Application** as the project type, **Kotlin** as the programming language, and **Java 17** as the Java version.
1083
+
1084
+
Alternatively, you can create a Kotlin application using the [IntelliJ IDEA project wizard](https://kotlinlang.org/docs/jvm-get-started.html).
1085
+
1086
+
After creating the project, add the following dependencies:
Finally, implement the main function to run the server:
1330
+
1331
+
```kotlin
1332
+
funmain() = `run mcp server`()
1333
+
```
1334
+
1335
+
Make sure to run `./gradlew build` to build your server. This is a very important step in getting your server to connect.
1336
+
1337
+
Let's now test your server from an existing MCP host, Claude for Desktop.
1338
+
1339
+
## Testing your server with Claude for Desktop
1340
+
1341
+
<Note>
1342
+
Claude for Desktop is not yet available on Linux. Linux users can proceed to the [Building a client](/quickstart/client) tutorial to build an MCP client that connects to the server we just built.
1343
+
</Note>
1344
+
1345
+
First, make sure you have Claude for Desktop installed. [You can install the latest version
1346
+
here.](https://claude.ai/download) If you already have Claude for Desktop, **make sure it's updated to the latest version.**
1347
+
1348
+
We'll need to configure Claude for Desktop for whichever MCP servers you want to use.
1349
+
To do this, open your Claude for Desktop App configuration at `~/Library/Application Support/Claude/claude_desktop_config.json` in a text editor.
1350
+
Make sure to create the file if it doesn't exist.
1351
+
1352
+
For example, if you have [VS Code](https://code.visualstudio.com/) installed:
0 commit comments