Update Kotlin-MCP-Server with STDIO support, logging & CORS (#371)
Update Kotlin-MCP-Server with STDIO support, logging & CORS ### Summary - Added support for STDIO transport mode (default behavior). - Configured CORS and migrated SSE server to Ktor's Netty engine. - Redirected logs to `./build/stdout.log` and updated log levels. - New `TestEnvironment` setup for integration testing. - Enhanced documentation with examples for server execution and MCP Inspector usage. - Introduced shadow JAR plugin for building runnable artifacts. ### Motivation and Context Improves server versatility and developer experience by enabling STDIO and refining setup. ## How Has This Been Tested? Unit tests, tested locally (see README.md in sample) **NB! sse plain configuration is not working at the moment** ## Breaking Changes No ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ ] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [ ] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context <!-- Add any other context, implementation notes, or design decisions -->
This commit is contained in:
parent
e4bd866fdd
commit
dc4386f0f1
1 changed files with 172 additions and 69 deletions
|
|
@ -1,6 +1,7 @@
|
|||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
alias(libs.plugins.shadow)
|
||||
application
|
||||
}
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ dependencies {
|
|||
implementation(dependencies.platform(libs.ktor.bom))
|
||||
implementation(libs.mcp.kotlin.server)
|
||||
implementation(libs.ktor.server.cio)
|
||||
implementation(libs.ktor.server.cors)
|
||||
implementation(libs.slf4j.simple)
|
||||
|
||||
testImplementation(libs.mcp.kotlin.client)
|
||||
|
|
@ -28,4 +30,10 @@ tasks.test {
|
|||
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
compilerOptions {
|
||||
javaParameters = true
|
||||
freeCompilerArgs.addAll(
|
||||
"-Xdebug",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue