Описание
Sample projects demonstrating ktmcp server
README
Sample projects demonstrating ktmcp - a Kotlin library for building Model Context Protocol (MCP) servers.
Samples
stdio-basic
MCP server using stdio transport - communicates via stdin/stdout using JSON-RPC. Ideal for CLI tools and local integrations.
Features demonstrated:
- Tools with typed arguments and responses (
@Serializabledata classes) - Tools with untyped arguments (dynamic
argumentsmap) - Dynamic tool/resource creation at runtime
- Prompts with arguments
- Resources with subscription support
- Resource templates with URI parameters
- Session lifecycle hooks
ktor-basic
MCP server using Ktor SSE transport - exposes MCP over HTTP using Server-Sent Events. Ideal for web services and remote integrations.
Features demonstrated:
- Ktor routing integration
- Tools with typed arguments and responses
- Prompts
- Resources with subscriptions
- Accessing Ktor's
ApplicationCalland logger
Requirements
- JDK 21+
- Gradle 8.x
Building
# Build all samples
./gradlew build
# Build fat JAR for stdio-basic (includes all dependencies)
./gradlew :stdio-basic:shadowJar
Running
stdio-basic
# Run directly
./gradlew :stdio-basic:run
# Or run the fat JAR
java -jar stdio-basic/build/libs/stdio-basic.jar
ktor-basic
# Starts HTTP server on port 3001
./gradlew :ktor-basic:run
The MCP endpoint will be available at http://localhost:3001/mcp
Configuration
ktmcp Version
Set the ktmcp version in gradle.properties:
ktmcpVersion=0.7.0
Logging
Both samples use SLF4J SimpleLogger. Configure via src/main/resources/simplelogger.properties:
# Set log level for ktmcp
org.slf4j.simpleLogger.log.org.ktmcp.server=debug
For stdio-basic, logs go to stderr by default (stdout is reserved for JSON-RPC).
License
Apache 2.0
Установка Server Samples
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/ktmcp/server-samplesFAQ
Server Samples MCP бесплатный?
Да, Server Samples MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Server Samples?
Нет, Server Samples работает без API-ключей и переменных окружения.
Server Samples — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Server Samples в Claude Desktop, Claude Code или Cursor?
Открой Server Samples на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Server Samples with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
