Skip to main content
Retain speaks MCP. Point any MCP client at @retain-so/mcp-server and your agent can answer “who is about to churn?” without you opening a dashboard. The server holds no business logic and no database. It translates MCP tool calls into HTTP requests against Retain’s /agent/* API, authenticated with an agent key you create and can revoke at any time.
Agent keys are not the same as the Project Token used for ingest. A read key can only query. A read & write key can also mark alerts as contacted and archive them.

What you can ask

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

Set it up

1

Create an agent key

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.The key starts with rk_agent_ and is shown once, so copy it before closing the dialog.
2

Add it to your MCP client

Drop your key into the config for your client. Claude Desktop (claude_desktop_config.json), Cursor (.cursor/mcp.json) and Windsurf (~/.codeium/windsurf/mcp_config.json) all take the same JSON.
3

Restart and ask something

Restart the client so it picks up the new server, then ask it who is about to churn. A first npx run downloads the package, so give it a few seconds.

Tools

get_at_risk_customers defaults to Critical and High risk, and get_customer_details takes either a customer id or a name. Coming soon: send_retention_email, to trigger a templated retention email.

Configuration

Troubleshooting

  • RETAIN_API_KEY is not set. The client launched the server without the env var. Check that env sits inside the retain entry in your config, not next to it.
  • Invalid or revoked agent key. The key was revoked, or belongs to another organization. Create a new one in Settings → Agent keys.
  • This agent key is read-only. The agent tried an action tool with a read key. Create a read & write key and swap it in.
  • The server never shows up. MCP clients read their config at startup, so restart fully after editing it. The server needs Node 22 or newer.

Next steps

Source on GitHub

Read the code, open an issue, or contribute a tool.

Authentication

The Project Token used to send events, which is a different key.