fix(mcp): add debug/warning logging for server connection attempts and failures - #331
Open
sridhar-3009 wants to merge 1 commit into
Open
fix(mcp): add debug/warning logging for server connection attempts and failures#331sridhar-3009 wants to merge 1 commit into
sridhar-3009 wants to merge 1 commit into
Conversation
…d failures MCP server connection failures were silently caught and stored in status objects only. With --verbose --debug, users saw no indication that OpenHarness was even attempting to connect to their configured servers, and no actionable error when the connection failed. Add structured logging to McpClientManager: - debug log before each connection attempt (transport + address/command) - debug log on successful connect with tool/resource count - warning log on failure with the full error detail The same warning-level log fires for unsupported transport types (e.g. a WebSocket server in a build that only ships stdio + HTTP) so the failure is visible in --verbose output rather than being silently recorded in the status dict. Relates to HKUDS#315
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Relates to #315
When users configure MCP servers and run
oh --verbose --debug, they saw no indication that OpenHarness was even trying to connect — and no actionable error when a connection failed. The failures were silently caught inconnect_all()/_connect_stdio()/_connect_http()and stored in the status dict, but never emitted to any logger.Added logging in
McpClientManager:MCP: connecting to server 'mcp-mini' (transport=http)MCP: connecting to HTTP server 'mcp-mini' at http://…/jsonrpcMCP: spawning stdio process for 'mcp-server': npx …MCP: 'mcp-mini' connected — 3 tools, 0 resourcesMCP: 'mcp-mini' failed to connect — <error detail>MCP: server 'ws-server' skipped — Unsupported MCP transport: wsNow
oh --verbosesurfaces connection failures at WARNING level (always visible) and--debugadds connection-attempt detail so users can trace exactly where things go wrong.Test plan
oh --debug— verify connection attempt and success appear in output.oh --verbose— verify warning appears with the error detail.