Back to all days

Day 15 — ML Engineering

Churn Prediction Pipeline

Your best customers don't leave without warning. You're just not listening.

An ML-powered MCP server that computes churn risk scores from usage patterns, billing signals, and support history. It doesn't just tell you who's at risk — it tells you why and what to do about it.

Example Queries

“Which customers are most likely to churn this month?”
“Show me the churn risk breakdown for Coastal Dev”
“What’s our total MRR at risk right now?”
“How has Meridian Group’s usage changed over the last 8 weeks?”
“What should we do to save Blue Ridge Law?”
“Give me the executive churn pipeline summary”

Tools

6 MCP Tools

ToolWhat It Does
customer_overviewSearch customers by name, company, plan, status, or industry. Returns profile info with current churn risk score.
churn_risk_scoreDetailed churn risk breakdown for a customer — usage, billing, support, and engagement signal scores with contributing factors.
at_risk_cohortList all customers sorted by churn risk. Filter by risk level or minimum score. Shows revenue at risk.
usage_trendsWeekly usage patterns — logins, API calls, features used, active users, session time. Shows trend direction.
intervention_recommendationsRecommended actions for at-risk customers based on their churn risk factors. Prioritized by impact with assigned owners.
pipeline_summaryExecutive dashboard — risk distribution, revenue at risk, average scores by plan, and recent churn.

The Model

How Churn Scoring Works

Each customer gets a 0–100 churn risk score computed from four weighted signal categories:

Usage Signal

0–30 pts

Login decline, API usage drop, low feature adoption

Billing Signal

0–25 pts

Failed payments, downgrades, cancellation requests, discount asks

Support Signal

0–25 pts

Ticket volume, low satisfaction scores, escalations, open issues

Engagement Signal

0–20 pts

Days since last login, account age, activity recency

0–24 Low • 25–44 Medium • 45–69 High • 70–100 Critical

Why This Build

Why Churn Prediction?

Churn is the silent killer of SaaS companies. By the time a customer asks to cancel, the relationship has been deteriorating for weeks or months. The signals were there — declining logins, failed payments, frustrated support tickets — but nobody connected the dots.

Most companies track these metrics in separate dashboards. Usage in one tool, billing in another, support in a third. The insight lives in the intersection, but nobody has time to cross-reference three systems for every customer.

This pipeline does the cross-referencing automatically. It scores every customer across four signal categories, ranks them by risk, and recommends specific interventions with assigned owners. Ask “who's about to churn?” and get an answer with revenue impact — not a Jira ticket to investigate later. First ML Engineering build of the challenge.

Demo Data

What's Inside

15

Customers

108

Usage Snapshots

25

Billing Events

21

Support Tickets

5

Risk Profiles

8

Weeks of Data

15 SaaS customers across starter, pro, and enterprise plans with 8 weeks of usage snapshots. Includes healthy accounts, declining users, billing risk, support-heavy accounts, critical churn candidates, and two recently churned customers for comparison. Edge cases: cliff-drop usage, serial payment failures, and a customer who already requested cancellation.

Setup

Try It Locally

cd day15-churn-prediction
npm install && npm run seed && npm run build

Then add the config to Claude Desktop and restart.

Want to predict churn before it happens?

If your customer success team is firefighting cancellations instead of preventing them, let's build something smarter.