Skip to content
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
3 changes: 3 additions & 0 deletions pkgs/dart_mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
- Add new `package:dart_mcp/stdio.dart` library with a `stdioChannel` utility
for creating a stream channel that separates messages by newlines.
- Added more examples.
- Deprecated the `WithElicitationHandler` interface - the method this required
is now defined directly on the `ElicitationSupport` mixin which matches the
pattern used by other mixins in this package.
- Change the `schema` parameter for elicitation requests to an `ObjectSchema` to
match the spec.
- Deprecate the `Elicitations` server capability, this doesn't exist in the spec.
Expand Down
14 changes: 11 additions & 3 deletions pkgs/dart_mcp/lib/src/client/elicitation_support.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@

part of 'client.dart';

/// The interface for handling elicitation requests.
///
/// Any client using [ElicitationSupport] must implement this interface.
@Deprecated(
'This interface is going away, the method will exist directly on the '
'ElicitationSupport mixin instead',
)
abstract interface class WithElicitationHandler {
FutureOr<ElicitResult> handleElicitation(ElicitRequest request);
}

/// A mixin that adds support for the `elicitation` capability to an
/// [MCPClient].
// ignore: deprecated_member_use_from_same_package
base mixin ElicitationSupport on MCPClient implements WithElicitationHandler {
@override
void initialize() {
capabilities.elicitation ??= ElicitationCapability();
super.initialize();
}

/// The method for handling elicitation requests.
///
/// Any client using [ElicitationSupport] must implement this interface.
@override
FutureOr<ElicitResult> handleElicitation(ElicitRequest request);
}