Skip to content

protocol

Class info

Classes

Name Children Inherits
Client
aclientp.client.protocol
Base client interface for ACP.

🛈 DocStrings

Client protocol.

Client

Bases: Protocol

Base client interface for ACP.

Methods with a default body are optional and gated by a capability the client advertises (or by an acp MCP server the client declared).

Source code in src/aclientp/client/protocol.py
@runtime_checkable
class Client(Protocol):
    """Base client interface for ACP.

    Methods with a default body are optional and gated by a capability the client
    advertises (or by an ``acp`` MCP server the client declared).
    """

    async def request_permission(
        self, params: RequestPermissionRequest
    ) -> RequestPermissionResponse: ...

    async def session_update(self, params: SessionNotification) -> None: ...

    async def write_text_file(
        self, params: WriteTextFileRequest
    ) -> WriteTextFileResponse | None: ...

    async def read_text_file(self, params: ReadTextFileRequest) -> ReadTextFileResponse: ...

    async def create_terminal(self, params: CreateTerminalRequest) -> CreateTerminalResponse: ...

    async def terminal_output(self, params: TerminalOutputRequest) -> TerminalOutputResponse: ...

    async def release_terminal(
        self, params: ReleaseTerminalRequest
    ) -> ReleaseTerminalResponse | None: ...

    async def wait_for_terminal_exit(
        self, params: WaitForTerminalExitRequest
    ) -> WaitForTerminalExitResponse: ...

    async def kill_terminal(self, params: KillTerminalRequest) -> KillTerminalResponse | None: ...

    async def elicitation(self, params: ElicitationRequest) -> ElicitationResponse: ...

    async def elicitation_complete(self, params: ElicitationCompleteNotification) -> None: ...

    async def ext_method(self, method: str, params: dict[str, Any]) -> dict[str, Any]: ...

    async def ext_notification(self, method: str, params: dict[str, Any]) -> None: ...

    async def auth_status_update(self, params: AuthStatusUpdateNotification) -> None:
        """**UNSTABLE**: The agent's authentication state changed."""
        return

    async def mcp_message(self, params: MessageMcpRequest) -> MessageMcpResponse:
        """**UNSTABLE**: Inner MCP request to an ``acp`` MCP server the client declared."""
        raise RequestError.method_not_found("mcp/message")

    async def mcp_notification(self, params: MessageMcpNotification) -> None:
        """**UNSTABLE**: Inner MCP notification for an ``acp`` MCP server the client declared."""
        return

auth_status_update async

auth_status_update(params: AuthStatusUpdateNotification) -> None

UNSTABLE: The agent's authentication state changed.

Source code in src/aclientp/client/protocol.py
async def auth_status_update(self, params: AuthStatusUpdateNotification) -> None:
    """**UNSTABLE**: The agent's authentication state changed."""
    return

mcp_message async

mcp_message(params: MessageMcpRequest) -> MessageMcpResponse

UNSTABLE: Inner MCP request to an acp MCP server the client declared.

Source code in src/aclientp/client/protocol.py
async def mcp_message(self, params: MessageMcpRequest) -> MessageMcpResponse:
    """**UNSTABLE**: Inner MCP request to an ``acp`` MCP server the client declared."""
    raise RequestError.method_not_found("mcp/message")

mcp_notification async

mcp_notification(params: MessageMcpNotification) -> None

UNSTABLE: Inner MCP notification for an acp MCP server the client declared.

Source code in src/aclientp/client/protocol.py
async def mcp_notification(self, params: MessageMcpNotification) -> None:
    """**UNSTABLE**: Inner MCP notification for an ``acp`` MCP server the client declared."""
    return