From 93b39404a3bad515d5b49c9a95a3dfe19ec5786f Mon Sep 17 00:00:00 2001 From: Julien-ser Date: Wed, 6 May 2026 00:00:33 -0400 Subject: [PATCH 1/2] fix(client): display server stderr logs in Console tab ConsoleTab was a static placeholder that showed no data. The proxy already forwarded MCP server stderr as notifications/message events, but the UI had no dedicated view for them. ConsoleTab now receives the notifications array and renders all notifications/message entries in a terminal-style panel: log levels are color-coded, the view auto-scrolls to the latest entry, and a Clear button lets users dismiss accumulated output without affecting the History/Notifications panel. Fixes #1283 Co-Authored-By: Claude Sonnet 4.6 --- client/src/App.tsx | 2 +- client/src/components/ConsoleTab.tsx | 112 +++++++++++++++++++++++++-- 2 files changed, 105 insertions(+), 9 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 59d15ba06..ebf9f3244 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1643,7 +1643,7 @@ const App = () => { setNotifications((prev) => [...prev, notification]); }} /> - + { void sendMCPRequest( diff --git a/client/src/components/ConsoleTab.tsx b/client/src/components/ConsoleTab.tsx index 8f05f704c..e0c4cb0b6 100644 --- a/client/src/components/ConsoleTab.tsx +++ b/client/src/components/ConsoleTab.tsx @@ -1,12 +1,108 @@ +import { ServerNotification } from "@modelcontextprotocol/sdk/types.js"; +import { useEffect, useRef, useState } from "react"; import { TabsContent } from "@/components/ui/tabs"; +import { Button } from "@/components/ui/button"; -const ConsoleTab = () => ( - -
-
Welcome to MCP Client Console
- {/* Console output would go here */} -
-
-); +const LEVEL_COLORS: Record = { + debug: "text-gray-400", + info: "text-green-400", + notice: "text-blue-300", + warning: "text-yellow-400", + warn: "text-yellow-400", + error: "text-red-400", + critical: "text-red-500", + alert: "text-orange-400", + emergency: "text-red-600", +}; + +const ConsoleTab = ({ + serverLogs = [], +}: { + serverLogs?: ServerNotification[]; +}) => { + const bottomRef = useRef(null); + const [clearedCount, setClearedCount] = useState(0); + + const allLogEntries = serverLogs.filter( + (n) => n.method === "notifications/message", + ); + const logEntries = allLogEntries.slice(clearedCount); + + useEffect(() => { + bottomRef.current?.scrollIntoView({ behavior: "smooth" }); + }, [logEntries.length]); + + return ( + +
+
+ + Server Logs (stderr / MCP logging) + + +
+
+ {logEntries.length === 0 ? ( +
+ No server logs yet. Stderr output and MCP logging notifications + will appear here. +
+ ) : ( +
+ {logEntries.map((notification, index) => { + const params = notification.params as Record; + const level = String(params?.level ?? "info").toLowerCase(); + const logger = String(params?.logger ?? ""); + const data = params?.data; + + let message: string; + if (typeof data === "string") { + message = data; + } else if (typeof data === "object" && data !== null) { + const dataObj = data as Record; + message = + typeof dataObj.message === "string" + ? dataObj.message + : JSON.stringify(data, null, 2); + } else { + message = String(data ?? ""); + } + + const colorClass = LEVEL_COLORS[level] ?? "text-gray-100"; + + return ( +
+ + [{level.toUpperCase().slice(0, 7).padEnd(7)}] + + {logger && logger !== "stdio" && ( + + [{logger}] + + )} + + {message} + +
+ ); + })} +
+
+ )} +
+
+ + ); +}; export default ConsoleTab; From f3c667d9308d119aede24fad271d8eeb849ade6c Mon Sep 17 00:00:00 2001 From: Julien-ser <73262183+Julien-ser@users.noreply.github.com> Date: Wed, 6 May 2026 09:17:06 -0400 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- client/src/components/ConsoleTab.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/components/ConsoleTab.tsx b/client/src/components/ConsoleTab.tsx index e0c4cb0b6..45eb213b1 100644 --- a/client/src/components/ConsoleTab.tsx +++ b/client/src/components/ConsoleTab.tsx @@ -26,6 +26,13 @@ const ConsoleTab = ({ const allLogEntries = serverLogs.filter( (n) => n.method === "notifications/message", ); + + useEffect(() => { + setClearedCount((currentClearedCount) => + Math.min(currentClearedCount, allLogEntries.length), + ); + }, [allLogEntries.length]); + const logEntries = allLogEntries.slice(clearedCount); useEffect(() => {