Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading