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
As part of the [Completion capabilities](/specification/2025-03-26/server/utilities/completion), MCP provides a provides a standardized way for servers to offer argument autocompletion suggestions for prompts and resource URIs.
353
+
354
+
Check the [Server Completion capabilities](/sdk/java/mcp-server#completion-specification) to learn how to enable and configure completions on the server side.
355
+
356
+
On the client side, the MCP client provides methods to request auto-completions:
@@ -374,7 +375,7 @@ The Prompt Specification is a structured template for AI model interactions that
374
375
<Tabtitle="Sync">
375
376
```java
376
377
// Sync prompt specification
377
-
var syncPromptSpecification =newMcpServerFeatures.syncPromptSpecification(
378
+
var syncPromptSpecification =newMcpServerFeatures.SyncPromptSpecification(
378
379
newPrompt("greeting", "description", List.of(
379
380
newPromptArgument("name", "description", true)
380
381
)),
@@ -389,7 +390,7 @@ var syncPromptSpecification = new McpServerFeatures.syncPromptSpecification(
389
390
<Tabtitle="Async">
390
391
```java
391
392
// Async prompt specification
392
-
var asyncPromptSpecification =newMcpServerFeatures.asyncPromptSpecification(
393
+
var asyncPromptSpecification =newMcpServerFeatures.AsyncPromptSpecification(
393
394
newPrompt("greeting", "description", List.of(
394
395
newPromptArgument("name", "description", true)
395
396
)),
@@ -406,6 +407,82 @@ The prompt definition includes name (identifier for the prompt), description (pu
406
407
The handler function processes requests and returns formatted templates.
407
408
The first argument is `McpAsyncServerExchange` for client interaction, and the second argument is a `GetPromptRequest` instance.
408
409
410
+
### Completion Specification
411
+
412
+
As part of the [Completion capabilities](/specification/2025-03-26/server/utilities/completion), MCP provides a provides a standardized way for servers to offer argument autocompletion suggestions for prompts and resource URIs.
413
+
414
+
<Tabs>
415
+
<Tabtitle="Sync">
416
+
```java
417
+
// Sync completion specification
418
+
var syncCompletionSpecification =newMcpServerFeatures.SyncCompletionSpecification(
The `McpSchema.CompletionReference` definition defines the type (`PromptRefernce` or `ResourceRefernce`) and the identifier for the completion specification (e.g handler).
479
+
The handler function processes requests and returns the complition response.
480
+
The first argument is `McpAsyncServerExchange` for client interaction, and the second argument is a `CompleteRequest` instance.
481
+
482
+
483
+
Check the [using completion](/sdk/java/mcp-client#using-completion) to learn how to use the completion capabilities on the client side.
484
+
485
+
409
486
### Using Sampling from a Server
410
487
411
488
To use [Sampling capabilities](/specification/2024-11-05/client/sampling/), connect to a client that supports sampling.
0 commit comments