You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 17913c2
Browse filesBrowse the repository at this point in the historyBrowse files
Let prompts and resource templates define their own completions
Completion in the modern server was a single function registered through
CompletionsFeature. It received every completion/complete request, so it had
to know about every prompt and resource template and keep its own copy of
which arguments each of them takes.
A prompt now carries its completion handler, set with
McpSyncPrompt.withCompletionHandler, and a resource template does the same
through the new McpSyncResourceTemplate, which a resource repository returns
from findTemplate(ctx, uriTemplate). A repository opts in with
supportsCompletion(), as it already does for subscriptions with
supportsSubscribe(). The server then serves completion/complete and
advertises completions on its own; there is no feature to register.
The server rejects a reference to an unknown prompt or template, or an
argument it does not declare, with invalid params, and answers with no
values when a prompt or template has no completion handler. Custom features
can complete their own reference types through
McpFeature.completionRefTypes() and McpFeature.complete().
CompletionsFeature and McpSync/AsyncCompletionRepository are removed; the
completion function itself is now McpSync/AsyncCompletionHandler.
This brings completions in line with the rest of the modern feature model,
where each feature is responsible for its own primitives.
Fixes#1312
Signed-off-by: Dariusz Jedrzejczyk <2554306+chemicL@users.noreply.github.com>
Copy file name to clipboardExpand all lines: conformance-tests/server-servlet-modern/src/main/java/io/modelcontextprotocol/conformance/server/modern/ModernConformanceServlet.java
0 commit comments