MCP Recipe Book / Customer Health Model
← All recipes Sample data
Recipe
Customer Health Model
Version
1.0
Status
Sample data
Tools used
Subscriptions · Invoices · Transactions · Subscription Ramps
Query type
Fitted model
Retention Recipe

Score every customer for churn risk, fitted to your own book.

With Chargebee MCP, your subscriptions, invoices, and payment history are live and interlinked. Point your AI client at it to fit a churn model to your own data. Then it scores every paying customer across segment, plan, geography, and industry.

6
Weighted signals
3
Health bands
4
Dimensions sliced
Live output

One model, fitted to the real split between your churned and active customers. Every paying customer banded Healthy, Watch, or At Risk. Filter across segment, plan, geography, and industry; hover any band for counts.

Sample data shown for illustration
01 What this changes

Fit the model to your churn, not a generic template

Most health scores are a template: someone picks the signals and the weights by intuition, and every company runs the same formula. But the signals that predict churn in a monthly SMB book are not the ones that predict it in an annual enterprise book.

This recipe fits the model to your data. The AI reads your full subscription and invoice history, measures which signals separate your churned customers from your active ones, and fits weights to them. Every paying customer is then banded Healthy, Watch, or At Risk. Your signals will differ from the example below. That is the point.

02Why this works

Let the data pick the weights, not your intuition

For each candidate signal, the engine measures how strongly it separates churned from active customers in your book. It drops the ones that do not discriminate and derives weights from a logistic fit. It also excludes circular signals that are really the churn event itself. A signal that is quiet in one book can be decisive in another.

The strongest validated billing finding: customers whose invoice value and volume both go flat churn at roughly twice the baseline rate. That is a stronger tell than outright decline. Chargebee keeps the full subscription and invoice history queryable, so the model fits on your real paying population rather than a skewed slice. Engagement leads, billing confirms — together they catch far more than either alone.

The signal was always there. What was missing was a fast way to ask for it.

03 The exact prompt

A technical, four-phase prompt. Paste it into any MCP-connected AI client and send. It stays collapsed by default, so business readers can skip the detail.

Show the full prompt Hide the full prompt

Run it as written. The tool names and segment thresholds adapt to your account. The four phases run in order: establish the paying population, build signals, fit weights to your churn, then build the dashboard.

list_subscriptions export_invoices list_transactions list_subscription_ramps
Build me a customer health / churn-risk model from my Chargebee data, fitted to
my own churn patterns — not a generic template. Work through the phases in
order, show your reasoning, and never present an assumed number as a measured one.

PHASE 1 — Establish the real population.
· Call list_subscriptions with status = active. Paginate until next_offset is
  null. Treat a customer as PAYING only if subscription mrr > 0 — exclude
  $0 / trial / free subscriptions.
· Call list_subscriptions with status in (cancelled, non_renewing) to get the
  previously-paying customers who have since churned.
· Report both counts. If churned paying customers < ~50, say plainly the
  sample is thin and downstream results are directional only.
· Compute annual contract value per customer from plan_unit_price × billing
  frequency (+ addons). Segment: Startup <$15K, Scaleup $15K–$70K,
  Enterprise >$70K.

PHASE 2 — Build candidate signals (compute for active AND churned).
· Contract commitment: from subscription billing_period / billing_period_unit
  (annual vs quarterly vs monthly).
· Payment distress: export_invoices for the trailing 12 months; read
  dunning_status, and pull transactions / list_transactions for failed payments.
· Invoice trend: from export_invoices, compute invoice value and count per
  trailing quarter — flag whether each is rising, flat, or falling.
· Tenure: from subscription created_at / activated_at to today.
· Ramps: list_subscription_ramps with subscription_id[in] batched across the
  segment to flag negotiated escalation deals.
· For each signal, state how many customers you could actually compute it for
  vs. had to treat as neutral.

PHASE 3 — The learning engine. Fit, do not assume.
· For each candidate signal, measure how strongly it separates churned from
  active customers IN MY DATA (report correlation / churn-rate difference, the
  sample size n, and a significance test).
· Drop signals that do not discriminate. Exclude any CIRCULAR signal (one that
  is really the churn event itself, e.g. an action-at-term-end = cancel flag).
· Derive weights from the data via a logistic fit — not intuition. Show each
  signal's weight and the resulting model correlation.
· Check for sampling bias: confirm you are on the FULL paying book, not a
  plan-tier-filtered slice that skews toward large / tenured accounts, which
  inflates every correlation. State which population each statistic comes from.

PHASE 4 — Report and build.
· Give the final weighted parameter list (6–8 strongest signals), the bands
  (Healthy / Watch / At Risk), and the precision/recall tradeoff at a few score
  thresholds — with the threshold you would use for CS triage.
· If billing signals alone are limited, say which usage/consumption signals
  would lift the model, and why.
· Build a single-file interactive HTML dashboard: score distribution and health
  breakdowns by segment, plan, geography, and industry, scored with the fitted
  model. Hover on a band shows the customer count.

If you ever find yourself reframing my request to make a number look better, stop
and tell me instead.

Four phases: establish the paying population, build candidate signals, fit weights to your churn, then build the dashboard. Tool names and thresholds adapt to your account.

04 Try it yourself

Requirements
A Chargebee account, an MCP-compatible AI client (Claude, ChatGPT, Cursor, or any MCP client), and Chargebee MCP connected.
Setup
Connect over OAuth, no API keys required. Paste the prompt above and send.
What to expect
The client makes several calls to pull your full history before scoring. Because the model is fit to your data, your signals and weights will differ from the example.
What you get
A self-contained HTML dashboard scored with your fitted model. It comes with an honest read on how well your signals predict churn, and what to instrument next.
Supported clients
Claude (web and desktop), ChatGPT, Claude Code, Gemini, Cursor, VS Code, Windsurf, Zed, and any MCP-compatible client.
More recipes
Want the rest of the recipe book?
Browse all recipes →
Not running it yourself?
Talk to the team about what a fitted churn model shows for your book.
Get a demo →