MCPServer.fromStreamChannel constructor

MCPServer.fromStreamChannel(
  1. StreamChannel<String> channel, {
  2. required Implementation implementation,
  3. String? instructions,
  4. Sink<String>? protocolLogSink,
})

Implementation

MCPServer.fromStreamChannel(
  super.channel, {
  required this.implementation,
  this.instructions,
  super.protocolLogSink,
}) {
  registerRequestHandler(InitializeRequest.methodName, initialize);

  registerNotificationHandler(
    InitializedNotification.methodName,
    handleInitialized,
  );
}