解决,Ai Agent mcp 使用sdtio方式连接报错
报错内容如下:

可以切换为SSE连接方式:
java
public McpSyncClient stdioMcpClient_Grafana() {
HttpClientSseClientTransport sseClientTransport = HttpClientSseClientTransport.builder("http://localhost:8000/")
.sseEndpoint("sse??GRAFANA_API_KEY=glsa_BiyejL4sRxcQyva3Zu9LMH0h53dxrzZl_626d63c6").build();
McpSyncClient mcpSyncClient = McpClient.sync(sseClientTransport).requestTimeout(Duration.ofMinutes(180)).build();
var init = mcpSyncClient.initialize();
System.out.println("SSE MCP Initialized: " + init);
return mcpSyncClient;}