"""
MCP Client Service Package

Provides infrastructure for communicating with MCP (Model Context Protocol)
servers. This is the foundation for AI agent tool integration.

Usage:
    from app.services.mcp import get_mcp_client, MCPClientManager

    # In FastAPI route
    async def my_route(mcp: MCPClientManager = Depends(get_mcp_client)):
        result = await mcp.call_tool("llm-gateway", "chat", {"prompt": "Hello"})

    # Direct usage
    manager = MCPClientManager()
    await manager.initialize()
    result = await manager.call_tool("issues", "create_issue", {...})
    await manager.shutdown()
"""

from .client_manager import (
    MCPClientManager,
    ServerHealth,
    get_mcp_client,
    reset_mcp_client,
    shutdown_mcp_client,
)
from .config import (
    MCPConfig,
    MCPServerConfig,
    TransportType,
    create_default_config,
    load_mcp_config,
)
from .connection import ConnectionPool, ConnectionState, MCPConnection
from .exceptions import (
    MCPCircuitOpenError,
    MCPConnectionError,
    MCPError,
    MCPServerNotFoundError,
    MCPTimeoutError,
    MCPToolError,
    MCPToolNotFoundError,
    MCPValidationError,
)
from .registry import MCPServerRegistry, ServerCapabilities, get_registry
from .routing import AsyncCircuitBreaker, CircuitState, ToolInfo, ToolResult, ToolRouter

__all__ = [
    # Main facade
    "MCPClientManager",
    "get_mcp_client",
    "shutdown_mcp_client",
    "reset_mcp_client",
    "ServerHealth",
    # Configuration
    "MCPConfig",
    "MCPServerConfig",
    "TransportType",
    "load_mcp_config",
    "create_default_config",
    # Registry
    "MCPServerRegistry",
    "ServerCapabilities",
    "get_registry",
    # Connection
    "ConnectionPool",
    "ConnectionState",
    "MCPConnection",
    # Routing
    "ToolRouter",
    "ToolInfo",
    "ToolResult",
    "AsyncCircuitBreaker",
    "CircuitState",
    # Exceptions
    "MCPError",
    "MCPConnectionError",
    "MCPTimeoutError",
    "MCPToolError",
    "MCPServerNotFoundError",
    "MCPToolNotFoundError",
    "MCPCircuitOpenError",
    "MCPValidationError",
]
