-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Description
Currently, 0 out of 126 MCP error sites use console.FormatErrorMessage(), making MCP configuration errors appear as plain text without color/emphasis in CLI output. This significantly degrades the debugging experience when users encounter MCP configuration issues.
Background
Identified during MCP Server Integration Quality analysis on 2026-01-23 (discussion #11508). Analysis revealed that while the codebase has excellent console formatting infrastructure in pkg/console/, MCP-related error messages don't use it.
Current state: All 126 fmt.Errorf calls in MCP files output plain text errors
Impact: Errors invisible in CLI output, making MCP debugging significantly harder
Comparison: 1,410 correctly formatted errors in non-MCP code
Files Affected
Priority files (by error count):
pkg/workflow/mcp_config_validation.go- MCP configuration validationpkg/workflow/mcp_gateway_schema_validation.go- Gateway schema validationpkg/cli/mcp_validation.go- CLI validationpkg/cli/mcp_server.go- MCP server commandspkg/cli/mcp_inspect.go- MCP inspectionpkg/workflow/mcp_renderer.go- YAML rendering
Suggested Changes
Pattern to Follow
Before:
return fmt.Errorf("failed to configure MCP server: %w", err)After:
fmt.Fprintln(os.Stderr, console.FormatErrorMessage(err.Error()))
return fmt.Errorf("failed to configure MCP server: %w", err)For user-facing errors, add actionable guidance:
msg := fmt.Sprintf("MCP mode must be 'remote' or 'local', got '%s'\n\nSuggestion: Update your workflow to specify:\n tools:\n github:\n mode: remote", mode)
fmt.Fprintln(os.Stderr, console.FormatErrorMessage(msg))
return fmt.Errorf("invalid MCP mode: %s", mode)Guidelines
- Follow error message style guide in
specs/error-messages.md - Ensure all error paths in MCP validation use console formatting
- Add actionable guidance where appropriate
- Run
make agent-finishto validate changes
Success Criteria
- All
fmt.Errorfcalls in MCP files use console formatting - Error messages follow error message style guide
- Errors include actionable guidance where appropriate
- Test cases verify error formatting
- Console formatting applied to at least 126 error sites
-
make agent-finishpasses
Priority
High - Critical for CLI UX - makes MCP errors visible and debuggable
Estimated effort: Medium (2-3 hours across multiple files)
Source
Extracted from MCP Server Integration Quality analysis discussion #11508
Analysis quote:
"3. Error Message Invisibility (Critical)
- 0/126 MCP error sites use
console.FormatErrorMessage- Errors invisible in CLI output- 126
fmt.Errorfcalls without console formatting- Compare to 1,410 correctly formatted errors in non-MCP code
Impact: MCP configuration errors appear as plain text without color/emphasis, making debugging significantly harder."
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 6, 2026, 2:07 PM UTC