From 069b966ea2c58ff939e4a7846461c89adeaf47f2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 09:36:39 +0000 Subject: [PATCH 1/2] Initial plan From b253fc5ff2fe80cedf06e9bf24d26c866220622d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 09:44:19 +0000 Subject: [PATCH 2/2] Fix NullPointerException when MCP is disabled Add null check for mcpRequestHandler before accessing getMcpEndpoint() method. This prevents NullPointerException when arthas.mcpEndpoint is set to empty string (MCP disabled) and accessing endpoints like /arthas-output/. Co-authored-by: hengyunabc <1683936+hengyunabc@users.noreply.github.com> --- .../shell/term/impl/http/HttpRequestHandler.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/taobao/arthas/core/shell/term/impl/http/HttpRequestHandler.java b/core/src/main/java/com/taobao/arthas/core/shell/term/impl/http/HttpRequestHandler.java index 043232ecb8c..dd6e2c08de4 100644 --- a/core/src/main/java/com/taobao/arthas/core/shell/term/impl/http/HttpRequestHandler.java +++ b/core/src/main/java/com/taobao/arthas/core/shell/term/impl/http/HttpRequestHandler.java @@ -76,11 +76,13 @@ protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) } //handle mcp request - String mcpEndpoint = mcpRequestHandler.getMcpEndpoint(); - if (mcpEndpoint.equals(path)) { - mcpRequestHandler.handle(ctx, request); - isMcpHandled = true; - return; + if (mcpRequestHandler != null) { + String mcpEndpoint = mcpRequestHandler.getMcpEndpoint(); + if (mcpEndpoint.equals(path)) { + mcpRequestHandler.handle(ctx, request); + isMcpHandled = true; + return; + } } //handle webui requests