Skip to main content
Glama
README.md
# @retainq/mcp

RetainQ MCP Server — Connect AI assistants to your churn reduction platform.

## What is this?

This is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for [RetainQ](https://retainq.com). It lets AI assistants (like Claude, Cursor, Kiro, etc.) interact with your RetainQ workspace — query retention metrics, manage flows, analyze churn data, and more.

## Installation

```bash
npx @retainq/mcp
```

Or install globally:

```bash
npm install -g @retainq/mcp
```

## Configuration

### Environment Variable

Set your RetainQ API key:

```bash
export RETAINQ_API_KEY=rq_live_your_key_here
```

Get an API key from **Settings → API Keys** in your RetainQ dashboard.

### MCP Client Config

Add to your MCP client configuration (e.g., Claude Desktop, Kiro, Cursor):

```json
{
  "mcpServers": {
    "retainq": {
      "command": "npx",
      "args": ["@retainq/mcp"],
      "env": {
        "RETAINQ_API_KEY": "rq_live_your_key_here"
      }
    }
  }
}
```

## Available Tools (32)

### Analytics
- `get_retention_stats` — Workspace metrics overview
- `get_recent_sessions` — Latest flow sessions with outcomes
- `get_top_churn_reasons` — Cancellation reasons ranked by frequency
- `get_high_risk_customers` — Customers above churn risk threshold
- `get_offer_performance` — Offer acceptance rates and revenue

### Flows
- `list_flows` — List all flows
- `get_flow` — Get flow details
- `create_flow` — Create new flow (simple or advanced)
- `update_flow` — Update flow metadata
- `delete_flow` — Archive a flow
- `configure_simple_flow` — Set simple flow config (survey, offers, feedback, design)
- `set_advanced_flow_schema` — Set node-based flow schema
- `publish_flow` — Publish and make live
- `get_flow_schema` — Get current published schema

### Offers
- `list_offers` — List all retention offers
- `create_offer` — Create new offer
- `update_offer` — Update offer
- `delete_offer` — Archive offer

### Customers
- `list_customers` — List customers with churn scores
- `get_customer` — Get customer by email
- `get_customer_sessions` — Get a customer's session history

### Opportunities
- `list_opportunities` — List retention opportunities
- `confirm_opportunity` — Confirm/fulfill an opportunity
- `reject_opportunity` — Reject an opportunity

### AI Intelligence
- `run_churn_analysis` — Run AI-powered churn analysis
- `ask_ai` — Ask RetainQ AI a question about your data

### Notifications
- `list_notifications` — Get recent notifications
- `get_notification_preferences` — Get notification settings
- `update_notification_preferences` — Update notification settings

### Feedback
- `list_feedback` — Get session feedback/answers
- `export_feedback_csv` — Export feedback as CSV

## API Base URL

By default connects to `https://app.retainq.com/api/v1/public`. Override with:

```bash
export RETAINQ_API_URL=http://localhost:3000/api/v1/public
```

## License

MIT