{
  "markdown": "# Retain MCP Server\n\nLet your AI agent see who is about to churn, and do something about it.\n\n`@retain-so/mcp-server` connects [Retain](https://retain.so) to any MCP client (Claude Code, Claude Desktop, Cursor, Windsurf, and friends). Ask in natural language which customers are at risk, pull a customer's full health profile, check MRR at risk, and log outreach, all without opening the dashboard.\n\nRetain is an AI-first churn prevention and customer analytics platform. This server is the bridge between your agent and your Retain data.\n\n## What you can ask your agent to do\n\nRead:\n\n- \"Which customers are at critical risk this week?\"\n- \"Show me my high-risk customers ordered by MRR.\"\n- \"What's my total MRR at risk, broken down by risk level?\"\n- \"Pull the full profile for Acme Inc.\"\n- \"List the active alerts I haven't contacted yet.\"\n- \"Summarize this month's churn metrics and net revenue retention.\"\n\nAct (needs a read+write key):\n\n- \"Mark the alert for Globex as contacted.\"\n- \"Archive the resolved alert for Initech.\"\n\n## Setup (under 5 minutes)\n\n1. In Retain, go to **Settings → Agent keys** and create a key. Pick **read** for query-only, or **read & write** to let the agent take actions. Copy it (it is shown once).\n2. Add the snippet for your client below.\n3. Restart the client and ask your first question.\n\n### Claude Code\n\n```bash\nclaude mcp add retain --env RETAIN_API_KEY=rk_agent_xxx -- npx -y @retain-so/mcp-server\n```\n\n### Claude Desktop (`claude_desktop_config.json`)\n\n```json\n{\n  \"mcpServers\": {\n    \"retain\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@retain-so/mcp-server\"],\n      \"env\": { \"RETAIN_API_KEY\": \"rk_agent_xxx\" }\n    }\n  }\n}\n```\n\n### Cursor / Windsurf (`.cursor/mcp.json` or `~/.codeium/windsurf/mcp_config.json`)\n\n```json\n{\n  \"mcpServers\": {\n    \"retain\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@retain-so/mcp-server\"],\n      \"env\": { \"RETAIN_API_KEY\": \"rk_agent_xxx\" }\n    }\n  }\n}\n```\n\n## Tools\n\n| Tool                    | Type  | What it does                                                                                                 |\n| ----------------------- | ----- | ------------------------------------------------------------------------------------------------------------ |\n| `get_at_risk_customers` | read  | Customers by churn risk (`Critical`/`High`/`Stable`/`Healthy`), ordered by MRR. Defaults to Critical + High. |\n| `get_customer_details`  | read  | Full profile for one customer by id or name.                                                                 |\n| `get_mrr_at_risk`       | read  | Total MRR at risk plus active-alert counts by risk level.                                                    |\n| `get_active_alerts`     | read  | Active alerts by priority, with risk factors and outreach state.                                             |\n| `get_churn_metrics`     | read  | Churn rate, MRR churned, expansion/contraction, net revenue retention.                                       |\n| `mark_alert_contacted`  | write | Mark an alert as contacted.                                                                                  |\n| `archive_alert`         | write | Archive a resolved alert.                                                                                    |\n\nComing soon: `send_retention_email` (trigger a templated retention email).\n\n## Example conversation\n\n> **You:** Who's about to churn and how much money is on the line?\n>\n> **Agent:** _(calls `get_mrr_at_risk`, then `get_at_risk_customers`)_ You have $4,200 MRR at risk across 7 active alerts. The two biggest are Acme Inc ($900, critical, 18 days inactive) and Globex ($650, high).\n>\n> **You:** I emailed Acme today, mark their alert as contacted.\n>\n> **Agent:** _(calls `mark_alert_contacted`)_ Done. Acme's alert is now marked as contacted.\n\n## Configuration\n\n| Variable         | Required | Default                 | Description                                      |\n| ---------------- | -------- | ----------------------- | ------------------------------------------------ |\n| `RETAIN_API_KEY` | yes      | (none)                  | Agent key from Settings → Agent keys.            |\n| `RETAIN_API_URL` | no       | `https://api.retain.so` | Override the API base URL (self-host / staging). |\n\n## Development\n\n```bash\nnpm install\nnpm run dev        # run from source with tsx\nnpm run build      # bundle to dist/\nnpm run typecheck\n```\n\nThe server holds no business logic and no database. It only translates MCP tool calls into HTTP requests against Retain's public `/agent/*` API. Contributions and new tools are welcome.\n\n## License\n\nMIT\n",
  "bytes": 4620,
  "sha": "673522c32e536fd8f4e745f363b159b746dfeb33d3c44a038ae889a9dd1a4748",
  "repo_slug": "retain-so/mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_retain_so_mcp_server_feca6551/readme"
}