Docs

MCP Integration

Connect RetainQ to AI assistants and tools using the Model Context Protocol (MCP).

What is MCP?

The Model Context Protocol is a standard for AI assistants to interact with external services. RetainQ provides an MCP server that lets AI tools query your retention data, customer risk scores, and offer performance.

Endpoint

https://app.retainq.com/api/v1/mcp

Available Tools

ToolDescription
get_retention_statsOverview metrics: sessions, retention rate, revenue saved, active flows
get_recent_sessionsLast N sessions with customer email and outcome
get_top_churn_reasonsMost common cancellation reasons ranked by frequency
get_high_risk_customersCustomers with high churn risk scores
get_offer_performanceAcceptance rates and revenue per offer type

Configuration

Add RetainQ to your MCP client configuration:

{
  "mcpServers": {
    "retainq": {
      "url": "https://app.retainq.com/api/v1/mcp",
      "description": "RetainQ churn reduction platform"
    }
  }
}

Protocol

RetainQ uses JSON-RPC 2.0 over HTTP POST:

List Tools

POST /api/v1/mcp
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Call a Tool

POST /api/v1/mcp
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "get_retention_stats",
    "arguments": {}
  }
}

Response Format

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{
      "type": "text",
      "text": "{ \"total_sessions\": 40, \"retention_rate\": \"47%\", ... }"
    }]
  }
}

Tool Details

get_retention_stats

No parameters required. Returns workspace-level metrics.

{
  "total_sessions": 40,
  "retention_opportunities": 18,
  "confirmed_retained": 12,
  "retention_rate": "45.0%",
  "revenue_saved": "$588",
  "active_flows": 2,
  "total_customers": 20
}

get_recent_sessions

Parameters: limit (number, default 10, max 50)

get_top_churn_reasons

Parameters: limit (number, default 10)

get_high_risk_customers

Parameters: threshold (number, default 0.5, range 0-1)

get_offer_performance

No parameters. Returns acceptance rates and revenue for each offer type.

Discovery

You can also discover available tools via GET:

GET /api/v1/mcp

Returns the server metadata and tool list.