Implement auto completion #47
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds explicit support for the Completions capability in accordance with the MCP 2025-06-18 specification. The changes introduce a new
ServerCapabilitiesCompletionsclass, update the server and client logic to use this explicit capability, and provide comprehensive tests and examples to demonstrate and validate the new behavior.Completions Capability Support:
ServerCapabilitiesCompletionsclass to represent completions-related capabilities, including an optionallistChangedfield. (lib/src/types.dartlib/src/types.dartR534-R553)ServerCapabilitiesclass to include a newcompletionsfield, with appropriate serialization and deserialization logic. (lib/src/types.dart[1] [2]completionscapability for completion-related requests, rather than inferring support from prompts or resources. (lib/src/client/client.dartlib/src/client/client.dartL152-R153)Documentation and Examples:
completions_capability_demo.dart) demonstrating how to declare and use the completions capability, including resource and prompt argument completion. (example/completions_capability_demo.dartexample/completions_capability_demo.dartR1-R162)README.mdto mention the new Completions capability. (README.mdREADME.mdR27)CHANGELOG.mdwith details of the new capability and related changes. (CHANGELOG.mdCHANGELOG.mdR1-R8)Testing:
test/integration/completions_capability_test.darttest/integration/completions_capability_test.dartR1-R105)ServerCapabilitiesCompletionsclass and its integration withServerCapabilities. (test/types_test.darttest/types_test.dartR71-R105)