{
  "markdown": "# @refgrow/mcp\n\nA [Model Context Protocol](https://modelcontextprotocol.io) (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.\n\n## Prerequisites\n\n- Node.js 18+\n- A Refgrow account with an API key (generated in project settings)\n- API keys start with `rgk_`\n\n## Installation\n\n```bash\nnpm install @refgrow/mcp\n```\n\nOr clone and build from source:\n\n```bash\ngit clone https://github.com/refgrow/refgrow-mcp.git\ncd refgrow-mcp\nnpm install\nnpm run build\n```\n\n## Configuration\n\nThe server requires two environment variables:\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `REFGROW_API_KEY` | Yes | -- | Your Refgrow API key (starts with `rgk_`) |\n| `REFGROW_API_URL` | No | `https://refgrow.com` | Base URL of your Refgrow instance |\n\n### Getting an API Key\n\n1. Log in to [Refgrow](https://refgrow.com)\n2. Go to your project settings\n3. Scroll to the **API Keys** section\n4. Click **Generate API Key**\n5. Copy the key (it starts with `rgk_` and is shown only once)\n\n## Usage with Claude Desktop\n\nAdd this to your Claude Desktop config file:\n\n**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"refgrow\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@refgrow/mcp\"],\n      \"env\": {\n        \"REFGROW_API_KEY\": \"rgk_your_api_key_here\"\n      }\n    }\n  }\n}\n```\n\nOr if installed globally / from source:\n\n```json\n{\n  \"mcpServers\": {\n    \"refgrow\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/packages/mcp-server/dist/index.js\"],\n      \"env\": {\n        \"REFGROW_API_KEY\": \"rgk_your_api_key_here\"\n      }\n    }\n  }\n}\n```\n\n## Usage with Cursor\n\nIn Cursor settings, add an MCP server with:\n\n- **Name:** refgrow\n- **Command:** `npx -y @refgrow/mcp`\n- **Environment:** `REFGROW_API_KEY=rgk_your_api_key_here`\n\nOr add to `.cursor/mcp.json` in your project root:\n\n```json\n{\n  \"mcpServers\": {\n    \"refgrow\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@refgrow/mcp\"],\n      \"env\": {\n        \"REFGROW_API_KEY\": \"rgk_your_api_key_here\"\n      }\n    }\n  }\n}\n```\n\n## Usage with Claude Code\n\nAdd to your project's `.mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"refgrow\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@refgrow/mcp\"],\n      \"env\": {\n        \"REFGROW_API_KEY\": \"rgk_your_api_key_here\"\n      }\n    }\n  }\n}\n```\n\n## Available Tools\n\n### Affiliates\n\n| Tool | Description |\n|---|---|\n| `list_affiliates` | List all affiliates with stats (clicks, signups, purchases, earnings) |\n| `get_affiliate_details` | Get details for a specific affiliate by email |\n| `create_affiliate` | Create a new affiliate with optional custom referral code |\n| `update_affiliate` | Update affiliate email, referral code, status, or partner slug |\n| `delete_affiliate` | Remove an affiliate from the project |\n\n### Referrals\n\n| Tool | Description |\n|---|---|\n| `list_referrals` | List referred users, filterable by affiliate or status |\n| `get_referral_details` | Get details for a specific referred user by email |\n| `create_referral` | Manually create a referred user record |\n\n### Conversions\n\n| Tool | Description |\n|---|---|\n| `list_conversions` | List conversions with filters for type, affiliate, date range, paid status |\n| `get_conversion` | Get a specific conversion by ID |\n| `create_conversion` | Create a conversion (signup/purchase) with auto-commission calculation |\n| `update_conversion` | Update conversion details or mark as paid |\n| `delete_conversion` | Delete a conversion record |\n\n### Coupons\n\n| Tool | Description |\n|---|---|\n| `list_coupons` | List coupon codes with affiliate info |\n| `get_coupon` | Get a specific coupon by ID |\n| `create_coupon` | Create a coupon linked to an affiliate (with optional Stripe/LemonSqueezy IDs) |\n| `update_coupon` | Update coupon details |\n| `delete_coupon` | Delete a coupon (also removes from Stripe if linked) |\n\n## Example Conversations\n\nOnce connected, you can ask your AI agent things like:\n\n- \"Show me all active affiliates and their earnings\"\n- \"Create a new affiliate for partner@example.com with referral code PARTNER2025\"\n- \"List all unpaid conversions from the last 30 days\"\n- \"How many signups did we get through affiliate referrals this month?\"\n- \"Create a coupon code SAVE20 linked to affiliate ID 42\"\n- \"Mark conversion #123 as paid\"\n- \"Deactivate the affiliate with email old-partner@example.com\"\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Watch mode for development\nnpm run dev\n\n# Run the server (requires REFGROW_API_KEY env var)\nREFGROW_API_KEY=rgk_your_key npm start\n```\n\n## Documentation\n\nFull setup guide with examples and troubleshooting:\nhttps://refgrow.com/docs/mcp-server\n\nREST API reference (for direct HTTP integration):\nhttps://refgrow.com/docs/api-reference\n\n## License\n\nMIT\n",
  "bytes": 4955,
  "sha": "34b8c3fe444138494bd89103f262f1d42b7534c67fac363c4b156d55cbe485a1",
  "repo_slug": "refgrow/refgrow-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_refgrow_mcp_0acb8acf/readme"
}