Skip to main content
The distribution is meerkat-toolkit version 0.9.16, requiring Python 3.11 or newer. Import concrete meerkat_toolkit submodules; the root package exports no operation classes.

Install

Install the release wheel with the optional service profile you need:
For source development, use .venv-toolkit/bin/python -m pip install './connect/sdk/python[slack]' from the repository root. Service extras currently require HTTPX >=0.28.1,<0.29 and AnyIO >=4.13,<5. The stdlib-only Gmail formatting and base Telegram wire transport do not require those extras.

Native application composition

The native classes use meerkat_meta.runtime.MetaRuntime configuration, callbacks and lifecycle. Supply the matching Meta SDK and a local Connect gateway on POSIX. Connect 0.9.16 does not support in-place updates that change an application’s tool policy, definition, instructions or runtime. Replacement requires a matching development SDK and gateway; see the release limits. Import these modules under meerkat_toolkit. The selected input types HostBootstrapSelection, ApplicationPreparation, ApplicationUpdateStartup and SelectedHostArtifact live in meerkat_toolkit.host_control. Use the dedicated fresh and replacement classes; passing their input types to the base runtime does not supply their native initialization and attempt-custody behavior. The application provides its actual gateway, persistence and source callbacks through the existing native configuration. Fresh and replacement startup carry the exact selected bytes; they reject a second mob definition or tool-policy input. The async fresh finalizer accepts a SelectedHostArtifact, validates and publishes through the application’s existing transaction, and returns its exact HostBootstrapSelection. Replacement retains the transaction’s prior policy and native expected-revision decision. The legacy initialize_native_owner flag is not a fresh application path and is refused by the current ordinary-app gateway. Await runtime.connect() and keep the same runtime through await runtime.shutdown(). Its host_control property exposes that current process’s retained private client. Fresh preparation keeps the actual outcomes on runtime.preparation_attempt.settlement once an attempt exists and settles. Cancellation joins native initialization and an entered finalizer; a published selection must survive later failure. Fresh and replacement instances cannot start another attempt after startup has entered. Preserve native exceptions and any retained cleanup capability. For GatewayStartupCleanupError, await its cleanup.shutdown(); interrupted native startup can retain the same capability as gateway_cleanup on the original exception. Retain the startup outcome separately from the cleanup result. See host composition for startup, reconnect and lifecycle management.

Retain member MCP bindings

This optional API is development functionality. Use a matching Connect SDK and gateway built with member-MCP support; the release installation above does not provide it. Native end-to-end qualification remains pending.
Applications declaring member classes require an existing gateway-composed build customizer at fresh or restored startup. Explicitly configuring Meta’s agent_customizer is a straightforward supported setup; a pass-through is enough when the application needs no custom behavior. An existing memory customizer also satisfies this presence check, without requiring an SDK callback. This is not a reason to enable memory or proof that every callback works. Connect composes its selected member-class factory around the existing customizer without adding grants. Applications without member classes may omit it. See declaring member classes for the compiler inputs, factory identity and policy lifecycle. The selected development native API now reports AgentCustomizerRequired before bootstrap, with an actionable instruction to configure an SDK agent customizer; a pass-through is enough. This requirement is conditional on declared member classes. The supplied ordinary Add and same-session rebuild check has passed with actual customize_build and after_create callbacks; it does not qualify member MCP account access, cold restore or shared-helper reconstruction. MemberMcpApplication connects native member admission to the application’s existing private admission row. It adds no store or roster owner. Construct it on the application’s running event loop after loading that store and before native startup: cold registration may request a lookup before the application’s normal start hook runs. This example adapts application-owned JSON callbacks. retain_row and lookup_row are your existing row transactions, not SDK storage methods:
The same optional member_mcp=participant keyword is accepted by ToolkitApplicationRuntime(config, preparation, finalize) and ToolkitApplicationUpdateRuntime(config, startup). A later process Restore constructs a new participant over the same durable rows after the previous runtime has joined shutdown; it cannot reopen the closed participant. Development source also supports applications without an initial setup helper. Its zero-member startup, later Add and process-Restore verifier is source-reviewed but has not established native execution. The required class customizer still applies with an empty initial roster. Development source adds an explicit observed requirement contract for remote Python owners. Pass observed_requirement=callback to MemberMcpApplication; the async callback receives the exact admission selection and PrivateSourceEvidence, and returns ObservedMemberMcpRequirement from the actual nonvoided application row, or None when no accepted requirement exists. None is a normal negative observation: setup is refused, but this answer alone does not make participant.join() report a callback failure. The value carries the full source evidence and ordered service intents. The participant’s requirement_contract reports "observed_requirement" when this callback is configured. Select that source in MemberMcpAddIntent.origin as {"accepted_application_requirement": {"source": source_fields}}. This is observation around setup issuance, not a synchronous current-owner promise. Connect reads the requirement before and after issue; drift withholds the binding and revokes its exact grant. Failed revocation remains retained and is retried at the next native startup before member registration. Protected human approval and native grant checks still apply. In-process Rust owners retain their strict synchronous predicate. The existing operator_self path and its wire values are unchanged. Native validation remains pending; this does not qualify installed Forge setup, MCP account access or approval reuse across members. The exact selection contains admission_id (the original Add request ID), identity and class; the Python field for class is class_id. Retention must conditionally update that same nonvoided, admitting row with the complete bindings list and return only after durable commit. An exact replay may succeed; changed identity, class or bindings must refuse. Lookup must return that exact retained selection from an admitting or listed row. An explicitly retained empty list means no bindings; a missing, voided, retired or unreadable ordinary row must raise, never become an empty list. For observed requirements, RetainedMemberMcpBindings.accepted_requirement retains the full association alongside all pending binding locators before any grant is issued. The retain transaction must compare that complete source and ordered intent with the same nonvoided row. Preserve this retained association after void or retirement for cleanup; it grants no authority. The application still owns final publication in its existing Add completion callback and must compare its row before publishing. Connect acknowledges native continuation only after the callback succeeds. A lost acknowledgement or callback error does not prove the application write rolled back. Neither callback publishes a member or grants access. Binding references stay in the private admission row and must not appear in public rosters or model-facing inputs. During shutdown, explicitly await participant.join() to settlement before closing application storage. It closes callback entry and joins entered writes. If the shutdown caller is cancelled, keep the store open while the host’s existing cleanup owner finishes that join. Preserve any reported uncertainty while completing cleanup. Later runtime.shutdown() repeats the same idempotent join, including its retained failure; it does not cancel an entered application write. See the host lifecycle ordering.

Supply the MCP browser callback

meerkat_toolkit.mcp_auth is a host-only adapter for the existing Python MeerkatClient MCP login methods. It binds a local callback before starting authentication, forwards completion to native auth, and closes its socket work on settlement. Native auth retains PKCE, state, account verification, persistence and cancellation. Rust embedding hosts use the native loopback helper instead. Supply an already connected Meerkat client and a protected sign-in presenter. Keep the callback adapter in host code, outside the agent tool surface. For cancellable request handlers, retain McpLoginCustodian(client, target) under the existing host-owned step before awaiting begin(). It keeps one start task and result so a later admitted request can retrieve the same handle after the first request is cancelled. It never retries an uncertain start. The host still authenticates and admits every invocation, including replay. Use the returned StartedMcpLogin.wait for credential observation. Explicit host shutdown calls the custodian’s close() and joins any pending start before cleanup. Closing a panel must not call it. A Joined result leaves cancellation and presentation with the original custodian. Low-level begin_mcp_login and explicit observe_mcp_auth remain available. This is in-memory transport custody, not recovery across process loss. The full contract is in sdk/python/MCP-AUTH.md.

Prepare the client once

The host selects authentication, endpoint, hooks and network policy, then prepares the client before sharing it:
host_auth is supplied by the application credential owner. The example implements no OAuth or policy check. Its endpoint and network settings are explicit host choices. prepare_httpx_client returns the same client and installs the retained response-cleanup hook first. Repeated preparation is idempotent. Keep hook order and auth/transport behavior stable while operations borrow the client. require_prepared_httpx_client validates preparation without mutating it. Missing or reordered preparation refuses before provider entry. Most connectors raise HttpxClientNotPrepared, a ValueError with request_attempted=False; Drive projects this into its typed local-failure contract.

Transport lifetime and authority

The host owns authentication, account correspondence, grants, credential refresh/revocation and eventual client closure. Library operations neither close the borrowed client nor retry automatically. Host auth, hooks and transport must preserve the selected request and must not silently replay or retarget it. One operation deadline covers sending and reading. Deadline expiry begins cancellation and joined cleanup; arbitrary host cleanup can exceed that deadline. Cancellation after an entered write does not prove no effect.

Service reference

Exact operation families, selection inputs and result boundaries.

Frontend reference

Telegram, Slack, durable output and paired-host live image input.
Source metadata is in sdk/python/pyproject.toml; module contracts and examples are maintained under sdk/python/.