Increase deprecation levels (#393)

This commit is contained in:
Pavel Gorgulov 2025-11-12 06:15:34 +01:00 • committed by GitHub
commit 2996ce45ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 5 additions and 12 deletions

View file

@ -33,7 +33,7 @@ import kotlin.concurrent.atomics.AtomicBoolean
import kotlin.concurrent.atomics.ExperimentalAtomicApi
import kotlin.time.Duration
@Deprecated("Use SseClientTransport instead", ReplaceWith("SseClientTransport"), DeprecationLevel.WARNING)
@Deprecated("Use SseClientTransport instead", ReplaceWith("SseClientTransport"), DeprecationLevel.ERROR)
public typealias SSEClientTransport = SseClientTransport
/**

View file

@ -1,5 +1,4 @@
public final class io/modelcontextprotocol/kotlin/sdk/server/KtorServerKt {
public static final fun MCP (Lio/ktor/server/application/Application;Lkotlin/jvm/functions/Function1;)V
public static final fun mcp (Lio/ktor/server/application/Application;Lkotlin/jvm/functions/Function1;)V
public static final fun mcp (Lio/ktor/server/routing/Routing;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static final fun mcp (Lio/ktor/server/routing/Routing;Lkotlin/jvm/functions/Function1;)V

View file

@ -60,12 +60,6 @@ public fun Routing.mcp(block: ServerSSESession.() -> Server) {
}
}
@Suppress("FunctionName")
@Deprecated("Use mcp() instead", ReplaceWith("mcp(block)"), DeprecationLevel.ERROR)
public fun Application.MCP(block: ServerSSESession.() -> Server) {
mcp(block)
}
@KtorDsl
public fun Application.mcp(block: ServerSSESession.() -> Server) {
install(SSE)

View file

@ -21,7 +21,7 @@ import kotlin.uuid.Uuid
internal const val SESSION_ID_PARAM = "sessionId"
@Deprecated("Use SseServerTransport instead", ReplaceWith("SseServerTransport"), DeprecationLevel.WARNING)
@Deprecated("Use SseServerTransport instead", ReplaceWith("SseServerTransport"), DeprecationLevel.ERROR)
public typealias SSEServerTransport = SseServerTransport
/**

View file

@ -116,7 +116,7 @@ fun runSseMcpServerWithPlainConfiguration(port: Int, wait: Boolean = true) {
routing {
sse("/sse") {
val transport = SseServerTransport("/message", this)
val serverSession = server.connect(transport)
val serverSession = server.createSession(transport)
serverSessions[transport.sessionId] = serverSession
serverSession.onClose {
@ -197,7 +197,7 @@ fun runMcpServerUsingStdio() {
)
runBlocking {
server.connect(transport)
server.createSession(transport)
val done = Job()
server.onClose {
done.complete()

View file

@ -129,7 +129,7 @@ fun runMcpServer() {
)
runBlocking {
val session = server.connect(transport)
val session = server.createSession(transport)
val done = Job()
session.onClose {
done.complete()