Skip to content

cayu.mcp.http

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.mcp import DEFAULT_HTTP_MCP_CONNECT_TIMEOUT_S
DEFAULT_HTTP_MCP_CONNECT_TIMEOUT_S = 10.0

Release source · Runtime guarantees · Capability guides

from cayu.mcp import DEFAULT_HTTP_MCP_TIMEOUT_S
DEFAULT_HTTP_MCP_TIMEOUT_S = 120.0

Release source · Runtime guarantees · Capability guides

from cayu.mcp import HttpMcpClient

MCP client for remote servers over the Streamable HTTP transport.

Bases: McpClient.

async HttpMcpClient.connect(server: McpServerSpec) -> McpSession
HttpMcpClient.__init__(*, timeout_s: float | None=None, transport_limits: McpTransportLimits | None=None, connect_timeout_s: float=DEFAULT_HTTP_MCP_CONNECT_TIMEOUT_S, proxy: str | None=None, verify: bool | str | None=None, client_name: str=DEFAULT_MCP_CLIENT_NAME, client_version: str=DEFAULT_MCP_CLIENT_VERSION, max_list_pages: int=DEFAULT_MCP_MAX_LIST_PAGES, max_list_items: int=DEFAULT_MCP_MAX_LIST_ITEMS, protocol_era: McpProtocolEra=McpProtocolEra.LEGACY, transport: httpx.AsyncBaseTransport | None=None, secret_resolver: SecretResolver | None=None) -> None

Release source · Runtime guarantees · Capability guides

from cayu.mcp import HttpMcpSession

Bases: McpSession.

HttpMcpSession.secret_redactor() -> SecretRedactor

Redactor for secrets injected into this session (empty if none).

A hostile or buggy MCP server can echo injected secrets back through tool content, structured output, stderr, or protocol errors, so the toolset scrubs results with this before they reach model-visible context.

HttpMcpSession.initialize_result() -> McpInitializeResult
async HttpMcpSession.list_tools() -> tuple[McpToolDefinition, ...]
async HttpMcpSession.call_tool(name: str, arguments: dict[str, Any]) -> McpToolResult
async HttpMcpSession.list_resources() -> tuple[McpResourceDefinition, ...]
async HttpMcpSession.read_resource(uri: str) -> McpResourceResult
async HttpMcpSession.close() -> None
HttpMcpSession.__init__(*, server: McpServerSpec, http_client: httpx.AsyncClient, url: str, client_name: str, client_version: str, timeout_s: float | None=None, transport_limits: McpTransportLimits | None=None, max_list_pages: int=DEFAULT_MCP_MAX_LIST_PAGES, max_list_items: int=DEFAULT_MCP_MAX_LIST_ITEMS, protocol_era: McpProtocolEra=McpProtocolEra.LEGACY, secret_redactor: SecretRedactor | None=None) -> None
async HttpMcpSession.initialize() -> None

Establish server metadata using the selected protocol era.

Release source · Runtime guarantees · Capability guides