Skip to content

Continue making instructions optional. #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkgs/dart_mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>` instead of
a `Peer`, and construct its own `Peer`.
- **Breaking**: Add `protocolLogSink` optional parameter to connect methods on
Expand Down
4 changes: 2 additions & 2 deletions pkgs/dart_mcp/lib/src/server/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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);
Expand Down