Connect your AI agent via MCP
MCP (Model Context Protocol) is an open standard that lets AI clients discover and call tools on your behalf. Add ChurnWin's MCP server to Claude, Cursor, or any compatible client and your agent can query churn data, at-risk customers, and cancellation feedback without any custom code.
Set up ChurnWin MCP in four steps
Step 1
Create an agent key
Sign up, connect Stripe, then mint a read-only key in Settings → Agent Access.
Step 2
Add the MCP endpoint
Use https://api.churnwin.com/mcp/ and send the key in the Authorization bearer header.
Step 3
Save the client config
Paste the JSON config into your MCP-compatible client and replace the example key.
Step 4
Connect and query
Reload the client, confirm the ChurnWin tools appear, and ask a churn question.
Connection details
Endpoint
https://api.churnwin.com/mcp/Auth header
Authorization: Bearer cwk_live_…Keys are minted at Settings → Agent Access. You need an active ChurnWin plan to create one.
Copy-paste config
Drop this into your MCP client config (e.g. claude_desktop_config.json for Claude Desktop, or the MCP settings panel in Cursor / Windsurf).
{
"mcpServers": {
"churnwin": {
"url": "https://api.churnwin.com/mcp/",
"headers": {
"Authorization": "Bearer cwk_live_YOUR_KEY_HERE"
}
}
}
}Replace cwk_live_YOUR_KEY_HERE with the key you generated in Settings.
Verify a failed-payment recovery connection
Do more than confirm that the server appears in your client. Run one bounded recovery brief to verify that the key can see the intended Stripe business, the metrics use the expected 30-day window, and any recommended action stays under human review.
1. Confirm the business scope
Start with list_businesses. If the key can see more than one connected Stripe account, choose the intended business id and pass that same businessvalue to the recovery tools. A connection-scoped key remains limited to its assigned business.
2. Run the evidence brief
Paste this after the ChurnWin tools load. It asks the client to distinguish observed recovery data from a recommendation instead of inventing an outcome.
Copyable connection check
Use list_businesses to confirm the Stripe business scope. Then review the last 30 days of failed-payment churn with get_metrics, list_recent_churn, and get_action_plan. Report payment_failures, recovered_count, recovered_mrr, and at_risk_mrr. State the period and business used. Separate observed values from recommendations. Do not contact customers or change billing.
3. Check the evidence before acting
Scope
The response names the 30-day period and the business id, or says that the result spans every business visible to the key.
Recovery snapshot
Payment failures, attributed recoveries, recovered MRR, and MRR still at risk are reported as observed values. A real zero remains zero; it is not replaced with a marketing estimate.
Human gate
The agent may rank a next step, but billing changes and customer contact remain a person's decision outside the read-only MCP server.
Available tools
Your AI client will see these 11 tools automatically once the server is connected. All tools accept an optional business parameter to scope results to a specific connected Stripe account.
get_metrics
Current churn rate, MRR, retention, and subscription counts for a given period
get_churn_trend
Day-by-day churn volume over a rolling window
get_churn_reasons
Reason counts combine linked subscriptions and unlinked observations that may overlap, not unique lost subscriptions or customers. count_basis labels reason and account rows; no monetary total or percentage is returned.
list_at_risk_customers
Subscribers ranked by rule-based risk score with the factors that scored them
list_recent_churn
Recent cancellation and payment-failure observations; lost MRR is null, not zero (currency unavailable). Total counts observations, not unique subscription losses.
list_unresolved_failed_payments
Failed payments that still need action, one row per unpaid invoice (a failure Stripe sent without an invoice id gets its own row), sorted by stored subscription value (not currency-converted), then amount due, then oldest failure, then row id: retry status, attempts, next retry and amount due in the invoice currency; recoverable MRR is null (currency unavailable). No customer email, invoice link or Stripe id is returned. When scan_limited is true, the queue was built from capped scans of recent failures and recovery records, so it can be incomplete and can still list an invoice whose recovery was recorded outside the scan.
get_cancellation_feedback
Verbatim Stripe cancellation feedback observations; lost MRR is null, not zero (currency unavailable). Observations may overlap, not unique subscription losses.
get_action_plan
ChurnWin's AI-generated prioritised retention recommendations
get_feedback_performance
Survey send, open, and response rates over time
list_customers
Full customer roster with status, plan, and MRR — paginated and searchable
list_businesses
All Stripe accounts connected to your ChurnWin workspace
Try it with Claude
Once connected, you can ask Claude natural-language questions about your churn:
You: What are my top churn reasons this quarter and what should I fix first?
→ Claude calls get_churn_reasons, get_action_plan, and get_cancellation_feedback automatically, then synthesises an answer.
Get your API key
You need a ChurnWin account with Stripe connected. Once you're in, head to Settings → Agent Access to mint a key.
Developer overview
What the API gives you, who it's for
REST API reference
All endpoints, params, and JSON examples