Extend Integrations
Choose the narrowest provider contract that keeps executable configuration trusted and credentials backend-side.
Decision Guide
| Provider Need | Extension |
|---|---|
| Public hosted MCP with reviewable tools | Managed hosted MCP |
| Stable vendor API needing a smaller fixed surface | Direct backend API provider |
| Organization-operated public HTTPS MCP | Custom remote MCP |
| Pinned server shipped in the agent image | Trusted local STDIO MCP |
| Vendor command with deterministic read/write classification | Trusted CLI integration |
| User consent and incremental scopes | OAuth-backed managed integration |
| GitHub repository transport for Engineering and Growth | Native Git gateway |
Do not force a provider into a CLI integration when schema or dry-run output cannot reliably classify effects, or when the provider requires a shared persistent login home. Prefer a managed MCP with trustworthy annotations or defer the integration.
Three Ownership Layers
Git catalog → immutable published catalog → organization installation → run-local capability- Git owns built-in display, setup, grants, auth contract, runtime key, and tool policy.
- Git also owns the finite provider purposes and default descriptions. See the reviewed twenty-four integration contracts before changing a connector or advertising a metric.
- PostgreSQL owns organization connection state, encrypted credentials, non-secret resource settings, selected tools, exact permission mode, and retirement state.
- Shared types own the small trusted runtime registry.
- The backend owns credential resolution and provider gateways.
- The agent receives only execution-scoped gateway configuration.
Non-negotiable Rules
- Never accept a command, package, path, or arbitrary environment from the database.
- Never place credentials in URLs, manifests, prompts, workspaces, or logs.
- Missing read-only annotations fail closed.
- Treat selected tools as a materialized authorization snapshot. Future discovery never expands it.
- A mode-only change deliberately selects every tool currently eligible for the target mode; an explicit tool list wins when both are supplied.
- Explicit owner requests in Chat use durable actions with recorded message approval and current access checks.
- Consequential task actions use the durable action lifecycle.
- An uncertain provider result is reconciled, not retried.
Permission modes are read_only, ask_user_on_write, and autonomous. The legacy derived access
mode remains only for provider tool eligibility: read-only maps to read_only; both write-capable
modes map to full. ask_user_on_write stages every consequential effect for approval, while
autonomous may execute it immediately under the same task, profile, resource, authorization,
idempotency, budget, and reconciliation fences.
Semantic integration configuration is not a database metadata bag. Store it in Context V3
preferences.toml under the immutable generated connector key. Use the same key for scoped
department meaning and workflow references; never derive connection state from the TOML record.
Native Git is the reviewed GitHub-specific repository transport. It keeps the PAT backend-side, uses ordinary GitHub HTTPS remotes inside the workspace, and routes branch pushes through typed actions. See Native Git Gateway.
Connect Errors
A failed connect returns one public code in error.code, from the allowlist in
@oblive/types/public-errors. Every other code still goes out as request_failed (4xx) or
internal_server_error (5xx), so internal codes never become an accidental contract. The meaning is
in the code, not the HTTP status.
| Code | Status | Meaning |
|---|---|---|
integration_credentials_invalid | 400 | The key is malformed; the provider was not contacted. |
integration_credentials_rejected | 422 | The provider rejected the key or token (401, revoked, expired). |
integration_permission_missing | 422 | The key works but lacks access (403). |
integration_provider_unavailable | 503 | Timeout, network failure, MCP request timeout, 429 or 5xx. |
integration_authorization_denied | redirect | The user declined on the provider’s OAuth page. |
integration_discovery_failed | 400 | Anything else, including an ambiguous MCP -32000 error. |
| Conflict codes | unchanged | integration_changed, _authorization_stale, _context_conflict, _settings_conflict. |
toPublicConnectError(error, step) builds these in discoverIntegrationTools and the OAuth
completion paths. It reads only status and code fields, never an error’s message: SDK and provider
messages can contain the raw response body. Oblive’s own internal 5xx codes stay
integration_discovery_failed rather than reading as a provider outage.
error.details is optional and holds only facts Oblive verified. The handler re-validates it, and a
value that fails its rule is dropped:
| Field | Rule |
|---|---|
step | credential_check, tool_discovery, oauth_authorization or oauth_token_exchange |
providerCode | ^[a-z][a-z0-9_.-]{0,63}$, only from direct providers that parse it |
permission | ^[A-Za-z0-9_.:-]{1,64}$ |
httpStatus | Integer from 400 to 599, from a verified provider response |
retryAfterSeconds | Integer from 1 to 3600, from a validated Retry-After |
OAuth callbacks carry only the code, as reason, never details. A declined authorization keeps
mcp_oauth=cancelled (or google_*=cancelled) and adds reason=integration_authorization_denied;
the legacy mcp_oauth_exchange_failed, mcp_oauth_failed and google_oauth_* reasons remain.
The frontend turns the code and details into one local wording table
(integrationErrorMessage). Server-function errors reach the browser through the
BackendRequestError serialization adapter registered in apps/frontend/src/start.ts; TanStack’s
default error serialization keeps only the message.
Lemon Squeezy, Paddle, Upstash, MongoDB, Google Analytics, Strapi, and Plausible are the direct-provider references. They keep the public MCP gateway shape while replacing an open-ended provider client with fixed backend-owned tools. See Direct Data Providers.
Trusted pinned stdio remains valid only for static agent-image capabilities such as structured questions. Organization credentials stay behind hosted MCP or backend API providers. See Add a Trusted STDIO MCP.