diff --git a/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/config/McpServerProperties.java b/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/config/McpServerProperties.java index 293ac7ab7b..030cce8c90 100644 --- a/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/config/McpServerProperties.java +++ b/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/config/McpServerProperties.java @@ -193,7 +193,7 @@ public static class Builder { private Duration requestTimeout = Duration.ofSeconds(10); private Duration initializationTimeout = Duration.ofSeconds(30); private ObjectMapper objectMapper; - private ServerProtocol protocol = ServerProtocol.STATELESS; + private ServerProtocol protocol = ServerProtocol.STREAMABLE; public Builder() { // Private constructor to prevent direct instantiation diff --git a/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/server/handler/McpHttpRequestHandler.java b/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/server/handler/McpHttpRequestHandler.java index f7e73dce8b..62aa71127e 100644 --- a/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/server/handler/McpHttpRequestHandler.java +++ b/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/protocol/server/handler/McpHttpRequestHandler.java @@ -193,7 +193,7 @@ public McpHttpRequestHandler build() { Assert.notNull(this.mcpEndpoint, "MCP endpoint must be set"); if (this.protocol == null) { - this.protocol = ServerProtocol.STATELESS; + this.protocol = ServerProtocol.STREAMABLE; } McpHttpRequestHandler handler = new McpHttpRequestHandler(this.mcpEndpoint, this.objectMapper, this.contextExtractor); diff --git a/core/src/main/java/com/taobao/arthas/core/mcp/ArthasMcpServer.java b/core/src/main/java/com/taobao/arthas/core/mcp/ArthasMcpServer.java index d79557d467..15b7f29bf1 100644 --- a/core/src/main/java/com/taobao/arthas/core/mcp/ArthasMcpServer.java +++ b/core/src/main/java/com/taobao/arthas/core/mcp/ArthasMcpServer.java @@ -59,12 +59,12 @@ public ArthasMcpServer(String mcpEndpoint, CommandExecutor commandExecutor, Stri this.mcpEndpoint = mcpEndpoint != null ? mcpEndpoint : DEFAULT_MCP_ENDPOINT; this.commandExecutor = commandExecutor; - ServerProtocol resolvedProtocol = ServerProtocol.STATELESS; + ServerProtocol resolvedProtocol = ServerProtocol.STREAMABLE; if (protocol != null && !protocol.trim().isEmpty()) { try { resolvedProtocol = ServerProtocol.valueOf(protocol.toUpperCase()); } catch (IllegalArgumentException e) { - logger.warn("Invalid MCP protocol: {}. Using default: STATELESS", protocol); + logger.warn("Invalid MCP protocol: {}. Using default: STREAMABLE", protocol); } } this.protocol = resolvedProtocol;