Skip to main content
The Rust SDK (omni-connector-sdk) is used by many built-in Omni connectors, including Google Workspace, Slack, Atlassian, IMAP, Nextcloud, Filesystem, Web, and Darwinbox. Use it when you want a native Rust connector with typed configuration, high-throughput sync logic, or direct reuse of Omni’s shared Rust models.

Installation

The Rust SDK is not published to crates.io. Connectors live in the Omni monorepo and depend on the SDK as a local path dependency. Create a connector under connectors/ and add a Cargo.toml like:
The connector should be part of the Omni workspace so it is built, tested, and released with the matching SDK and shared model versions.

Server Startup

The SDK provides an Axum server with the standard connector endpoints and a registration loop that advertises the connector manifest to connector-manager every 30 seconds.
When running under Docker, set:

Connector Trait

Implement omni_connector_sdk::Connector for your connector type.

Associated Types

Use serde_json::Value for any associated type when you want to opt out of typed validation.

SyncContext

SyncContext is the connector’s handle back to connector-manager. emit_event() buffers events. save_checkpoint() flushes buffered events before persisting the checkpoint so the checkpoint does not race ahead of emitted events.

Emitting Documents

Rust connectors emit ConnectorEvent values directly.
For updates, emit DocumentUpdated; for removals, emit DocumentDeleted. For group-based permissions, emit GroupMembershipSync events.

Checkpoints and Resume

Use save_checkpoint after batches or remote pages that are safe to resume past:
On the next run, connector-manager passes the latest checkpoint as the checkpoint argument to sync. ctx.is_resume() tells you whether the current run is a resume attempt after interruption.
Checkpoint only after the documents for that cursor/page have been emitted. The SDK flushes before checkpointing, but your connector still controls where the logical cursor advances.

Actions

Expose connector-specific actions by returning ActionDefinition values and implementing execute_action.

Search Operators

Connectors can register inline search operators that map to document attributes.
After registration, users can filter with queries like roadmap project:alpha in Search and Chat.

OAuth and MCP

Rust connectors can also expose:
  • oauth_config() for Omni’s generic OAuth flow, including optional Dynamic Client Registration via registration_endpoint and RFC 8707 resource indicators
  • mcp_server() for stdio or Streamable HTTP MCP servers
  • prepare_mcp_env() / prepare_mcp_headers() to inject credentials into MCP calls
  • skills() for connector-owned skills that guide the Omni agent through connector-specific workflows
  • serve_with_extra_routes() for provider-specific callback/enrichment routes when the standard SDK routes are not enough
Use the GitHub, Google, Atlassian, and Darwinbox connectors as references for advanced actions, OAuth manifests, and MCP integration patterns.

Testing

Rust connectors should use integration tests wherever possible. Existing Rust connector tests under connectors/*/tests/ use testcontainers-backed ParadeDB, Redis, and connector-manager helpers from the repo’s shared test infrastructure. Recommended coverage:
  • Config and credential deserialization failures
  • Full and incremental sync behavior
  • Checkpoint/resume behavior
  • Permission and group membership events
  • Search operators and attributes
  • Action success/failure cases
  • Cancellation for long-running syncs

Reference Connectors

What’s Next

SDK Overview

Compare SDKs and connector lifecycle concepts

Connector Management

Learn how connector-manager schedules and monitors sources