Set up a SaaS affiliate program with Claude Code in one prompt
Connect Claude Code (or Cursor) to Kickrail's MCP server and let the agent install tracking, report signups from your server, verify it on your live site and configure commissions.
Most of the work in launching an affiliate program is wiring: a script on every page, a call in your signup handler, Stripe connected, a test click to prove it works. An AI coding agent is good at exactly that, as long as it can see both your codebase and your affiliate tool. Kickrail is an MCP server, so it can.
1. Create a program and copy the server key
Sign up at kickrail.com and create a program. In Settings → Server API key, copy the key that starts with sk_kr_. Treat it like any server secret: it can do what the REST API can.
2. Connect the agent
Claude Code:
claude mcp add --transport http kickrail https://kickrail.com/api/mcp \
--header "Authorization: Bearer sk_kr_..."Cursor, in .cursor/mcp.json:
{
"mcpServers": {
"kickrail": {
"url": "https://kickrail.com/api/mcp",
"headers": { "Authorization": "Bearer ${env:KICKRAIL_SECRET_KEY}" }
}
}
}3. Ask for the whole setup
From your app's repository:
Set up Kickrail affiliate tracking in this app. Use the kickrail MCP:
check setup_status, install the script, report signups from our
signup handler, and verify it on the live site.What the agent does with that:
setup_statustells it what's done and what's next: Stripe, script, a test click, affiliates.get_install_instructionsreturns the script tag and where it goes for your framework (Next.js, React, plain HTML, WordPress, Webflow, Framer or Shopify), plus the server call for signups. The agent edits your code.connect_stripegives you a link. Approving Stripe is always your click, never the agent's.- After you deploy,
verify_installfetches your live site, checks the script is there and loaded, and hands back a test link to click.
4. Configure the program
Keep going in the same session:
Make the default campaign 30% recurring for 12 months, with a 30-day
hold and a $50 minimum payout. Add a "Creators" campaign at 40%, and
serve the join page from partners.ourapp.com.The agent uses update_campaign, create_campaign and add_portal_domain. For the domain, it gives you the CNAME record, or adds it if it can reach your DNS provider, and checks until the page is live with HTTPS.
5. Coming from Rewardful?
start_rewardful_import runs the same import as the dashboard: campaigns, affiliates, links, codes, referrals and commissions. Your Rewardful secret is used once and never stored. Then ask the agent to swap Rewardful's script for Kickrail's. Existing ?via= links keep working. The manual version is in how to migrate from Rewardful.
What stays with you
Payouts aren't exposed to agents. Paying affiliates stays in the dashboard, and so does approving Stripe. Everything the agent changes is in the program's audit log.
The full tool list is in the MCP docs. Kickrail is also listed in the official MCP Registry as com.kickrail/kickrail.