@@ -9,20 +9,54 @@ type McpErrorRowProps = {
99
1010export const McpErrorRow = ( { error } : McpErrorRowProps ) => {
1111 const color = useMemo ( ( ) => {
12+ // Add debugging to log what level is coming in
13+
14+ // First check for explicitly prefixed stdout messages
15+ if ( error . level === "info" && error . message . startsWith ( "[STDOUT]" ) ) {
16+ // Use regular foreground color for stdout messages
17+ return "var(--vscode-foreground)"
18+ }
19+
20+ // Check if this is a stdout message (mapped to info in backend)
21+ // Common patterns for stdout messages
22+ const isStdoutMessage =
23+ error . level === "info" &&
24+ ( / S e r v e r .* s t d o u t : / . test ( error . message ) ||
25+ / M C P S e r v e r .* r u n n i n g o n s t d i o / . test ( error . message ) ||
26+ / I N F O / i. test ( error . message ) ||
27+ / S e r v e r r u n n i n g / i. test ( error . message ) ||
28+ / D o c u m e n t a t i o n M C P S e r v e r / i. test ( error . message ) ||
29+ / r u n n i n g o n s t d i o / i. test ( error . message ) )
30+
31+ if ( isStdoutMessage ) {
32+ // Use regular foreground color for stdout messages
33+ return "var(--vscode-foreground)"
34+ }
35+
1236 switch ( error . level ) {
1337 case "error" :
1438 return "var(--vscode-testing-iconFailed)"
1539 case "warn" :
1640 return "var(--vscode-charts-yellow)"
1741 case "info" :
42+ // Note: stdout messages are handled above via prefix detection
1843 return "var(--vscode-testing-iconPassed)"
44+ default :
45+ // For any unexpected value, default to error color
46+ console . warn ( `Unknown error level: ${ error . level } ` )
47+ return "var(--vscode-testing-iconFailed)"
1948 }
20- } , [ error . level ] )
49+ } , [ error . level , error . message ] )
50+
51+ // Strip [STDOUT] prefix from the message for cleaner display
52+ const displayMessage = error . message . startsWith ( "[STDOUT]" )
53+ ? error . message . substring ( "[STDOUT]" . length ) . trim ( )
54+ : error . message
2155
2256 return (
2357 < div className = "text-sm bg-vscode-textCodeBlock-background border-l-2 p-2" style = { { borderColor : color } } >
2458 < div className = "mb-1" style = { { color } } >
25- { error . message }
59+ { displayMessage }
2660 </ div >
2761 < div className = "text-xs text-vscode-descriptionForeground" >
2862 { formatRelative ( error . timestamp , new Date ( ) ) }
0 commit comments