From 9c40d094a898a25163121dc4460e27d65a3c3347 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Sun, 4 May 2025 09:18:59 +1000 Subject: [PATCH 1/2] Continue making `instructions` optional. --- pkgs/dart_mcp/lib/src/server/server.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/dart_mcp/lib/src/server/server.dart b/pkgs/dart_mcp/lib/src/server/server.dart index 0f07fd8..875f411 100644 --- a/pkgs/dart_mcp/lib/src/server/server.dart +++ b/pkgs/dart_mcp/lib/src/server/server.dart @@ -36,7 +36,7 @@ abstract base class MCPServer extends MCPBase { /// Instructions for how to use this server, which are given to the client. /// /// These may be used in system prompts. - final String instructions; + final String? instructions; /// The negotiated protocol version. /// @@ -62,7 +62,7 @@ abstract base class MCPServer extends MCPBase { MCPServer.fromStreamChannel( super.channel, { required this.implementation, - required this.instructions, + this.instructions, super.protocolLogSink, }) { registerRequestHandler(InitializeRequest.methodName, initialize); From 53a73f8525a674ea559680e03577db05ffc1b023 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Sun, 4 May 2025 09:27:26 +1000 Subject: [PATCH 2/2] Update CHANGELOG.md --- pkgs/dart_mcp/CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/dart_mcp/CHANGELOG.md b/pkgs/dart_mcp/CHANGELOG.md index 8d60db5..16c8b17 100644 --- a/pkgs/dart_mcp/CHANGELOG.md +++ b/pkgs/dart_mcp/CHANGELOG.md @@ -32,8 +32,10 @@ which has all supported versions and whether or not they are supported. - **Breaking**: Change `InitializeRequest` and `InitializeResult` to take a `ProtocolVersion` instead of a string. -- **Breaking**: Change the `InitializeResult`'s `instructions` to `String?` to reflect - that not all servers return instructions. +- **Breaking**: Change the `InitializeResult`'s `instructions` to `String?` to + reflect that not all servers return instructions. +- Change the `MCPServer.fromStreamChannel` constructor to make the `instructions` + parameter optional. - **Breaking**: Change `MCPBase` to accept a `StreamChannel` instead of a `Peer`, and construct its own `Peer`. - **Breaking**: Add `protocolLogSink` optional parameter to connect methods on