refactor(RunnerClient): redesign existedMetaActions update strategy

Context:
Resource-change events cannot reliably represent tool changes.
The previous approach attempted to externalize descriptive content into files, but the meta attribute of McpSchema.Tool can provide this information.
This commit is contained in:
2025-12-19 23:22:36 +08:00
parent ed042cfffa
commit 1f5509c17d
2 changed files with 41 additions and 13 deletions

View File

@@ -46,6 +46,22 @@ public class RunnerClientTest {
System.out.println(query.toString());
}
@Test
void schemaTest() {
TestRunnerClient testClient = new TestRunnerClient();
RunnerClient.StdioMcpServerParams params = new RunnerClient.StdioMcpServerParams(20, "uvx", Map.of("http_proxy", "http://127.0.0.1:7897", "https_proxy", "http://127.0.0.1:7897"), List.of("mcp-server-fetch"));
testClient.registerMcpClient("test", params);
McpSyncClient client = testClient.mcpClients.values().stream().toList().getFirst();
List<McpSchema.Tool> tools = client.listTools().tools();
System.out.println("\r\n ------ \r\n");
McpSchema.Tool first = tools.getFirst();
Map<String, Object> paramsSchema = first.inputSchema().properties();
System.out.println(paramsSchema.toString());
System.out.println("\r\n ------ \r\n");
Map<String, Object> outputSchema = first.outputSchema();
System.out.println(outputSchema);
}
@Test
void inProcessMcpTransportTest() {
RunnerClient.InProcessMcpTransport.Pair pair = RunnerClient.InProcessMcpTransport.pair();