Refgrow

MCP Server

Connect Refgrow to AI assistants like Claude Desktop, Cursor, and Claude Code using the Model Context Protocol (MCP). Manage your affiliate program with natural language.

What is MCP?

The Model Context Protocol (MCP) is an open standard that allows AI assistants to securely connect to external data sources and tools. With the Refgrow MCP server, you can manage your affiliate program directly from your AI assistant — view stats, manage affiliates, process payouts, and more using natural language.

Prerequisites

  • A Refgrow account with at least one project (sign up free)
  • A Refgrow API key (generated from your project settings)
  • Node.js 18 or later installed on your machine
  • An MCP-compatible AI client (Claude Desktop, Cursor, or Claude Code)

Installation

The Refgrow MCP server runs via npx — no global install required. It is automatically downloaded and executed when you configure your AI client.

text
npx @refgrow/mcp
Note: You do not need to run this command manually. The AI client will start the server automatically based on the configuration below.

Getting your API Key

  1. Log in to your Refgrow dashboard
  2. Navigate to your project's Settings tab
  3. Scroll to the API Keys section
  4. Click Generate API Key
  5. Copy the key (it starts with rgk_). You will not be able to see it again.
Important: Store your API key securely. Do not commit it to version control or share it publicly.

Setup for Claude Desktop

Add the following to your Claude Desktop MCP configuration file:

  • 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 the configuration, restart Claude Desktop. You should see the Refgrow tools available in the tools menu.

Setup for Cursor

Add the MCP server to your Cursor configuration. 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.

Setup for Claude Code

Add the Refgrow MCP server to your project's .mcp.json file:

json
{
  "mcpServers": {
    "refgrow": {
      "command": "npx",
      "args": ["-y", "@refgrow/mcp"],
      "env": {
        "REFGROW_API_KEY": "rgk_your_api_key_here"
      }
    }
  }
}

Available Tools

The MCP server exposes 18 tools organized in 4 categories. Your AI assistant can call any of these tools 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)

Environment Variables

VariableRequiredDescription
REFGROW_API_KEYYesYour Refgrow API key (starts with rgk_)
REFGROW_API_URLNoCustom API base URL (defaults to https://refgrow.com/api/v1)

Example Conversations

Here are some examples of what you can ask your AI assistant once the MCP server is connected:

View program performance

You:

"Show me my affiliate program stats for this month. Who are my top performers?"

Assistant:

The assistant calls get_project_stats and get_top_affiliates, then summarizes your clicks, conversions, revenue, and top-performing affiliates.

Manage affiliates

You:

"Add a new affiliate john@example.com with a 30% commission override and the coupon code JOHN30."

Assistant:

The assistant calls create_affiliate with the email, commission override, and coupon parameters.

Process payouts

You:

"Show me all pending payouts and process them via PayPal."

Assistant:

The assistant calls list_payouts filtered by pending status, then calls create_payout for each affiliate after confirmation.

Analyze conversions

You:

"List all conversions from last week and tell me the total revenue."

Assistant:

The assistant calls list_conversions with a date range filter and calculates the total.

Troubleshooting

"Server not found" or connection errors

  • Ensure Node.js 18+ is installed: node --version
  • Verify npx is available: npx --version
  • Check your internet connection — the package is downloaded on first run
  • Try running npx @refgrow/mcp manually to see any error output

"Authentication failed" or 401 errors

  • Verify your API key starts with rgk_
  • Ensure the API key has not been revoked in your project settings
  • Check that the API key belongs to the correct project
  • Regenerate the API key if needed

"Tool not available" in AI assistant

  • Restart your AI client after saving the configuration
  • Verify the JSON configuration is valid (no trailing commas, correct syntax)
  • Check the AI client's logs for MCP connection errors

Rate limiting

  • The Refgrow API has a rate limit of 60 requests per minute per API key
  • If you hit rate limits, wait a minute before retrying
  • For high-volume usage, consider batching your requests

Next Steps

Need help?

If you have questions about the MCP server, contact us at support@refgrow.com.

MCP Server — Refgrow Docs