Skip to content

Commit c870fc0

Browse files
Continue making instructions optional. (#107)
1 parent 405a120 commit c870fc0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkgs/dart_mcp/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
which has all supported versions and whether or not they are supported.
3333
- **Breaking**: Change `InitializeRequest` and `InitializeResult` to take a
3434
`ProtocolVersion` instead of a string.
35-
- **Breaking**: Change the `InitializeResult`'s `instructions` to `String?` to reflect
36-
that not all servers return instructions.
35+
- **Breaking**: Change the `InitializeResult`'s `instructions` to `String?` to
36+
reflect that not all servers return instructions.
37+
- Change the `MCPServer.fromStreamChannel` constructor to make the `instructions`
38+
parameter optional.
3739
- **Breaking**: Change `MCPBase` to accept a `StreamChannel<String>` instead of
3840
a `Peer`, and construct its own `Peer`.
3941
- **Breaking**: Add `protocolLogSink` optional parameter to connect methods on

pkgs/dart_mcp/lib/src/server/server.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract base class MCPServer extends MCPBase {
3636
/// Instructions for how to use this server, which are given to the client.
3737
///
3838
/// These may be used in system prompts.
39-
final String instructions;
39+
final String? instructions;
4040

4141
/// The negotiated protocol version.
4242
///
@@ -62,7 +62,7 @@ abstract base class MCPServer extends MCPBase {
6262
MCPServer.fromStreamChannel(
6363
super.channel, {
6464
required this.implementation,
65-
required this.instructions,
65+
this.instructions,
6666
super.protocolLogSink,
6767
}) {
6868
registerRequestHandler(InitializeRequest.methodName, initialize);

0 commit comments

Comments
 (0)