Skip to main content
MobKit is a Rust crate plus SDKs, examples, and a React console, designed as a companion to the Meerkat multi-agent runtime. It handles the operational concerns that surround agent execution: startup, module supervision, identity-first continuity, routing, delivery, scheduling, gating, memory, sessions, cross-mob wiring, console projection, and administration.

Design principles

  1. Data over callbacks — module communication uses serialized JSON messages, not function pointers or trait objects
  2. Hot paths in-process — core routing and event merging happen in the main process; operational subsystems run as MCP modules
  3. Two modes — library mode (direct Rust calls) and RPC mode (JSON-RPC via stdio) for the same functionality
  4. Apps own policy, MobKit owns mechanism — applications decide who exists and who is wired; MobKit supplies the spawn, route, reconcile, persist, stream, and inspect machinery

High-level architecture

Crate structure

The core Rust crate is organized around explicit boundary modules:

Module boundary

The module boundary layer provides two communication paths:

MCP path (core modules)

Core modules expose MCP tools. The boundary calls call_module_mcp_tool_json with a tool name and arguments, receives a JSON response, and parses it into the expected type.
Key MCP tools per module:

Subprocess path (custom modules)

Custom modules communicate over JSON lines on stdio. The boundary uses run_process_json_line to send a request and read a response.

Event transport

The event transport merges two event sources: Events are sorted by timestamp_ms. Same-timestamp events preserve source ordering (agent before module).

Supervisor design

The supervisor manages module processes with a simple state machine:

HTTP composition

The runtime composes two Axum router layers: Routers are merged into a single axum::Router served on the configured port.

Dependencies

External crates

Meerkat crates

Security model

  1. Trusted modules — only modules declared in mobkit.toml are loaded
  2. JWT validation — OIDC-based auth with local signature verification
  3. Email allowlist — access restricted to configured identities
  4. Non-ambient console credentials — console mutation routes expect bearer tokens or explicit SSE query tokens when auth is required
  5. Signed remote cross-mob contacts — TCP/UDS peer descriptors require real Ed25519 pubkeys; in-process wiring is authorized through the identity map
  6. Forged resolution detection — delivery validates routing resolutions against trusted store
  7. Rate limiting — per-route sliding window rate limits on delivery

See also