omni-connector) provides everything you need to build custom connectors that integrate with Omni’s search and AI platform.
Installation
The SDK is not published to PyPI. Connectors live in the Omni monorepo and depend on the SDK as a local path dependency. To start a new Python connector, fork or clone omni and create a directory underconnectors/:
pyproject.toml that pulls the SDK from the local checkout — copy from any existing Python connector (e.g. connectors/notion/pyproject.toml):
uv:
- Python >= 3.11
- uv (used throughout the monorepo for Python dependency management)
fastapi- Web frameworkuvicorn- ASGI serverhttpx- Async HTTP clientpydantic- Data validation
Quick Start
CONNECTOR_MANAGER_URL, CONNECTOR_HOST_NAME, and PORT. The SDK uses CONNECTOR_HOST_NAME plus PORT to register the connector URL that connector-manager calls for syncs, actions, MCP resources, and prompts.
Core Concepts
Connector Class
TheConnector abstract base class defines the interface for all connectors.
Required Properties:
Optional Properties:
Required Methods:
SyncContext
TheSyncContext object is passed to your sync method and provides utilities for the sync operation.
Properties:
Methods:
ContentStorage
TheContentStorage class handles storing document content.
content_id is a ULID that references the stored content.
Document Model
TheDocument class represents a searchable document.
Actions
Connectors can define custom actions that users can trigger from the Omni UI.Connector Skills
Connectors can ship skills — Markdown documents that guide the Omni agent through connector-specific workflows. Skills are loaded into Omni when the connector is enabled.MCP OAuth and Catalog Cache
Dynamic Client Registration (DCR)
For connectors whose MCP servers require per-user OAuth,OAuthManifestConfig supports automatic client registration so admins don’t need to create OAuth apps manually:
Credential-Ready Lifecycle
After a user completes OAuth, connector-manager callsoauth_credential_ready so the connector can run post-OAuth setup such as authenticated MCP catalog discovery:
Catalog Cache
The SDK caches MCP tool catalogs to disk (default:/var/lib/omni/mcp-catalogs) to avoid costly discovery on every restart. Set CATALOG_CACHE_TTL_SECONDS to control the cache lifetime; it defaults to 86400 seconds (24 hours).
Error Handling
The SDK provides custom exception classes:Development
Project Setup
Running Tests
Type Checking
Linting
Testing
The SDK includes a testing module (omni_connector.testing) with utilities for writing integration tests for your connectors.
TestHarness
TheTestHarness class provides a self-contained environment for testing your connector without needing a running Omni deployment.
Assertions
The harness captures all emitted documents, errors, and checkpoint changes for easy assertion:API Reference
Exports
The SDK exports the following: Core Classes:Connector- Abstract base classSyncContext- Sync operation contextContentStorage- Content storage interfaceSdkClient- SDK client for connector-manager
Document,DocumentMetadata,DocumentPermissionsConnectorEvent,EventTypeActionDefinition,ActionParameterActionRequest,ActionResponseConnectorManifest,SyncModeSyncRequest,SyncResponseCancelRequest,CancelResponseConnectorSkillDefinitionOAuthManifestConfig,OAuthScopeSetOAuthCredentialReadyRequestMcpResourceDefinition,McpPromptDefinitionStdioMcpServer,HttpMcpServer
ConnectorError,SdkClientError,SyncCancelledError,ConfigurationError
What’s Next
SDK Overview
Learn about SDK architecture
TypeScript SDK
Build connectors with TypeScript