File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared
kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ public abstract class Protocol(@PublishedApi internal val options: ProtocolOptio
208208 * A handler to invoke for any request types that do not have their own handler installed.
209209 */
210210 public var fallbackRequestHandler: (
211- suspend (request: JSONRPCRequest , extra: RequestHandlerExtra ) -> RequestResult ?
211+ suspend (request: JSONRPCRequest , extra: RequestHandlerExtra ) -> RequestResult ?
212212 )? =
213213 null
214214
Original file line number Diff line number Diff line change @@ -73,8 +73,11 @@ internal class FeatureNotificationService {
7373 notifications.collect { notification ->
7474 when (notification) {
7575 is PromptListChangedNotification -> session.notification(notification)
76+
7677 is ResourceListChangedNotification -> session.notification(notification)
78+
7779 is ToolListChangedNotification -> session.notification(notification)
80+
7881 else -> logger.debug {
7982 " Notification not handled for sessionId ${session.sessionId} : $notification "
8083 }
@@ -118,7 +121,6 @@ internal class FeatureNotificationService {
118121 logger.debug { " Unsubscribed from resourcec update notifications for sessionId: ${session.sessionId} " }
119122 }
120123
121-
122124 private fun emit (notification : Notification ) {
123125 notificationScope.launch {
124126 notifications.emit(notification)
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import kotlinx.collections.immutable.persistentListOf
99import kotlinx.collections.immutable.persistentMapOf
1010import kotlinx.collections.immutable.toPersistentSet
1111
12-
1312/* *
1413 * A listener interface for receiving notifications about feature changes in registry.
1514 */
Original file line number Diff line number Diff line change @@ -215,14 +215,14 @@ public open class Server(
215215 // Register cleanup handler to remove session from list when it closes
216216 session.onClose {
217217 logger.debug { " Removing closed session from active sessions list" }
218- notificationService.unsubscribeFromListChangedNotification(session)
218+ // notificationService.unsubscribeFromListChangedNotification(session)
219219 sessionRegistry.removeSession(session.sessionId)
220220 }
221221 logger.debug { " Server session connecting to transport" }
222222 session.connect(transport)
223223 logger.debug { " Server session successfully connected to transport" }
224224 sessionRegistry.addSession(session)
225- notificationService.subscribeToListChangedNotification(session)
225+ // notificationService.subscribeToListChangedNotification(session)
226226
227227 _onConnect ()
228228 return session
@@ -740,7 +740,7 @@ public open class Server(
740740 public fun <T : Notification > setNotificationHandler (
741741 sessionId : String ,
742742 method : Method ,
743- handler : (notification: T ) -> Deferred <Unit >
743+ handler : (notification: T ) -> Deferred <Unit >,
744744 ) {
745745 sessionRegistry.getSessionOrNull(sessionId)?.setNotificationHandler(method, handler)
746746 }
You can’t perform that action at this time.
0 commit comments