mirror of
https://github.com/coleam00/Archon.git
synced 2025-12-30 13:39:44 -05:00
Critical improvements to MCP server reliability and client experience: Error Handling: - Created MCPErrorFormatter for consistent error responses across all tools - Provides structured errors with type, message, details, and actionable suggestions - Helps clients (like Claude Code) understand and handle failures gracefully - Categorizes errors (connection_timeout, validation_error, etc.) for better debugging Timeout Configuration: - Centralized timeout config with environment variable support - Different timeouts for regular operations vs polling operations - Configurable via MCP_REQUEST_TIMEOUT, MCP_CONNECT_TIMEOUT, etc. - Prevents indefinite hangs when services are unavailable Module Registration: - Distinguishes between ImportError (acceptable) and code errors (must fix) - SyntaxError/NameError/AttributeError now halt execution immediately - Prevents broken code from silently failing in production Polling Safety: - Fixed project creation polling with exponential backoff - Handles API unavailability with proper error messages - Maximum attempts configurable via MCP_MAX_POLLING_ATTEMPTS Response Normalization: - Fixed inconsistent response handling in list_tasks - Validates and normalizes different API response formats - Clear error messages when response format is unexpected These changes address critical issues from PR review while maintaining backward compatibility. All 20 existing tests pass.
21 lines
442 B
Python
21 lines
442 B
Python
"""
|
|
Utility modules for MCP Server.
|
|
"""
|
|
|
|
from .error_handling import MCPErrorFormatter
|
|
from .http_client import get_http_client
|
|
from .timeout_config import (
|
|
get_default_timeout,
|
|
get_max_polling_attempts,
|
|
get_polling_interval,
|
|
get_polling_timeout,
|
|
)
|
|
|
|
__all__ = [
|
|
"MCPErrorFormatter",
|
|
"get_http_client",
|
|
"get_default_timeout",
|
|
"get_polling_timeout",
|
|
"get_max_polling_attempts",
|
|
"get_polling_interval",
|
|
] |