Skip to content

Commit d8be68c

Browse files
committed
feat: Add task related things to schema
Signed-off-by: He-Pin <[email protected]>
1 parent 86991c1 commit d8be68c

File tree

5 files changed

+643
-41
lines changed

5 files changed

+643
-41
lines changed

mcp-core/src/main/java/io/modelcontextprotocol/client/McpClientFeatures.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ public Async(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities c
106106
: new McpSchema.ClientCapabilities(null,
107107
!Utils.isEmpty(roots) ? new McpSchema.ClientCapabilities.RootCapabilities(false) : null,
108108
samplingHandler != null ? new McpSchema.ClientCapabilities.Sampling() : null,
109-
elicitationHandler != null ? new McpSchema.ClientCapabilities.Elicitation() : null);
109+
elicitationHandler != null ? new McpSchema.ClientCapabilities.Elicitation() : null, null // TODO
110+
// task
111+
// management
112+
// capabilities
113+
);
110114
this.roots = roots != null ? new ConcurrentHashMap<>(roots) : new ConcurrentHashMap<>();
111115

112116
this.toolsChangeConsumers = toolsChangeConsumers != null ? toolsChangeConsumers : List.of();
@@ -256,7 +260,11 @@ public Sync(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities cl
256260
: new McpSchema.ClientCapabilities(null,
257261
!Utils.isEmpty(roots) ? new McpSchema.ClientCapabilities.RootCapabilities(false) : null,
258262
samplingHandler != null ? new McpSchema.ClientCapabilities.Sampling() : null,
259-
elicitationHandler != null ? new McpSchema.ClientCapabilities.Elicitation() : null);
263+
elicitationHandler != null ? new McpSchema.ClientCapabilities.Elicitation() : null, null // TODO
264+
// task
265+
// management
266+
// capabilities
267+
);
260268
this.roots = roots != null ? new HashMap<>(roots) : new HashMap<>();
261269

262270
this.toolsChangeConsumers = toolsChangeConsumers != null ? toolsChangeConsumers : List.of();

mcp-core/src/main/java/io/modelcontextprotocol/server/McpServerFeatures.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ record Async(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities s
8080
!Utils.isEmpty(prompts) ? new McpSchema.ServerCapabilities.PromptCapabilities(false) : null,
8181
!Utils.isEmpty(resources)
8282
? new McpSchema.ServerCapabilities.ResourceCapabilities(false, false) : null,
83-
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null);
83+
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null,
84+
null // TODO Task management
85+
);
8486

8587
this.tools = (tools != null) ? tools : List.of();
8688
this.resources = (resources != null) ? resources : Map.of();
@@ -195,7 +197,9 @@ record Sync(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities se
195197
!Utils.isEmpty(prompts) ? new McpSchema.ServerCapabilities.PromptCapabilities(false) : null,
196198
!Utils.isEmpty(resources)
197199
? new McpSchema.ServerCapabilities.ResourceCapabilities(false, false) : null,
198-
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null);
200+
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null,
201+
null // TODO Task management
202+
);
199203

200204
this.tools = (tools != null) ? tools : new ArrayList<>();
201205
this.resources = (resources != null) ? resources : new HashMap<>();

mcp-core/src/main/java/io/modelcontextprotocol/server/McpStatelessServerFeatures.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ record Async(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities s
7474
!Utils.isEmpty(prompts) ? new McpSchema.ServerCapabilities.PromptCapabilities(false) : null,
7575
!Utils.isEmpty(resources)
7676
? new McpSchema.ServerCapabilities.ResourceCapabilities(false, false) : null,
77-
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null);
77+
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null,
78+
null // TODO task management
79+
);
7880

7981
this.tools = (tools != null) ? tools : List.of();
8082
this.resources = (resources != null) ? resources : Map.of();
@@ -175,7 +177,9 @@ record Sync(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities se
175177
!Utils.isEmpty(prompts) ? new McpSchema.ServerCapabilities.PromptCapabilities(false) : null,
176178
!Utils.isEmpty(resources)
177179
? new McpSchema.ServerCapabilities.ResourceCapabilities(false, false) : null,
178-
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null);
180+
!Utils.isEmpty(tools) ? new McpSchema.ServerCapabilities.ToolCapabilities(false) : null,
181+
null // TODO task management
182+
);
179183

180184
this.tools = (tools != null) ? tools : new ArrayList<>();
181185
this.resources = (resources != null) ? resources : new HashMap<>();

0 commit comments

Comments
 (0)