Skip to main content
Glama
Refgrow MCP Server
by refgrow

@refgrow/mcp

A Model Context Protocol (MCP) server that wraps the Refgrow REST API. This allows AI agents -- Claude Desktop, Cursor, ChatGPT, and other MCP-compatible clients -- to manage your affiliate program directly.

Prerequisites

  • Node.js 18+

  • A Refgrow account with an API key (generated in project settings)

  • API keys start with rgk_

Related MCP server: syndicate-links-mcp

Installation

npm install @refgrow/mcp

Or clone and build from source:

git clone https://github.com/refgrow/refgrow-mcp.git
cd refgrow-mcp
npm install
npm run build

Configuration

The server requires two environment variables:

Variable

Required

Default

Description

REFGROW_API_KEY

Yes

--

Your Refgrow API key (starts with rgk_)

REFGROW_API_URL

No

https://refgrow.com

Base URL of your Refgrow instance

Getting an API Key

  1. Log in to Refgrow

  2. Go to your project settings

  3. Scroll to the API Keys section

  4. Click Generate API Key

  5. Copy the key (it starts with rgk_ and is shown only once)

Usage with Claude Desktop

Add this to your Claude Desktop config file:

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"
      }
    }
  }
}

Or if installed globally / from source:

{
  "mcpServers": {
    "refgrow": {
      "command": "node",
      "args": ["/path/to/packages/mcp-server/dist/index.js"],
      "env": {
        "REFGROW_API_KEY": "rgk_your_api_key_here"
      }
    }
  }
}

Usage with Cursor

In Cursor settings, add an MCP server with:

  • Name: refgrow

  • Command: npx -y @refgrow/mcp

  • Environment: REFGROW_API_KEY=rgk_your_api_key_here

Or add to .cursor/mcp.json in your project root:

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

Usage with Claude Code

Add to your project's .mcp.json:

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

Available Tools

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 Conversations

Once connected, you can ask your AI agent things like:

  • "Show me all active affiliates and their earnings"

  • "Create a new affiliate for partner@example.com with referral code PARTNER2025"

  • "List all unpaid conversions from the last 30 days"

  • "How many signups did we get through affiliate referrals this month?"

  • "Create a coupon code SAVE20 linked to affiliate ID 42"

  • "Mark conversion #123 as paid"

  • "Deactivate the affiliate with email old-partner@example.com"

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode for development
npm run dev

# Run the server (requires REFGROW_API_KEY env var)
REFGROW_API_KEY=rgk_your_key npm start

Documentation

Full setup guide with examples and troubleshooting: https://refgrow.com/docs/mcp-server

REST API reference (for direct HTTP integration): https://refgrow.com/docs/api-reference

License

MIT

Available Tools

18 tools
create_affiliateC

Create a new affiliate in your Refgrow project. An affiliate receives a unique referral code and can start referring customers.

Inputs: email (required), referral_code, partner_slug.

create_conversionB

Manually create a conversion (signup or purchase). For purchases, the commission is auto-calculated from project settings if value is not provided. You can identify the affiliate by ID or referral code.

Inputs: type (required), value, base_value, affiliate_id, +7 more.

create_couponB

Create a new coupon code linked to an affiliate. Optionally tie it to a Stripe coupon ID or LemonSqueezy discount code for automatic attribution.

Inputs: affiliate_id (required), coupon_code (required), stripe_coupon_id, lemonsqueezy_discount_code, +1 more.

create_referralC

Manually create a referred user record, optionally linking them to a specific affiliate.

Inputs: email (required), affiliate_id, status.

delete_affiliateB

Delete an affiliate from your project. This also removes their associated referral data.

Inputs: email (required).

delete_conversionC

Delete a conversion record by its ID.

Inputs: id (required).

delete_couponA

Delete a coupon by its ID. If linked to a Stripe coupon, it will also be deleted from Stripe.

Inputs: id (required).

get_affiliate_detailsC

Get detailed information about a specific affiliate by their email address, including click count, signups, purchases, and earnings.

Inputs: email (required).

get_conversionC

Get details for a specific conversion by its ID.

Inputs: id (required).

get_couponC

Get details for a specific coupon by its ID.

Inputs: id (required).

get_referral_detailsC

Get details for a specific referred user by their email address.

Inputs: email (required).

list_affiliatesA

List all affiliates in your Refgrow project with their stats (clicks, signups, purchases, earnings). Supports filtering by status and pagination.

Inputs: status, limit, offset.

list_conversionsA

List conversions (signups and purchases) tracked in your affiliate program. Filter by type, affiliate, date range, or paid status.

Inputs: type, affiliate_id, paid, from, +3 more.

list_couponsB

List coupon codes associated with affiliates in your project. Filter by status, affiliate, or coupon code search.

Inputs: status, affiliate_id, coupon_code, limit, +1 more.

list_referralsB

List referred users (signups tracked through affiliate links). Filter by affiliate or conversion status. Shows which affiliate referred each user.

Inputs: affiliate_id, status, limit, offset.

update_affiliateC

Update an existing affiliate's details such as email, referral code, status, or partner slug.

Inputs: email (required), new_email, referral_code, status, +1 more.

update_conversionB

Update a conversion's details. Commonly used to mark a conversion as paid or update its value.

Inputs: id (required), value, base_value, type, +4 more.

update_couponC

Update an existing coupon's code, linked affiliate, payment provider IDs, or status.

Inputs: id (required), affiliate_id, coupon_code, stripe_coupon_id, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 18 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose with no ambiguity. Each tool targets a specific resource (affiliate, conversion, coupon, referral) and action (create, delete, get, list, update), making it easy for an agent to select the correct one. For example, create_affiliate and update_affiliate are clearly differentiated by their actions on the same resource.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, such as create_affiliate, list_conversions, and update_coupon. All tools use snake_case with clear verbs (create, delete, get, list, update) and nouns (affiliate, conversion, coupon, referral), making the set predictable and readable.

    Tool Count5/5

    With 18 tools, the count is well-scoped for an affiliate management domain, covering CRUD operations for four core resources (affiliate, conversion, coupon, referral). Each tool earns its place by providing necessary functionality without redundancy, such as detailed get operations alongside list views.

    Completeness5/5

    The tool surface offers complete CRUD/lifecycle coverage for the affiliate management domain, with no obvious gaps. All four resources have create, get, list, update, and delete operations (except referrals, which lack update and delete, but this is reasonable as referrals are typically immutable records). This ensures agents can handle full workflows without dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server that provides AI assistants with access to the FirstPromoter affiliate management platform for managing referrals, promoters, campaigns, and commissions. It is designed for remote multi-user deployment and supports operations via HTTP/SSE transport.
      -
    • A
      license
      A
      quality
      A
      maintenance
      MCP server for AI agent affiliate attribution and commission tracking. 7 tools for program discovery, conversion tracking, attribution token verification, and commission queries.
      7
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for managing Youfiliate Smart Links from AI assistants like Claude Desktop, enabling creation of geo-targeted affiliate links, analytics, and YouTube description migrations.
      18
      MIT