feat: structured MCP error codes and failure diagnostics (closes #6352)#6529
Open
vakrahul wants to merge 1 commit intoaden-hive:mainfrom
Open
feat: structured MCP error codes and failure diagnostics (closes #6352)#6529vakrahul wants to merge 1 commit intoaden-hive:mainfrom
vakrahul wants to merge 1 commit intoaden-hive:mainfrom
Conversation
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.
feat: Structured MCP error codes & failure diagnostics (closes #6352)
Summary
Implements structured error handling across MCP registry operations so
users can quickly self-diagnose issues instead of seeing raw Python
tracebacks.
Changes
New:
core/framework/runner/mcp_errors.pyMCPErrorCodeenum with all 7 required error codes:MCP_INSTALL_FAILED,MCP_AUTH_MISSING,MCP_CONNECT_TIMEOUT,MCP_TOOL_NOT_FOUND,MCP_PROTOCOL_MISMATCH,MCP_VERSION_CONFLICT,MCP_HEALTH_FAILEDMCPErrorbase class enforcing What/why/fix message formatMCPToolNotFoundError,MCPAuthError,MCPInstallError,MCPConnectTimeoutError,MCPProtocolMismatchError,MCPVersionConflictError,MCPHealthCheckErrorModified:
core/framework/runner/mcp_client.pyValueErrorincall_toolwithMCPToolNotFoundError[Server: X] [Transport: Y]context to all tool callerror paths in
_call_tool_stdio_asyncand_call_tool_httpModified:
core/framework/runner/tool_registry.pyregister_mcp_servernow emits structured log on both successand failure:
{server, status, tools_loaded, skipped_reason}New:
core/tests/test_mcp_errors.pyRequirements Covered
Note
mcp_registry.pydoes not yet exist in the codebase — it is beingcreated in #6349 by @Antiarin.