
Kotlin Mcp Server Generator
Scaffold a Gradle Kotlin MCP server with SDK wiring, sample tools, tests, and README so your agent can call custom capabilities quickly.
Overview
kotlin-mcp-server-generator is an agent skill for the Build phase that scaffolds a complete Kotlin MCP server project with SDK dependencies, tools, tests, and documentation.
Install
npx skills add https://github.com/github/awesome-copilot --skill kotlin-mcp-server-generatorWhat is this skill?
- Full Gradle layout: build.gradle.kts, settings, gradle.properties, Main/Server/config/tools packages
- Uses official io.modelcontextprotocol:kotlin-sdk with Ktor and kotlinx serialization
- Ships at least 2–3 typed MCP tools with validation and error handling
- Includes coroutine-friendly test skeleton (ServerTest.kt) and setup README
- Documents transport-ready server setup for local agent integration
- Targets Kotlin JVM plugin 2.1.0 in the documented build.gradle.kts template
- Requires at least 2–3 useful MCP tools in the generated project
- Includes dedicated src/test kotlin package with ServerTest.kt
Adoption & trust: 8.4k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need custom tools for your coding agent but lack a correct Gradle MCP server layout hooked to the official Kotlin SDK.
Who is it for?
Indie developers comfortable with Kotlin/JVM who want MCP servers that agents can discover and call with typed tool contracts.
Skip if: Python-only MCP shops, no-code agent users, or teams that only need a static OpenAPI wrapper without MCP protocol semantics.
When should I use this skill?
You want a new Kotlin MCP server repository with official SDK dependencies, transports, tools, and baseline tests.
What do I get? / Deliverables
You receive a buildable myserver-style repo with Server.kt, sample tools, tests, and README ready for your domain logic and agent transport configuration.
- Gradle Kotlin MCP server project tree
- README with setup and usage
- Sample tools and ServerTest.kt coroutine tests
Recommended Skills
Journey fit
Build is where you implement agent infrastructure; this skill generates a runnable MCP server project rather than validating market fit or operating prod monitors. agent-tooling fits because the output is an MCP server—the bridge between coding agents and your domain tools—not a generic REST API alone.
How it compares
A project generator for MCP servers—not a hosted MCP marketplace listing or a cloud-deploy playbook by itself.
Common Questions / FAQ
Who is kotlin-mcp-server-generator for?
Solo builders shipping agent integrations on the JVM who want Gradle, kotlinx serialization, and official MCP SDK wiring out of the box.
When should I use kotlin-mcp-server-generator?
In Build → agent-tooling when you are adding a new MCP server repo to expose internal APIs, dev workflows, or data lookups to Claude Code, Cursor, or Codex.
Is kotlin-mcp-server-generator safe to install?
Check this page’s Security Audits panel; generated servers may need network or filesystem permissions depending on tools you implement afterward.
SKILL.md
READMESKILL.md - Kotlin Mcp Server Generator
# 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 ```kotlin 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 ```kotlin rootProject.name = "{{PROJECT_NAME}}" ``` ## Main.kt Template ```kotlin 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 ```kotlin 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 = ServerCapabili