feat: Implement completion handling for prompts and resources - #54
Open
FlySky-z wants to merge 1 commit into
Open
feat: Implement completion handling for prompts and resources#54FlySky-z wants to merge 1 commit into
FlySky-z wants to merge 1 commit into
Conversation
FlySky-z
force-pushed
the
dev_completion
branch
from
August 13, 2025 15:10
037c8c8 to
1841c00
Compare
FlySky-z
force-pushed
the
dev_completion
branch
from
August 20, 2025 16:29
5df1ded to
25bdd67
Compare
FlySky-z
force-pushed
the
dev_completion
branch
2 times, most recently
from
September 3, 2025 14:07
23e3d81 to
911f4cf
Compare
FlySky-z
force-pushed
the
dev_completion
branch
from
September 16, 2025 13:12
911f4cf to
5c24d6a
Compare
- Added completionCompleteHandler to registeredPrompt and registeredResource for handling completion requests. - Refactored handleCompletionComplete methods in promptManager and resourceManager to utilize new completion handlers. - Added utility functions for extracting parameters from JSON-RPC requests. - Updated lifecycleManager to check for completion availability in both prompt and resource managers. - Implemented tests for completion handling in both promptManager and resourceManager, ensuring correct behavior for valid and invalid requests.
FlySky-z
force-pushed
the
dev_completion
branch
from
September 26, 2025 08:28
5c24d6a to
de6661d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Complete Issue #19
This pull request adds support for parameter auto-completion for prompts and resources to the MCP client/server framework. It introduces new completion handlers and updates both the server and client example applications to demonstrate and utilize these features. The changes are grouped into API extensions, server-side handler implementations, and client-side demonstration updates.
API Extensions
CompleteCompletionmethod to theConnectorinterface and implemented it in the client, enabling parameter auto-completion for prompts and resource URIs.Server-side Handler Implementations
When registering prompt and resource, add the
optionparameter to inject parameters such asCompletionCompleteHandlerRegistered new completion handlers for resources and prompts, including resource completion, resource template completion, and prompt argument completion (e.g., language suggestions for code review).
Updated the handler dispatch logic to route completion requests based on reference type (prompt or resource).
Added
errors.ErrMethodNotFoundfor indicating that a method has not been registered.Added handling of panic situations in
handleReadResourceinmanager_resourcewhen the handler isnilduring registration.Client-side Demonstration Updates
These changes provide a foundation for interactive auto-completion in the MCP framework, improving usability for both prompt and resource operations.