# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.mcp_server_info import McpServerInfo
from .raw_client import AsyncRawMcpClient, RawMcpClient


class McpClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMcpClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawMcpClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawMcpClient
        """
        return self._raw_client

    def list_mcp_servers(
        self,
        *,
        action_count: typing.Optional[bool] = None,
        organization_id: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[McpServerInfo]:
        """
        List available MCP servers.

        Adapts the MCPConfiguration model to the frontend's MCPServerInfoType expectation.

        Parameters
        ----------
        action_count : typing.Optional[bool]

        organization_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[McpServerInfo]
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.mcp.list_mcp_servers()
        """
        _response = self._raw_client.list_mcp_servers(
            action_count=action_count, organization_id=organization_id, request_options=request_options
        )
        return _response.data


class AsyncMcpClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMcpClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawMcpClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawMcpClient
        """
        return self._raw_client

    async def list_mcp_servers(
        self,
        *,
        action_count: typing.Optional[bool] = None,
        organization_id: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[McpServerInfo]:
        """
        List available MCP servers.

        Adapts the MCPConfiguration model to the frontend's MCPServerInfoType expectation.

        Parameters
        ----------
        action_count : typing.Optional[bool]

        organization_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[McpServerInfo]
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.mcp.list_mcp_servers()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_mcp_servers(
            action_count=action_count, organization_id=organization_id, request_options=request_options
        )
        return _response.data
