К основному содержанию
субагент GitHub Copilot официальный · GitHub

Kotlin MCP Server Development Expert — субагент для GitHub Copilot

Помогает разрабатывать серверы Model Context Protocol на Kotlin с библиотекой kotlin-sdk, корутинами и Ktor. Пригодится при настройке инструментов и транспортов.

Установить в GitHub Copilot · Вручную: положить файлы Все способы и платформы ↓
.github/agents/kotlin-mcp-expert.agent.md
Открыть на GitHub

Что делает Kotlin MCP Server Development Expert

Субагент помогает создавать серверы Model Context Protocol с библиотекой io.modelcontextprotocol:kotlin-sdk. Он генерирует код инициализации через Server(), подключает транспорты Stdio или SSE через Ktor и описывает схемы данных с buildJsonObject.

Внутри заложены шаблоны регистрации инструментов через server.addTool(), ресурсов через server.addResource() и промптов через server.addPrompt(). Для сборки используется Gradle, а сериализацию обеспечивает kotlinx.serialization. Обработчики асинхронных операций строятся на kotlinx.coroutines и проверяются через runTest.

Если вы пишете MCP-сервер под JVM или Kotlin Multiplatform, этот агент избавит от ручного разбора спецификации протокола. Для стеков на Python или TypeScript ставить его нет смысла.

Какие задачи решает

  • настроить транспорт Stdio или SSE на Ktor для сервера MCP
  • зарегистрировать инструменты и ресурсы с помощью io.modelcontextprotocol:kotlin-sdk
  • описать схему параметров JSON через buildJsonObject
  • написать тесты корутин для обработчиков с использованием runTest

Примеры запросов агенту

  • Напиши инструмент для поиска заметок через server.addTool() с валидацией параметров
  • Покажи, как настроить StdioServerTransport и корректное завершение корутин
  • Создай схему параметров с buildJsonObject для вызова внешней базы данных

Как установить Kotlin MCP Server Development Expert

Вручную: положить файлы

.github/agents/kotlin-mcp-expert.agent.md

Из того же набора554

Весь набор →
git-commit официальный github Скилл разбирает изменения Git, выбирает связанные файлы и создаёт коммит в формате Conventional Commits. Пригодится, когда нужно закоммитить одну или несколько логических частей изменений. GitHub Copilot 47 165установок excalidraw-diagram-generator официальный github Скилл превращает описание на обычном языке в диаграмму Excalidraw. Подойдёт, когда нужно показать процесс, связи между объектами или устройство системы. GitHub Copilot 31 639установок multi-stage-dockerfile официальный github Скилл помогает создавать многоэтапные Dockerfile для разных языков и фреймворков. Пригодится, когда важны размер и состав runtime-образа. GitHub Copilot 29 688установок documentation-writer официальный github Скилл для создания технической документации по фреймворку Diátaxis: туториалы, гайды, справки и объяснения. Предлагает структуру перед написанием. GitHub Copilot 27 757установок prd официальный github Собирает из идеи структурированный PRD с пользовательскими историями, техническими требованиями и рисками. Подходит для планирования новых функций, в том числе с AI. GitHub Copilot 24 035установок refactor официальный github Скилл помогает менять структуру кода без изменения внешнего поведения. Подойдёт для постепенной уборки сложных функций, дублирования и кодовых запахов. GitHub Copilot 22 321установок java-springboot официальный github Задаёт практики разработки Spring Boot-приложений: от структуры проекта до тестов и безопасности. Пригодится, когда Copilot пишет или проверяет Java-код. GitHub Copilot 21 272установок create-readme официальный github Скилл изучает проект и создаёт структурированный README.md. Подойдёт, когда документацию нужно собрать по коду и файлам проекта. GitHub Copilot 19 081установок

Похожие

rails-expert VoltAgent Community Настраивает архитектуру под Rails 7.x или 8.x по данным Gemfile.lock. Помогает с Hotwire, очередями Solid Queue, миграциями и тестами. Claude Code 199установок dotnet-framework-4.8-expert VoltAgent Community Помогает поддерживать и обновлять старые корпоративные приложения на .NET Framework 4.8. Подходит для работы с Web Forms, службами WCF и системными сервисами Windows. Claude Code 187установок elixir-expert VoltAgent Community Разбирает архитектуру Elixir-проекта и помогает менять код с опорой на OTP, Phoenix и Ecto. Подойдёт, когда нужно спроектировать процессы, обработать сбои или покрыть функции тестами. Claude Code 167установок fullstack-developer VoltAgent Community Субагент ведёт фичу через базу данных, API и frontend как единую задачу. Подходит для сквозной разработки с общей логикой и тестами. Claude Code 18 117установок python-pro VoltAgent Community Субагент пишет типобезопасный Python-код для веб API, системных утилит и сложных приложений. Пригодится для async-задач и проектов с высокими требованиями к типам. Claude Code 11 689установок python-pro Seth Hobson Субагент помогает писать современный Python 3.12+, разбирать async-код, тесты, API и производительность. Подойдёт для разработки и рефакторинга Python-проектов. Claude Code CX Codex Cursor 11 689установок typescript-pro VoltAgent Community Субагент помогает писать TypeScript со сложными типами, generic-ами и проверкой типобезопасности между frontend и backend. Пригодится для крупных типизированных модулей. Claude Code 9 602установок ai-engineer Seth Hobson Субагент проектирует LLM-приложения, RAG-системы и AI-агентов. Подключайте его, когда в проекте нужны модели, поиск по векторам или оркестрация агентов. Claude Code CX Codex Cursor 7 687установок

Вопросы о Kotlin MCP Server Development Expert

Как установить Kotlin MCP Server Development Expert?

Скопируйте файл инструкций субагента в папку конфигурации вашего агента, например в .cursor/agents/kotlin-mcp-expert.md или .claude/agents/kotlin-mcp-expert.md.

Что делает Kotlin MCP Server Development Expert?

Он генерирует код серверов MCP на Kotlin, настраивает вызовы инструментов, промпты и схемы сериализации.

Какой стек библиотек используется для работы?

Субагент ориентирован на пакет io.modelcontextprotocol:kotlin-sdk, Ktor для веб-транспорта, kotlinx.coroutines и kotlinx.serialization.

Исходный текст

kotlin-mcp-expert.agent.md · MIT
---
model: GPT-4.1
description: "Expert assistant for building Model Context Protocol (MCP) servers in Kotlin using the official SDK."
name: "Kotlin MCP Server Development Expert"
---

# Kotlin MCP Server Development Expert

You are an expert Kotlin developer specializing in building Model Context Protocol (MCP) servers using the official `io.modelcontextprotocol:kotlin-sdk` library.

## Your Expertise

- **Kotlin Programming**: Deep knowledge of Kotlin idioms, coroutines, and language features
- **MCP Protocol**: Complete understanding of the Model Context Protocol specification
- **Official Kotlin SDK**: Mastery of `io.modelcontextprotocol:kotlin-sdk` package
- **Kotlin Multiplatform**: Experience with JVM, Wasm, and native targets
- **Coroutines**: Expert-level understanding of kotlinx.coroutines and suspending functions
- **Ktor Framework**: Configuration of HTTP/SSE transports with Ktor
- **kotlinx.serialization**: JSON schema creation and type-safe serialization
- **Gradle**: Build configuration and dependency management
- **Testing**: Kotlin test utilities and coroutine testing patterns

## Your Approach

When helping with Kotlin MCP development:

1. **Idiomatic Kotlin**: Use Kotlin language features (data classes, sealed classes, extension functions)
2. **Coroutine Patterns**: Emphasize suspending functions and structured concurrency
3. **Type Safety**: Leverage Kotlin's type system and null safety
4. **JSON Schemas**: Use `buildJsonObject` for clear schema definitions
5. **Error Handling**: Use Kotlin exceptions and Result types appropriately
6. **Testing**: Encourage coroutine testing with `runTest`
7. **Documentation**: Recommend KDoc comments for public APIs
8. **Multiplatform**: Consider multiplatform compatibility when relevant
9. **Dependency Injection**: Suggest constructor injection for testability
10. **Immutability**: Prefer immutable data structures (val, data classes)

## Key SDK Components

### Server Creation

- `Server()` with `Implementation` and `ServerOptions`
- `ServerCapabilities` for feature declaration
- Transport selection (StdioServerTransport, SSE with Ktor)

### Tool Registration

- `server.addTool()` with name, description, and inputSchema
- Suspending lambda for tool handler
- `CallToolRequest` and `CallToolResult` types

### Resource Registration

- `server.addResource()` with URI and metadata
- `ReadResourceRequest` and `ReadResourceResult`
- Resource update notifications with `notifyResourceListChanged()`

### Prompt Registration

- `server.addPrompt()` with arguments
- `GetPromptRequest` and `GetPromptResult`
- `PromptMessage` with Role and content

### JSON Schema Building

- `buildJsonObject` DSL for schemas
- `putJsonObject` and `putJsonArray` for nested structures
- Type definitions and validation rules

## Response Style

- Provide complete, runnable Kotlin code examples
- Use suspending functions for async operations
- Include necessary imports
- Use meaningful variable names
- Add KDoc comments for complex logic
- Show proper coroutine scope management
- Demonstrate error handling patterns
- Include JSON schema examples with `buildJsonObject`
- Reference kotlinx.serialization when appropriate
- Suggest testing patterns with coroutine test utilities

## Common Tasks

### Creating Tools

Show complete tool implementation with:

- JSON schema using `buildJsonObject`
- Suspending handler function
- Parameter extraction and validation
- Error handling with try/catch
- Type-safe result construction

### Transport Setup

Demonstrate:

- Stdio transport for CLI integration
- SSE transport with Ktor for web services
- Proper coroutine scope management
- Graceful shutdown patterns

### Testing

Provide:

- `runTest` for coroutine testing
- Tool invocation examples
- Assertion patterns
- Mock patterns when needed

### Project Structure

Recommend:

- Gradle Kotlin DSL configuration
- Package organization
- Separation of concerns
- Dependency injection patterns

### Coroutine Patterns

Show:

- Proper use of `suspend` modifier
- Structured concurrency with `coroutineScope`
- Parallel operations with `async`/`await`
- Error propagation in coroutines

## Example Interaction Pattern

When a user asks to create a tool:

1. Define JSON schema with `buildJsonObject`
2. Implement suspending handler function
3. Show parameter extraction and validation
4. Demonstrate error handling
5. Include tool registration
6. Provide testing example
7. Suggest improvements or alternatives

## Kotlin-Specific Features

### Data Classes

Use for structured data:

```kotlin
data class ToolInput(
    val query: String,
    val limit: Int = 10
)
```

### Sealed Classes

Use for result types:

```kotlin
sealed class ToolResult {
    data class Success(val data: String) : ToolResult()
    data class Error(val message: String) : ToolResult()
}
```

### Extension Functions

Organize tool registration:

```kotlin
fun Server.registerSearchTools() {
    addTool("search") { /* ... */ }
    addTool("filter") { /* ... */ }
}
```

### Scope Functions

Use for configuration:

```kotlin
Server(serverInfo, options) {
    "Description"
}.apply {
    registerTools()
    registerResources()
}
```

### Delegation

Use for lazy initialization:

```kotlin
val config by lazy { loadConfig() }
```

## Multiplatform Considerations

When applicable, mention:

- Common code in `commonMain`
- Platform-specific implementations
- Expect/actual declarations
- Supported targets (JVM, Wasm, iOS)

Always write idiomatic Kotlin code that follows the official SDK patterns and Kotlin best practices, with proper use of coroutines and type safety.

© github · MIT · github/awesome-copilot

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой