cayu.mcp.tools
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.
connect_mcp_toolset
Section titled “connect_mcp_toolset”from cayu.mcp import connect_mcp_toolsetConnect to one MCP server and return its initialized toolset.
async connect_mcp_toolset(server: McpServerSpec, *, client: McpClient | None=None) -> McpToolsetRelease source · Runtime guarantees · Capability guides
mcp_cayu_tool_name
Section titled “mcp_cayu_tool_name”from cayu.mcp import mcp_cayu_tool_namemcp_cayu_tool_name(server_name: str, tool_name: str) -> strRelease source · Runtime guarantees · Capability guides
mcp_tool_manifest_hash
Section titled “mcp_tool_manifest_hash”from cayu.mcp import mcp_tool_manifest_hashReturn a stable hash of the MCP tool contract Cayu exposes.
mcp_tool_manifest_hash(*, server: McpServerSpec, initialize_result: McpInitializeResult, definitions: tuple[McpToolDefinition, ...]) -> strRelease source · Runtime guarantees · Capability guides
mcp_tool_manifest_identity
Section titled “mcp_tool_manifest_identity”from cayu.mcp import mcp_tool_manifest_identityReturn an opaque candidate identity for one MCP server connection.
definitions remains accepted for source compatibility with the original
helper, but manifest contents intentionally do not participate in identity.
Only an explicit McpServerSpec.connection_id is authoritative for
runtime manifest history. The server-name form exists solely so a rejected
ID-less toolset can carry bounded, non-identifying audit evidence.
mcp_tool_manifest_identity(*, server: McpServerSpec, definitions: tuple[McpToolDefinition, ...] | None=None) -> strRelease source · Runtime guarantees · Capability guides
mcp_tool_manifest_server_hash
Section titled “mcp_tool_manifest_server_hash”from cayu.mcp import mcp_tool_manifest_server_hashReturn a stable hash of MCP server metadata that affects the manifest.
mcp_tool_manifest_server_hash(*, server: McpServerSpec, initialize_result: McpInitializeResult) -> strRelease source · Runtime guarantees · Capability guides
mcp_tool_manifest_tools
Section titled “mcp_tool_manifest_tools”from cayu.mcp import mcp_tool_manifest_toolsReturn compact per-tool manifest entries for drift auditing.
mcp_tool_manifest_tools(*, server: McpServerSpec, definitions: tuple[McpToolDefinition, ...]) -> tuple[dict[str, Any], ...]Release source · Runtime guarantees · Capability guides
mcp_toolset_manifest_diff
Section titled “mcp_toolset_manifest_diff”from cayu.mcp import mcp_toolset_manifest_diffCompare two immutable snapshots of the same MCP source.
mcp_toolset_manifest_diff(previous: McpToolset, current: McpToolset) -> McpToolsetManifestDiffRelease source · Runtime guarantees · Capability guides
McpToolAdapter
Section titled “McpToolAdapter”from cayu.mcp import McpToolAdapterExpose one MCP server tool as a Cayu tool.
Bases: Tool.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
spec |
ToolSpec |
required |
init (method)
Section titled “init (method)”McpToolAdapter.__init__(*, toolset: McpToolset, definition: McpToolDefinition, name: str | None=None) -> Nonename (property)
Section titled “name (property)”McpToolAdapter.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”McpToolAdapter.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”McpToolAdapter.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”McpToolAdapter.description() -> strschema (property)
Section titled “schema (property)”McpToolAdapter.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async McpToolAdapter.run(ctx: ToolContext, args: dict[str, Any]) -> ToolResulttoolset (property)
Section titled “toolset (property)”McpToolAdapter.toolset() -> McpToolsetmcp_manifest_hash (property)
Section titled “mcp_manifest_hash (property)”McpToolAdapter.mcp_manifest_hash() -> strserver (property)
Section titled “server (property)”McpToolAdapter.server() -> McpServerSpecdefinition (property)
Section titled “definition (property)”McpToolAdapter.definition() -> McpToolDefinitionRelease source · Runtime guarantees · Capability guides
McpToolset
Section titled “McpToolset”from cayu.mcp import McpToolsetPersistent established MCP server connection plus Cayu tool adapters.
init (method)
Section titled “init (method)”McpToolset.__init__(*, server: McpServerSpec, session: McpSession, definitions: tuple[McpToolDefinition, ...]) -> Noneserver (property)
Section titled “server (property)”McpToolset.server() -> McpServerSpecsession (property)
Section titled “session (property)”McpToolset.session() -> McpSessiongeneration (property)
Section titled “generation (property)”McpToolset.generation() -> intImmutable source generation represented by this toolset snapshot.
definitions (property)
Section titled “definitions (property)”McpToolset.definitions() -> tuple[McpToolDefinition, ...]tools (property)
Section titled “tools (property)”McpToolset.tools() -> tuple[McpToolAdapter, ...]refresh_state (property)
Section titled “refresh_state (property)”McpToolset.refresh_state() -> McpToolsetRefreshStateReturn the source’s current dispatch state.
manifest_identity_is_explicit (property)
Section titled “manifest_identity_is_explicit (property)”McpToolset.manifest_identity_is_explicit() -> boolWhether the cached manifest identity came from an explicit connection ID.
manifest_identity (property)
Section titled “manifest_identity (property)”McpToolset.manifest_identity() -> strmanifest_hash (property)
Section titled “manifest_hash (property)”McpToolset.manifest_hash() -> strmanifest_server_hash (property)
Section titled “manifest_server_hash (property)”McpToolset.manifest_server_hash() -> strmanifest_tools (property)
Section titled “manifest_tools (property)”McpToolset.manifest_tools() -> tuple[dict[str, Any], ...]connect (method)
Section titled “connect (method)”async McpToolset.connect(server: McpServerSpec, *, client: McpClient | None=None) -> McpToolsetinitialize_result (property)
Section titled “initialize_result (property)”McpToolset.initialize_result() -> McpInitializeResultsecret_redactor (property)
Section titled “secret_redactor (property)”McpToolset.secret_redactor() -> SecretRedactorRedactor for secrets injected into this server’s session (empty if none).
process_capability_evidence (property)
Section titled “process_capability_evidence (property)”McpToolset.process_capability_evidence()Configured process-lifecycle evidence for stdio-backed toolsets.
call_tool (method)
Section titled “call_tool (method)”async McpToolset.call_tool(name: str, arguments: dict[str, Any]) -> McpToolResultclose (method)
Section titled “close (method)”async McpToolset.close() -> NoneRelease source · Runtime guarantees · Capability guides
McpToolsetManifestDiff
Section titled “McpToolsetManifestDiff”from cayu.mcp import McpToolsetManifestDiffBounded application-visible difference between two MCP snapshots.
Decorators: @dataclass(frozen=True, slots=True).
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
server_changed |
bool |
required |
added_tools |
tuple[str, ...] |
() |
removed_tools |
tuple[str, ...] |
() |
changed_tools |
tuple[str, ...] |
() |
changed (property)
Section titled “changed (property)”McpToolsetManifestDiff.changed() -> boolpolicy_input (method)
Section titled “policy_input (method)”McpToolsetManifestDiff.policy_input() -> dict[str, Any]Return a detached value accepted by McpManifestPolicy.
Release source · Runtime guarantees · Capability guides
McpToolsetRefreshBlocked
Section titled “McpToolsetRefreshBlocked”from cayu.mcp import McpToolsetRefreshBlockedRaised when application policy rejects a refreshed MCP manifest.
Bases: RuntimeError.
This type’s implementation and inherited behavior are available in the linked release source.
Release source · Runtime guarantees · Capability guides
McpToolsetRefreshResult
Section titled “McpToolsetRefreshResult”from cayu.mcp import McpToolsetRefreshResultAccepted result of one trigger-independent MCP catalogue refresh.
Decorators: @dataclass(frozen=True, slots=True).
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
toolset |
McpToolset |
required |
status |
str |
required |
previous_generation |
int |
required |
generation |
int |
required |
previous_manifest_hash |
str |
required |
manifest_hash |
str |
required |
diff |
McpToolsetManifestDiff |
required |
policy_action |
str | None |
None |
Release source · Runtime guarantees · Capability guides
McpToolsetRefreshState
Section titled “McpToolsetRefreshState”from cayu.mcp import McpToolsetRefreshStateLive dispatch state for one refreshable MCP source.
Bases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
READY |
class attribute |
'ready' |
DIRTY |
class attribute |
'dirty' |
REFRESHING |
class attribute |
'refreshing' |
QUARANTINED |
class attribute |
'quarantined' |
CLOSED |
class attribute |
'closed' |
Release source · Runtime guarantees · Capability guides
McpToolsetUnavailable
Section titled “McpToolsetUnavailable”from cayu.mcp import McpToolsetUnavailableRaised when an MCP snapshot no longer has live dispatch authority.
Bases: McpProtocolError.
This type’s implementation and inherited behavior are available in the linked release source.