"""MCP client adapter — bridge external MCP servers into the ToolRegistry.

Connects to MCP servers (stdio or HTTP transport), discovers their tools,
and registers each as a native ``ToolOutput``-returning handler so pathways
get structured data for deterministic branching.

Requires the optional ``mcp`` dependency::

    pip install albusos[mcp]

Usage::

    from infrastructure.mcp import connect_mcp, McpConnection

    conn = await connect_mcp("servicem8", command=["python", "-m", "servicem8_mcp"])
    # Tools now available as servicem8.list_records, servicem8.get_record, …
    await conn.close()
"""

from __future__ import annotations

try:
    from infrastructure.mcp.adapter import connect_mcp
    from infrastructure.mcp.client import McpConnection
except ImportError:  # mcp package not installed
    pass

__all__ = [
    "McpConnection",
    "connect_mcp",
]
