Retain So

io.github.retain-so由 GitHub 账号 retain-so 发布v0.1.2更新于 Oct 24, 2026

Model Context Protocol server for Retain: let AI agents query churn risk and act on retention.

已验证STDIO仅桌面数据与分析商业与电商

概览

AI 生成的概览

Retain MCP 服务器让 AI 助手查询 Retain 中的流失风险、客户健康度、风险 MRR 和提醒,并可标记或归档提醒。

可以做什么
按风险等级查询有流失风险的客户并按 MRR 排序,按 id 或名称获取单个客户的完整档案。读取风险 MRR 及各风险等级的活跃提醒数量,按优先级列出活跃提醒及其风险因素和触达状态。汇总流失指标:流失率、流失 MRR、扩展/收缩和净收入留存率。对提醒执行操作:标记为已联系或归档已解决的提醒(需要读写密钥)。
适用场景
适合已在使用 Retain 的客户成功、支持或营收团队,希望用自然语言让助手查出谁即将流失、有多少 MRR 面临风险,并在不打开仪表盘的情况下记录触达情况。
运行要求
通过 npx 从 npm 包 @retain-so/mcp-server 在本地运行,需要 Node.js。需要 Retain 代理密钥,通过环境变量 RETAIN_API_KEY 传入,在 Settings → Agent keys 中创建;仅查询选 read,需要执行操作选 read & write。需要访问 Retain API 的网络连接;可用 RETAIN_API_URL 覆盖 API 基础地址。
安装前请注意
RETAIN_API_KEY 是仅显示一次的密钥,可访问你的 Retain 客户数据;读写密钥还允许助手更改提醒状态。写入工具会将提醒标记为已联系并归档提醒,从而修改 Retain 中的数据。工具调用会被转换为对 Retain API 的 HTTP 请求,因此客户数据会发送到该服务。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Retain So,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Retain MCP Server

Let your AI agent see who is about to churn, and do something about it.

@retain-so/mcp-server connects Retain 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.

Retain is an AI-first churn prevention and customer analytics platform. This server is the bridge between your agent and your Retain data.

What you can ask your agent to do

Read:

  • "Which customers are at critical risk this week?"
  • "Show me my high-risk customers ordered by MRR."
  • "What's my total MRR at risk, broken down by risk level?"
  • "Pull the full profile for Acme Inc."
  • "List the active alerts I haven't contacted yet."
  • "Summarize this month's churn metrics and net revenue retention."

Act (needs a read+write key):

  • "Mark the alert for Globex as contacted."
  • "Archive the resolved alert for Initech."

Setup (under 5 minutes)

  1. 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).
  2. Add the snippet for your client below.
  3. Restart the client and ask your first question.

Claude Code

bash
claude mcp add retain --env RETAIN_API_KEY=rk_agent_xxx -- npx -y @retain-so/mcp-server

Claude Desktop (claude_desktop_config.json)

json
{  "mcpServers": {    "retain": {      "command": "npx",      "args": ["-y", "@retain-so/mcp-server"],      "env": { "RETAIN_API_KEY": "rk_agent_xxx" }    }  }}

Cursor / Windsurf (.cursor/mcp.json or ~/.codeium/windsurf/mcp_config.json)

json
{  "mcpServers": {    "retain": {      "command": "npx",      "args": ["-y", "@retain-so/mcp-server"],      "env": { "RETAIN_API_KEY": "rk_agent_xxx" }    }  }}

Tools

ToolTypeWhat it does
get_at_risk_customersreadCustomers by churn risk (Critical/High/Stable/Healthy), ordered by MRR. Defaults to Critical + High.
get_customer_detailsreadFull profile for one customer by id or name.
get_mrr_at_riskreadTotal MRR at risk plus active-alert counts by risk level.
get_active_alertsreadActive alerts by priority, with risk factors and outreach state.
get_churn_metricsreadChurn rate, MRR churned, expansion/contraction, net revenue retention.
mark_alert_contactedwriteMark an alert as contacted.
archive_alertwriteArchive a resolved alert.

Coming soon: send_retention_email (trigger a templated retention email).

Example conversation

You: Who's about to churn and how much money is on the line?

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).

You: I emailed Acme today, mark their alert as contacted.

Agent: (calls mark_alert_contacted) Done. Acme's alert is now marked as contacted.

Configuration

VariableRequiredDefaultDescription
RETAIN_API_KEYyes(none)Agent key from Settings → Agent keys.
RETAIN_API_URLnohttps://api.retain.soOverride the API base URL (self-host / staging).

Development

bash
npm installnpm run dev        # run from source with tsxnpm run build      # bundle to dist/npm run typecheck

The 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.

License

MIT

来源:README.md,提交 627800e

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分