AI-Powered Integration
Use AI coding assistants to integrate Refgrow in minutes. Works with Claude Code, Cursor, GitHub Copilot, and more.
Quick Context (Recommended)
AI coding assistants work best when they have context about the API they're integrating. Refgrow publishes a machine-readable documentation file at refgrow.com/llms.txt that any AI tool can read. This is the fastest way to get started — just paste a prompt that includes the URL.
Use this prompt with your AI tool:
Integrate Refgrow affiliate tracking into my app.
Here's the full documentation: https://refgrow.com/llms.txt
My project ID is: YOUR_PROJECT_IDThe AI will fetch the documentation, understand Refgrow's API, and generate the correct integration code for your stack — whether that's Next.js, Rails, Django, Laravel, or anything else.
YOUR_PROJECT_ID with your actual project ID from the Refgrow dashboard. You can also add details about your tech stack to get more tailored output.MCP Server (For Claude Code & Cursor)
The Model Context Protocol (MCP) gives your AI assistant direct access to Refgrow's API. Instead of just generating code, the AI can actually create affiliates, list conversions, manage coupons, and more — all through natural language.
Claude Code
Add the Refgrow MCP server with a single command:
claude mcp add refgrow -- npx -y @refgrow/mcpThen set your API key as an environment variable:
export REFGROW_API_KEY=rgk_your_api_key_hereCursor
Create or edit .cursor/mcp.json in your project root:
{
"mcpServers": {
"refgrow": {
"command": "npx",
"args": ["-y", "@refgrow/mcp"],
"env": {
"REFGROW_API_KEY": "rgk_your_api_key_here"
}
}
}
}Restart Cursor after saving. The Refgrow tools will appear in the AI assistant's available tools.
Claude Desktop
Add the following to your claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"refgrow": {
"command": "npx",
"args": ["-y", "@refgrow/mcp"],
"env": {
"REFGROW_API_KEY": "rgk_your_api_key_here"
}
}
}
}After saving, restart Claude Desktop. You should see the Refgrow tools available in the tools menu.
rgk_. Generate one from your project's Settings → API Keys section in the Refgrow dashboard. See the MCP Server docs for full setup details.Available MCP Tools
The MCP server exposes 18 tools organized in 4 categories. Your AI assistant can call any of these based on your natural-language requests.
Affiliates
| Tool | Description |
|---|---|
list_affiliates | List all affiliates with stats (clicks, signups, purchases, earnings) |
get_affiliate_details | Get details for a specific affiliate by email |
create_affiliate | Create a new affiliate with optional custom referral code |
update_affiliate | Update affiliate email, referral code, status, or partner slug |
delete_affiliate | Remove an affiliate from the project |
Referrals
| Tool | Description |
|---|---|
list_referrals | List referred users, filterable by affiliate or status |
get_referral_details | Get details for a specific referred user by email |
create_referral | Manually create a referred user record |
Conversions
| Tool | Description |
|---|---|
list_conversions | List conversions with filters for type, affiliate, date range, paid status |
get_conversion | Get a specific conversion by ID |
create_conversion | Create a conversion (signup/purchase) with auto-commission calculation |
update_conversion | Update conversion details or mark as paid |
delete_conversion | Delete a conversion record |
Coupons
| Tool | Description |
|---|---|
list_coupons | List coupon codes with affiliate info |
get_coupon | Get a specific coupon by ID |
create_coupon | Create a coupon linked to an affiliate (with optional Stripe/LemonSqueezy IDs) |
update_coupon | Update coupon details |
delete_coupon | Delete a coupon (also removes from Stripe if linked) |
Example Prompts
Here are some prompts you can give your AI assistant to integrate and manage Refgrow. These work with any AI tool — Claude Code, Cursor, GitHub Copilot, Windsurf, and others.
Tracking setup
"Add Refgrow tracking script to my Next.js app. My project ID is abc123."
Stripe webhook integration
"Set up a Stripe webhook for affiliate conversion tracking with Refgrow."
Create an affiliate (MCP)
"Create an affiliate with email partner@example.com and 30% commission."
View conversions (MCP)
"Show me all conversions from last week."
Embed widget
"Add the Refgrow embedded widget to my dashboard page so affiliates can see their stats."
LemonSqueezy integration
"Integrate Refgrow with my LemonSqueezy checkout to track affiliate conversions."
Direct Context Injection
Some AI tools don't support fetching URLs automatically. In that case, you can download the full documentation and paste it directly into your prompt as context.
- Download the docs file: refgrow.com/llms.txt
- Open the file in a text editor and copy its contents
- Paste it into your AI tool's prompt along with your integration request
Or use curl from the terminal:
curl -s https://refgrow.com/llms.txt | pbcopypbcopy with xclip -selection clipboard. On Windows, use clip.You can also point AI tools that support file attachments directly at the downloaded llms.txt file. This works especially well with ChatGPT, Gemini, and other chat-based interfaces.
Next Steps
- MCP Server — full MCP setup guide with troubleshooting
- Quickstart — set up your first affiliate program
- API Reference — full documentation of all API endpoints
- Tracking Script — understand how referral tracking works
Need help?
If you have questions about AI-powered integration, contact us at support@refgrow.com.