본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)40k · #7264

kotlin-mcp-server-generator

하는 일

이 에이전트는 Model Context Protocol(MCP)을 사용하기 위한 완전한 Kotlin 서버 프로젝트를 만듭니다. 프로젝트 구조를 설정하고, 필요한 라이브러리를 추가하며, 서버가 실행될 준비를 합니다.

사용하는 경우

  • ✓Kotlin으로 새 MCP 서버를 만들고 싶을 때.
  • ✓구조가 모두 준비된 기본 프로젝트가 필요할 때.
  • ✓MCP 서버 개발을 빠르게 시작하고 싶을 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/kotlin-mcp-server-generator/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/kotlin-mcp-server-generator/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“'my-server'라는 이름의 Kotlin MCP 서버 프로젝트를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

Gradle로 프로젝트를 관리하고, Ktor와 공식 MCP SDK 같은 라이브러리를 추가합니다. 기본 도구, 오류 처리, 테스트도 포함합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Kotlin MCP Server Project Generator

Generate a complete, production-ready Model Context Protocol (MCP) server project in Kotlin.

Project Requirements

You will create a Kotlin MCP server with:

  1. Project Structure: Gradle-based Kotlin project layout
  2. Dependencies: Official MCP SDK, Ktor, and kotlinx libraries
  3. Server Setup: Configured MCP server with transports
  4. Tools: At least 2-3 useful tools with typed inputs/outputs
  5. Error Handling: Proper exception handling and validation
  6. Documentation: README with setup and usage instructions
  7. Testing: Basic test structure with coroutines

Template Structure

myserver/
├── build.gradle.kts
├── settings.gradle.kts
├── gradle.properties
├── src/
│   ├── main/
│   │   └── kotlin/
│   │       └── com/example/myserver/
│   │           ├── Main.kt
│   │           ├── Server.kt
│   │           ├── config/
│   │           │   └── Config.kt
│   │           └── tools/
│   │               ├── Tool1.kt
│   │               └── Tool2.kt
│   └── test/
│       └── kotlin/
│           └── com/example/myserver/
│               └── ServerTest.kt
└── README.md

build.gradle.kts Template

plugins {
    kotlin("jvm") version "2.1.0"
    kotlin("plugin.serialization") version "2.1.0"
    application
}

group = "com.example"
version = "1.0.0"

repositories {
    mavenCentral()
}

dependencies {
    implementation("io.modelcontextprotocol:kotlin-sdk:0.7.2")
    
    // Ktor for transports
    implementation("io.ktor:ktor-server-netty:3.0.0")
    implementation("io.ktor:ktor-client-cio:3.0.0")
    
    // Serialization
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
    
    // Coroutines
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
    
    // Logging
    implementation("io.github.oshai:kotlin-logging-jvm:7.0.0")
    implementation("ch.qos.logback:logback-classic:1.5.12")
    
    // Testing
    testImplementation(kotlin("test"))
    testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
}

application {
    mainClass.set("com.example.myserver.MainKt")
}

tasks.test {
    useJUnitPlatform()
}

kotlin {
    jvmToolchain(17)
}

settings.gradle.kts Template

rootProject.name = "{{PROJECT_NAME}}"

Main.kt Template

package com.example.myserver

import io.modelcontextprotocol.kotlin.sdk.server.StdioServerTransport
import kotlinx.coroutines.runBlocking
import io.github.oshai.kotlinlogging.KotlinLogging

private val logger = KotlinLogging.logger {}

fun main() = runBlocking {
    logger.info { "Starting MCP server..." }
    
    val config = loadConfig()
    val server = createServer(config)
    
    // Use stdio transport
    val transport = StdioServerTransport()
    
    logger.info { "Server '${config.name}' v${config.version} ready" }
    server.connect(transport)
}

Server.kt Template

package com.example.myserver

import io.modelcontextprotocol.kotlin.sdk.server.Server
import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions
import io.modelcontextprotocol.kotlin.sdk.Implementation
import io.modelcontextprotocol.kotlin.sdk.ServerCapabilities
import com.example.myserver.tools.registerTools

fun createServer(config: Config): Server {
    val server = Server(
        serverInfo = Implementation(
            name = config.name,
            version = config.version
        ),
        options = ServerOptions(
            capabilities = ServerCapabilities(
                tools = ServerCapabilities.Tools(),
                resources = ServerCapabilities.Resources(
                    subscribe = true,
                    listChanged = true
                ),
                prompts = ServerCapabilities.Prompts(listChanged = true)
            )
        )
    ) {
        config.description
    }
    
    // Register all tools
    server.registerTools()
    
    return server
}

Config.kt Template

package com.example.myserver.config

import kotlinx.serialization.Serializable

@Serializable
data class Config(
    val name: String = "{{PROJECT_NAME}}",
    val version: String = "1.0.0",
    val description: String = "{{PROJECT_DESCRIPTION}}"
)

fun loadConfig(): Config {
    return Config(
        name = System.getenv("SERVER_NAME") ?: "{{PROJECT_NAME}}",
        version = System.getenv("VERSION") ?: "1.0.0",
        description = System.getenv("DESCRIPTION") ?: "{{PROJECT_DESCRIPTION}}"
    )

…
자주 묻는 질문

Model Context Protocol(MCP)이란 무엇인가요?

시스템의 서로 다른 부분이 정보를 교환하고, 표준화된 방식으로 서로의 기능을 호출할 수 있게 하는 통신 프로토콜입니다.

Ktor와 Kotlinx는 무엇인가요?

Ktor는 Kotlin으로 웹 애플리케이션과 서비스를 만드는 프레임워크입니다. Kotlinx는 Kotlin의 추가 라이브러리로, 데이터를 텍스트로 바꾸고 되돌리는 직렬화(serialization)와 비동기 작업을 위한 코루틴(coroutines) 등이 있습니다.

이 맥락에서 '도구'란 무엇인가요?

MCP 서버가 다른 시스템에서 호출할 수 있도록 제공하는 특정 기능입니다. 이 생성기에는 여러분이 도구를 추가할 수 있는 템플릿이 이미 포함되어 있습니다.

상세 정보

작성자의 원본 설명

Generate a complete Kotlin MCP server project with proper structure, dependencies, and implementation using the official io.modelcontextprotocol:kotlin-sdk library.

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7264
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬