Refgrow

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:

text
Integrate Refgrow affiliate tracking into my app.
Here's the full documentation: https://refgrow.com/llms.txt
My project ID is: YOUR_PROJECT_ID

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

Tip: Replace 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:

bash
claude mcp add refgrow -- npx -y @refgrow/mcp

Then set your API key as an environment variable:

bash
export REFGROW_API_KEY=rgk_your_api_key_here

Cursor

Create or edit .cursor/mcp.json in your project root:

json
{
  "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
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.

Important: Your API key starts with 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

ToolDescription
list_affiliatesList all affiliates with stats (clicks, signups, purchases, earnings)
get_affiliate_detailsGet details for a specific affiliate by email
create_affiliateCreate a new affiliate with optional custom referral code
update_affiliateUpdate affiliate email, referral code, status, or partner slug
delete_affiliateRemove an affiliate from the project

Referrals

ToolDescription
list_referralsList referred users, filterable by affiliate or status
get_referral_detailsGet details for a specific referred user by email
create_referralManually create a referred user record

Conversions

ToolDescription
list_conversionsList conversions with filters for type, affiliate, date range, paid status
get_conversionGet a specific conversion by ID
create_conversionCreate a conversion (signup/purchase) with auto-commission calculation
update_conversionUpdate conversion details or mark as paid
delete_conversionDelete a conversion record

Coupons

ToolDescription
list_couponsList coupon codes with affiliate info
get_couponGet a specific coupon by ID
create_couponCreate a coupon linked to an affiliate (with optional Stripe/LemonSqueezy IDs)
update_couponUpdate coupon details
delete_couponDelete 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.

  1. Download the docs file: refgrow.com/llms.txt
  2. Open the file in a text editor and copy its contents
  3. Paste it into your AI tool's prompt along with your integration request

Or use curl from the terminal:

bash
curl -s https://refgrow.com/llms.txt | pbcopy
Tip: On Linux, replace pbcopy 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

Need help?

If you have questions about AI-powered integration, contact us at support@refgrow.com.

Start Free Trial
AI-Powered Integration — Refgrow Docs