Add Bulk Operations for tools
Maintainer antworten meist innerhalb von 3 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Beginne damit, die Server-APIs rund um addTool, removeTool, asyncServer sowie die im Issue gezeigten Konvertierungen von SyncToolSpecification/AsyncToolSpecification zu lokalisieren. Prüfe, wie die aktuellen Copy-on-Write-Aktualisierungen übernommen werden, implementiere anschließend Bulk-Einstiegspunkte zum Hinzufügen und Entfernen mit einem dem Verhalten für einzelne Elemente entsprechenden Verhalten und stelle sicher, dass eine Bulk-Operation wiederholte Kopien vermeidet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
So I am trying to submit a trivial change, but before I do that, I would like to know if this change will be acceptable. The idea is that today the MCP server does not support bulk operations for add tools or remove tools, and it is backed by a copy-on-write array list. So if I add a lot of tools, then every single time there is a copy that happens before a single tool gets committed, and that's not that great for performance when I would like to make changes to a lot of tools, for example.
Expected Behavior
Expected behavior is rather simple: I would like an API that lets me add several tools in bulk and that lets me remove several tools in bulk as well.
/**
* Add a new tool specification at runtime.
* @param toolSpecification The tool specification to add
*/
public void addTool(McpStatelessServerFeatures.SyncToolSpecification toolSpecification) {
this.asyncServer
.addTool(McpStatelessServerFeatures.AsyncToolSpecification.fromSync(toolSpecification,
this.immediateExecution))
.block();
}
/**
* Add multiple tool specifications at runtime.
* @param toolSpecifications The tool specifications to add
*/
public void addTools(List<McpStatelessServerFeatures.SyncToolSpecification> toolSpecifications) {
if (toolSpecifications == null) {
this.asyncServer.addTools(null).block();
return;
}
this.asyncServer
.addTools(toolSpecifications.stream()
.map(toolSpecification -> McpStatelessServerFeatures.AsyncToolSpecification.fromSync(toolSpecification,
this.immediateExecution))
.toList())
.block();
}
Current Behavior
The current behavior is that it just has a single method for add and remove
/**
* Add a new tool specification at runtime.
* @param toolSpecification The tool specification to add
*/
public void addTool(McpStatelessServerFeatures.SyncToolSpecification toolSpecification) {
this.asyncServer
.addTool(McpStatelessServerFeatures.AsyncToolSpecification.fromSync(toolSpecification,
this.immediateExecution))
.block();
}
Context
The reason we need this is because we are trying to create what sort of looks like an MCP gateway. For a lot of our internal tooling, these tool definitions come from a database. These tools can get enabled and disabled at runtime. There is also a use case where we interact with a lot of upstream MCP clients and publish out their tools as tools that we own ourselves. If one of those MCP clients goes bad or unhealthy for whatever reason or tries to remove the tools that we have access to, then that same thing should reflect for our clients as well, and it will be great to have that capability because if an MCP client or several MCP clients try to remove their tool all at once, we're looking at hundreds or tens of removals in a single shot. In some cases, maybe even hundreds or hundreds if we are dealing with two or three bigger MCP clients. That's the reason why we need this.
FYI, I have a PR that is already ready that I can immediately push if you guys think this is an acceptable change to introduce or allow addition and removal of tools in bulk.
- Vorherrschende Sprache
- Java
- Sterne
- 3.7k
- Forks
- 1.1k
- Ø Merge
- 2 T. 5 Std.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/java-sdk
-
HttpServletStreamableServerTransportProvider: GET stream sends no status or headers until the first eventEvtl. vergeben @karthiksenv hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
modelcontextprotocol/java-sdk#1155 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Client request handlers that complete empty send no JSON-RPC responseEvtl. vergeben @1fanwang hat das vor 31 Tagen übernommen. Offenarea/client bug P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
modelcontextprotocol/java-sdk#1124 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
ServerCapabilities.logging is added unconditionally, overriding the caller's explicit capabilitiesEvtl. vergeben @1yuxiangJ hat das vor 46 Tagen übernommen. Offenbug P2 ready for work
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
modelcontextprotocol/java-sdk#1086 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Reject listRoots if not supported by client, without sending any requestEvtl. vergeben @nikita-kibitkin hat das vor 70 Tagen übernommen. Offenenhancement good first issue P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
modelcontextprotocol/java-sdk#1067 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
-
StdioClientTransport missing explicit UTF-8 charset in InputStreamReader (same issue as #295, but on client side)Evtl. vergeben @suryateja-g13 hat das vor 141 Tagen übernommen. Offenbug P2 ready for work
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
modelcontextprotocol/java-sdk#898 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in modelcontextprotocol/java-sdk
Ähnliche Issues
-
Clarify Javadoc for Logger methods taking Object... arguments with regards to Throwable detectionOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
[Bug] The shared instance selector's placeholder and no-match text ignore the display languageEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
apache/rocketmq-dashboard#5561 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
HMCL-dev/HMCL#6934 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
test(setup): GitHub configuration tests fail when the temp path is long enough for YAML foldingEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug good first issue help wanted priority medium size S
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
martin-francois/symphony-trello#776 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag