Oblive Docs
Extend Integrations

Direct Backend API Providers

Build fixed provider adapters with backend-owned credentials, reviewed tools, and resource-scoped settings.

Lemon Squeezy, Paddle, Upstash, MongoDB, Google Analytics, Google Search Console, and Strapi are catalog-managed MCP-shaped integrations whose tools are implemented directly in the backend. They reuse the integration gateway and run capability model, but they do not proxy an arbitrary remote MCP server and never install a vendor client in an agent runtime.

Ownership

ConcernOwner
Display, grants, auth contract, tool policyGit agent-pack catalog
Fixed runtime key, limits, reviewed tools@oblive/types runtime registry
Credential and organization connection statePostgreSQL integration row
Non-secret resource scopeTyped integration settings JSONB
Credential decryption and provider callsBackend integration gateway/provider
Run authorizationShort-lived execution capability and epoch

Settings are part of the material authorization fingerprint. Changing a key prefix, database allowlist, GA4 property selection, or Strapi origin or endpoint list advances the organization authorization epoch and clears reusable sessions. Provider credentials remain encrypted and are never projected with settings.

The shipped catalog grants Upstash, MongoDB, and Google Analytics to Operator and Chat. Engineering also receives Upstash and MongoDB, Growth also receives Google Analytics, Growth and Support receive Lemon Squeezy, and Operator, Chat, Growth and Support receive Paddle. Operator, Chat, Growth, Engineering and Support receive Strapi. A grant alone is not readiness: the backend still requires the connector to be catalog-active, enabled, credentialed, scoped, and explicitly tooled before it emits an execution-bound capability.

Permission mode and tool selection remain gateway concerns, not provider concerns. First connection defaults to ask-before-write except fixed read-only GA4, Upstash, MongoDB, and Strapi. It materializes the current eligible inventory. A mode-only update materializes all tools currently eligible for the target mode, while an explicit tool list is authoritative. Same-mode reconnect preserves a non-empty narrowing. A valid connection with no eligible tools remains credentialed in needs_tools, and future provider tools never expand an existing selection automatically.

Provider Boundaries

Upstash

The backend accepts an Upstash root REST URL and either all-key or literal-prefix scope. The exact URL is the database identity; no separate database ID is accepted. The credential is a write-only read-only REST token. The provider accepts only a fixed command mapping, checks every key before network I/O, rejects redirects, and bounds command count, request bytes, response bytes, concurrency, and total time. Prefix tenant:1 also matches tenant:10; use delimiter-terminated prefixes such as tenant:1: when the boundary matters.

Optional reporting.keys selects at most 100 literal keys and their numeric or collection kind. upstash_collection_count maps only to TYPE plus HLEN, LLEN, SCARD, ZCARD or XLEN; it never scans. Scalar reports use validated exact decimals. Missing/non-numeric keys remain gaps, distinct from zero. The selected REST origin is the stable source account and each key is a resource.

Lemon Squeezy

API list filters use underscore names such as store_id and subscription_id. Relationship objects may contain only links; prove parent scope using the corresponding validated foreign-key attribute when an explicit relationship ID is absent. Never infer permission from a related URL. Rejected requests report the HTTP status; a malformed filter is not a credential failure.

Lemon Squeezy uses the official HTTPS JSON API directly. Setup validates the write-only API key, discovers at most 200 accessible stores, and materializes one to 50 selected store IDs in typed settings. “Select all” stores the current discovery snapshot; stores created later remain blocked until settings are updated. Every MCP tool schema enumerates the currently selected store IDs so an agent can resolve its authorized scope without receiving integration settings in its safe context. The backend still rechecks that scope before provider I/O.

The provider exposes 22 fixed reads for stores, customers, products, variants, prices, orders, order items, subscriptions, subscription invoices/items, and discounts. Ask before writes and Autonomous add only customer and checkout creation. Every resource operation carries a configured store ID, proves resource or parent ownership, uses explicit page-number pagination, and returns curated bounded fields. The two writes use the existing durable action lifecycle and are never retried after an ambiguous response.

Refunds, subscription changes, usage records, licenses, files and download URLs, webhooks, affiliates, checkout retrieval, and account-level user details remain unavailable. There is no community stdio package, Node runtime, arbitrary API path, raw relationship projection, or hidden fallback in the backend execution path.

Paddle

Paddle has no integration settings. The API origin comes only from the key prefix: pdl_live_ uses https://api.paddle.com and pdl_sdbx_ uses https://sandbox-api.paddle.com. Any other format is rejected before a request. Every request pins Paddle-Version: 1, disables redirects, and is bounded in time and size. The credential never leaves the backend and is redacted from every error.

The provider exposes 14 fixed reads (a get and a list for customers, products, prices, discounts, subscriptions, transactions and adjustments) and, in a write-capable mode, 9 writes: create and update for customers, products, prices and discounts, plus paddle_create_checkout. The four update_* tools are destructive. Writes use the durable action lifecycle with strict schemas and are never retried. There is no status or archive tool, no refund or subscription-change tool, and no custom_data. paddle_get_adjustment uses the list endpoint’s id filter because Paddle has no single-adjustment route.

Projections are declarative allowlists. They never include management_urls (customer-portal links), checkout links on reads, invoice PDFs, or custom_data. Lists return { items, next, hasMore }; next is checked against the key’s origin and the listed path. Results are capped at 20 KiB. A 401 becomes integration_reconnect_required, and a 403 names the missing permission only when Paddle reports it. Connect-time 401, 403 and malformed-key errors keep their specific message instead of the generic discovery failure.

The source account is paddle:<connection id>:<credential fingerprint> with the key’s environment as the resource. Paddle has no account identity endpoint, and reconnecting keeps the connection ID, so the fingerprint of the saved credential separates each key’s history. Any new key, including a rotation or a sandbox to live change, starts fresh sources and backfills again. Earlier sources are retained but no longer shown, and they are never merged.

Reporting rules:

  • Payments are selected by updated_at with keyset paging, so a late-paid invoice is collected when it is captured. They are dated by the first captured attempt’s captured_at. A succeeded zero-value completion has no capture and is dated by its billing time. A positive completion without a capture is a gap, never zero. If 30 or more transactions share one millisecond updated_at, paging falls back to Paddle’s after cursor inside that timestamp.
  • Refunds are adjustments with action: refund; chargebacks, credits and their reversals are excluded. Approved refunds are dated by updated_at. A pending_approval refund marks the window incomplete until Paddle decides it. Invalid amounts are skipped and also leave a gap.
  • Adjustments can only be ordered by ID, so refunds are paged newest first with a 30-day lookback before the window start. A refund approved more than 30 days after it was requested can be missed. Each backfill window re-reads newer refunds to catch later approvals.
  • Oblive MRR comes from Paddle’s recurring-bill preview (include=recurring_transaction_details), so tax and current discounts are computed by Paddle. This costs one extra read per active or past-due subscription and is deferred when the page budget is too small. An incomplete preview marks the subscription as a gap.
  • Paddle MRR is Paddle’s own daily history, in its primary currency, collected from /metrics/monthly-recurring-revenue in chunks of at most 90 days. It needs the metrics.read permission; a 403 pauses only this measure.
  • A pagination cursor that Paddle rejects restarts the work unit from the window start with a new snapshot, with exponential backoff.

MongoDB Atlas

Setup accepts a bare Atlas SRV host plus the raw database username and password. The backend validates the structured input, percent-encodes userinfo, constructs a pathless mongodb+srv credential, and stores only that canonical credential in the existing encrypted column. Settings carry the exact application database plus collection and dotted-field allowlists. The provider pins Atlas SRV, TLS, authSource: admin, appName: oblive-integration, bounded pools and timeouts, the configured database, and a read-only driver surface. It validates operators and projections, runs an explain preflight, and rejects a winning COLLSCAN before returning bounded results.

Setup resource discovery is stateless and organization scoped:

POST /organizations/{organizationId}/integrations/{integrationRef}/mongodb/resources
Content-Type: application/json

{
  "connection": {
    "clusterHost": "cluster0.example.mongodb.net",
    "username": "oblive-reader",
    "password": "write-only"
  },
  "databaseName": "application"
}

The operation authenticates, lists at most 50 supported collections, and inspects a deterministic, indexed sample of at most 20 documents per collection. Its response contains only collection names, dotted field names, sample counts, and truncation flags—never values. Existing connections may omit connection and reuse the encrypted credential. Discovery does not persist settings or advance the authorization epoch.

There is no authoritative field catalog for schemaless MongoDB documents, so discovered fields are suggestions. The UI preserves explicitly configured but unobserved paths as manual entries. “Allow all discovered collections and sampled fields” expands the current bounded result into the existing explicit settings array; it is not a wildcard and never authorizes collections created later.

Runtime operations always select the typed settings database explicitly; the pathless credential is not a second resource-scope authority. Legacy root or explicitly matching-database SRV credentials remain valid at the provider boundary.

Filters accept ordinary JSON scalars and two strict one-key Extended JSON literals:

{
  "_id": { "$gte": { "$oid": "507f1f77bcf86cd799439011" } },
  "createdAt": { "$lt": { "$date": "2026-08-11T00:00:00Z" } }
}

$oid requires exactly 24 hexadecimal characters. $date requires an ISO-8601 timestamp with a timezone. Both literals work as direct equality values, in bounded equality arrays, with $eq/$ne/$gt/$gte/$lt/$lte, and inside $in/$nin. The backend applies the field allowlist first, converts the two supported types, and then runs the existing indexed-plan preflight. Plain strings remain strings; unsupported or malformed Extended JSON and arbitrary objects are rejected rather than inferred.

Document-count collection pins the verified index; unfiltered counts use _id_ instead of a collection scan. Optional reporting.creationFields names one immutable BSON Date field per selected collection, within its allowed fields. Daily UTC counts use indexed date ranges and only describe documents still retained. Deleted history cannot be reconstructed. Unindexed ranges require a specific configuration fix; access loss pauses the source without publishing a false zero.

Reporting-only updates compare the expected saved settings under an integration lock. They change the collection generation and refresh future runtime context without advancing execution authorization. Concurrent scope edits cannot be overwritten. Credentials and scopes remain independent of optional reporting choices; saved choices survive rotation and are pruned when scope narrows.

Google Analytics

Google Analytics shares the deployment Google OAuth client but stores a credential on its own integration row. One-use state is bound to the google-analytics runtime. Authorization always asks for openid, email, and analytics.readonly; the client cannot select tools or broader scopes.

The Cloud project that owns the OAuth client must enable the Google Analytics Admin API (analyticsadmin.googleapis.com) for property discovery and configuration, and the Google Analytics Data API (analyticsdata.googleapis.com) for reports. The connected identity must have Viewer or higher access to every GA4 property selected for the integration.

OAuth completion stores the credential but leaves the connector disabled. The frontend then reads bounded property options from:

GET /organizations/{organizationId}/integrations/{integrationRef}/google-analytics/properties

Saving settings performs live property verification before it enables the connector:

PUT /organizations/{organizationId}/integrations/{integrationRef}/settings
Content-Type: application/json

{
  "settings": {
    "kind": "google-analytics",
    "propertyIds": ["123456789"],
    "defaultPropertyId": "123456789"
  }
}

Reauthorization also leaves Analytics disabled until this verification runs again. Disconnect clears the credential, tools, and property settings so a different identity cannot inherit stale scope.

Strapi

Strapi reads an organization-owned server rather than a vendor API, so no vendor domain constrains its origin. strapiSettingsSchema in @oblive/types/integration-policy owns the settings:

{
  "kind": "strapi",
  "origin": "https://cms.example.com",
  "endpoints": ["/api/articles"]
}

origin must be exactly https://host: HTTPS on the default port, without a path, query, fragment, or credentials. The host must be a DNS name whose last label starts with a letter, so IP literals fail; localhost and names under .local, .localdomain, .internal, and .home.arpa are rejected. endpoints holds at most 20 unique exact paths matching ^/api(/[A-Za-z0-9][A-Za-z0-9_-]{0,63}){1,8}$, so traversal, query strings, dots, encoded characters, and route parameters cannot widen the allowlist. An empty list is valid and keeps the connection in needs_configuration.

The credential is a write-only API token of 16–4096 printable ASCII characters, stored in the existing encrypted column and sent only as Authorization: Bearer. Requests use createIntegrationSafeFetch, which resolves the host on every request and rejects non-public addresses. Redirects are rejected. Before network I/O, the provider requires the path to be in the allowlist and the constructed URL to keep the configured origin and the exact path.

strapi_get is the only tool. It is annotated read-only, idempotent, and non-destructive. Its input schema enumerates the configured endpoints and accepts only these optional parameters:

InputQuery parameterBound
perPageper_page1–200
afterafter[A-Za-z0-9_-]{1,128}
pagepagination[page]1–10,000
pageSizepagination[pageSize]1–100

Each call is one GET with Accept: application/json and a 15-second timeout, shortened by any caller timeout. Responses over 256 KiB are rejected with a request for a smaller page. The result is { path, query, data } as structured content; above 20 KB the text content is a truncation summary. There are no write tools.

Strapi responseProvider resultHealth
401integration_reconnect_requiredneeds_credentials
403strapi_permission_missingneeds_configuration
404strapi_endpoint_not_foundneeds_configuration
400strapi_request_invalidNot a health failure
429Retryable rate limit with Retry-Afterunavailable
5xx, timeout, I/ORetryable strapi_request_rejected, strapi_timeout, or strapi_unavailableunavailable

Connecting with at least one endpoint validates the token by reading the first endpoint with per_page=1. Connecting without an endpoint stores the token without a read; a later settings save discovers tools with the same validation. Strapi ignores unknown query keys by default, but a Strapi 5 server with strict query parameters enabled answers per_page on a core content API route with 400, so the first endpoint should accept that parameter. Check connection supplies { path: endpoints[0], perPage: 1 } so the read check can select strapi_get, then records the outcome as operation health.

A settings update that changes the origin of a credentialed integration fails with 409 strapi_origin_change_requires_credential. The owner must connect again with the token, so a saved token is never sent to a new origin. New organizations receive Strapi disabled and read-only at bootstrap; existing organizations receive it through catalog reconciliation at backend startup. Insights is lifecycle_only, with no retained collector.

Plausible

Plausible reads Plausible Cloud at the fixed origin https://plausible.io; self-hosted instances are not supported. plausibleSettingsSchema in @oblive/types/integration-policy owns the settings:

{
  "kind": "plausible",
  "sites": ["example.com"]
}

sites holds at most 20 unique lowercase DNS names, each a site domain as registered in Plausible. An empty list is valid and keeps the connection in needs_configuration. The credential is a write-only Stats API key of 16–4096 printable ASCII characters, stored in the existing encrypted column and sent only as Authorization: Bearer. Redirects are rejected.

The provider exposes two read-only, idempotent, non-destructive tools whose schemas enumerate the configured sites:

  • plausible_get_site calls GET /api/v1/sites/:site_id and returns { siteId, domain, timezone }.
  • plausible_query calls POST /api/v2/query with reviewed metrics (one to eight), up to three dimensions (visit, event, custom property and time dimensions), up to ten [operator, dimension, values] filters, a named or two-date range, an optional ordering, and pagination.limit of 1–1,000 (default 100). It always sends include.imports: false and returns { siteId, metrics, dimensions, results, meta }.

Each call has a 15-second timeout, shortened by any caller timeout, and rejects responses over 256 KiB. Above 20 KB the text content is a truncation summary of the structured content.

Plausible responseProvider resultHealth
401integration_reconnect_requiredneeds_credentials
402, 403plausible_permission_missingneeds_configuration
404plausible_site_not_foundneeds_configuration
400plausible_request_invalid, with Plausible’s short validation messageNot a health failure
429Retryable rate limit with Retry-Afterunavailable
5xx, timeout, I/ORetryable plausible_request_rejected, plausible_timeout, or plausible_unavailableunavailable

Connecting with at least one site validates the key with the first site’s lookup and a one-day visitors query, because the lookup alone does not prove Stats API access. Check connection supplies { siteId: sites[0] } so the read check can select plausible_get_site. New organizations receive Plausible disabled and read-only at bootstrap; existing organizations receive it through catalog reconciliation at backend startup.

The Insights adapter (plausible-analytical-adapter.service.ts) discovers one activity source per site, identified by the site domain. Each collection reads the site’s timezone, then walks a day stage (one time:day query over the report window, zero-filling only the days Plausible labels), a week stage and a month stage (one aggregate query per calendar period, so visitors stay distinct for the exact period). It publishes visitors as distinct and visits and pageviews as flows, with a one-hour provisional lag, and backfills month by month for 12 months. A 402 from Plausible is treated as a missing permission. The business metrics gateway reads daily visits through the same integration.

Adding a Direct Provider

Use a direct provider when the vendor API is stable enough to expose a substantially smaller and safer surface than a general client or hosted MCP. Direct providers may include reviewed writes only when they use the existing durable action lifecycle.

  1. Add strict shared runtime, tool, settings, auth, and access-mode contracts.
  2. Store only non-secret resource scope in settings; keep credentials in the existing encrypted column and organization/integration AAD boundary.
  3. Implement TIntegrationToolProvider behind createIntegrationToolProvider. Use fixed tools, strict Zod input and response projections, bounded output, timeouts, cancellation, and close().
  4. Validate resource scope before provider I/O where possible and again against provider authority when configuration depends on identity.
  5. Keep all tools explicitly read-only or route consequential behavior through the existing action lifecycle. Do not add a second gateway or credential path.
  6. Add catalog parity, runtime dispatch, invalid-input, provider-failure, cancellation, concurrency, isolation, truncation, and credential-redaction tests.
  7. Document HTTP changes in backend OpenAPI and update both operator setup and this developer path.

Dashboard URLs supplied during onboarding are operator navigation aids only. Never persist them as runtime endpoints or infer secrets from their path identifiers.

These providers reuse the existing typed JSONB settings column, integration gateway URLs, and control-plane commands. Adding Lemon Squeezy, Paddle, Strapi, or Plausible therefore requires OpenAPI and documentation updates, but no database migration or oblivectl contract change.

Release Verification

Run the focused provider and OAuth tests, catalog tests, OpenAPI synchronization, repository typecheck/lint/format checks, and the docs build. Exercise connect, configuration, a bounded read, scope change, credential rotation, reauthorization, disable, and disconnect with separate organization rows.

Google Search Console

The fixed backend provider shares Google OAuth credential storage, rotation and revocation. Reads use webmasters.readonly; optional writes require an explicitly authorized webmasters grant. Settings changes use the connection revision to reject a concurrent disconnect or reauthorization. siteUrls bounds reporting, URL inspection and sitemap operations. The separate optional propertyManagementSiteUrls allowlist bounds add/remove-property operations and does not grant reporting access. A management-only connection requires full access. Agents cannot edit either list.

Six reviewed reads list selected properties, read property access, query Search Analytics, inspect indexed URLs, and list/read sitemaps. Four consequential tools submit/delete sitemaps and add/delete properties. Gateway action intent, approval, receipts and unknown-outcome handling are reused; Operator remains read-only. New writes require Google reauthorization. Same-mode reconnection preserves an existing nonempty tool selection.

Queries accept 1–25,000 rows, default 1,000. Only Search Analytics allows a 32 MiB raw response; other GSC responses retain the 1 MiB limit. Complete MCP results remain 256 KiB. Oversized analytics pages return a bounded prefix with responseLimited: true and nextStartRow calculated from actually delivered rows. No row is silently skipped by using the requested page size as the offset. This is continuation, not an exhaustive export or a snapshot of changing Google data.

The shared HTTP owner pins reviewed Google origins, paths and methods and rejects redirects. Interactive reads use at most three transient attempts with jitter and Retry-After within one 30-second deadline, plus at most one 401 refresh attempt. Each dispatch refreshes and validates the connection generation. invalid_grant and permission errors never enter transient retry. Recognized 403 quota reasons map to 429 with a 15-minute fallback delay; long delays return to the caller. Writes never retry inside the adapter, including after 401, timeout or 5xx; known quota rejection reaches the durable action retry owner. Collector requests set one transient attempt and preserve retry timing for their existing durable scheduler. Google token endpoint 429/5xx retain status and Retry-After as well.

An eight-request process-wide admission bound includes credential refresh, response consumption and backoff. It spans gateway instances and collection, but is not a distributed Google quota ledger. Google quotas are shared by project, account and property; other clients and replicas remain relevant.

The analytical adapter retains finalized daily web-search clicks, impressions and CTR. It uses Pacific calendar boundaries, a three-day cutoff, and the existing hourly collection scheduler. CTR retains clicks and impressions so aggregation computes a weighted ratio. Missing dates stay missing. Average position and page/query detail are live-tool results, not retained metric series.

Current property selection and Google subject also fence retained analytical reads. Ordinary analytics storage is mutable: an RSI replay must separately freeze and fingerprint its input artifacts. Neither collectedAt nor the three-day cutoff reconstructs the first availability of historical revisions.