Audit Stripe subscriptions against app entitlements
Compare current billing state with Supabase access state and return a reviewed exception report without changing either system.
Target user
SaaS founder, billing engineer, or operations engineer whose application stores entitlement state separately from Stripe.
Trigger
A billing incident, customer access complaint, or operator-requested reconciliation review.
Why run it repeatedly
Run after billing incidents and only on an operator-approved recurring cadence. Public evidence does not establish the right cadence or discrepancy rate.
What you receive
An exception report with both system values, stable IDs, join method, applicable access rule, source links, confidence, and next verification step.
Pain evidence
Moderate technical evidence for webhook ordering/idempotency failure modes; low evidence for how often teams encounter them or would pay for this workflow.
Alternatives and remaining gap
Stripe webhooks, Revenue Recovery, and a deterministic reconciliation job are stronger for routine operation. MCP may help explain a small ambiguous exception set; it should not replace event processing or source-of-truth logic.
Execution flow
- Confirm Stripe mode and Supabase project match the requested environment; inspect only the approved database view.
- Read and paginate Stripe subscriptions. Read only relevant local IDs, status/plan, entitlement, and sync timestamp.
- Join primarily on subscription ID; use customer ID only with an explicit tenant mapping. Keep multiple subscriptions separate.
- Apply the operator-supplied entitlement rule. Mark missing or duplicate mappings ambiguous; never guess from email or name.
- Retrieve current Stripe state for exceptions and report both values with source IDs. Do not write or change access.
Required tools
- Stripe: stripe_api_search, stripe_api_details, stripe_api_read for subscription list/retrieve
- Supabase: list_tables, execute_sql with project_ref and read_only=true
Prerequisites and costs
Stripe read access in the chosen account/environment; Supabase database read scope with project_ref and read_only=true; stable Stripe IDs and entitlement fields in an approved view; a written access/grace-period policy; an MCP client that can connect both servers and handle pagination. Plan/API limits depend on connected accounts.
Run this prompt
Run a read-only discrepancy audit for Stripe mode [sandbox/live] and Supabase project [project ref], using only approved view [name] for [UTC window]. Do not write, change entitlements, message customers, or read unrelated data. First verify Stripe mode and Supabase project. Inspect the approved view for stable Stripe IDs and entitlement fields. If IDs or the operator policy are missing, stop. List Stripe subscriptions using read tools and follow every pagination cursor. Read only matching local fields. Join by subscription ID first; use customer ID only with explicit tenant mapping. Do not fuzzy-match names/emails or merge multiple subscriptions. Apply this supplied policy: [paste entitlement rule]. Do not invent grace periods. Verify exceptions against current Stripe state; event timing does not prove root cause or webhook delivery. Return compared counts, scope/mode, exceptions with safe tenant ID, Stripe IDs, both values, join method, rule, evidence links, confidence, and unmatched/ambiguous/incomplete records. If incomplete or environments conflict, stop. Propose no silent correction.
Review checkpoints
Review account mode, project, join keys, and entitlement policy before interpreting exceptions. A separate human approval is required before changing access, contacting a customer, refunding, or modifying billing.
Limitations
Only fits app state stored in Supabase. Bulk pagination and joins may exceed an interactive client?s context or reliability; a deterministic script is preferable at scale. MCP alone does not schedule runs. Stripe/app disagreement does not identify the cause.
Manual work and missing capabilities
Customer-specific SQL/view and entitlement policy; external scheduler, run history, retry state, and alerts for unattended work; human-approved remediation. Large account joins need code or warehouse processing.
Failure handling
Bounded retry on Stripe pagination and mark incomplete if any page is lost. Abort on project/mode mismatch or Supabase read failure. Flag duplicate IDs, missing mappings, and multiple subscriptions as ambiguous. Compute comparisons deterministically; do not let the model decide field equality.
Pilot acceptance criteria
Against 30 synthetic rows and a deterministic reference script: identical exact joins/diffs; all ambiguous rows flagged; all pages accounted for; environment mismatch aborts; zero writes; every exception includes source IDs.
Product fit
Start as an MCPfolio recipe for interactive review of a small exception set. If bulk recurring demand is proven, package deterministic extraction, joins, policy checks, alert deduplication, and audit logs, using AI only for exception explanations.
Demo storyboard
Compare synthetic sandbox subscriptions with a staging entitlement view. Show exact matches, an active-versus-cancelled discrepancy, a multi-subscription ambiguous case, and a clean read-only report.
Official sources
Tools documentation verified; workflow not runtime tested









