> For the complete documentation index, see [llms.txt](https://docs.growsurf.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.growsurf.com/build-with-ai.md).

# Build with AI

Copy prompts that help an AI assistant create your GrowSurf account and build a draft referral or affiliate program for you to review.

Tell an AI assistant what kind of referral or affiliate program you want. It can create your GrowSurf account and build a draft program for you to review. The prompts instruct your assistant to stop before launch, reward fulfillment, or payment changes and wait for your separate approval.

Use the prompts below in order. Replace the text in brackets with your details. You do not need to choose between REST, an API library, or MCP. Your assistant uses the method its tools support.

An assistant that cannot take actions can still prepare the steps for you or your developer.

## 1. Approve your account setup

Your GrowSurf account needs a business email address. It includes a 14-day Business trial without a credit card. Before the assistant creates the account, it will show you GrowSurf's Terms of Service and Privacy Policy and wait for your approval.

Copy this prompt:

```
Help me create a GrowSurf account and a draft [referral or affiliate] program for [company name].

Before you create the account, show me GrowSurf's Terms of Service at https://growsurf.com/terms and Privacy Policy at https://growsurf.com/privacy. Ask me to confirm that I approve the account creation and accept both policies. Do not continue until I explicitly approve.

After I approve, follow the current onboarding guide at https://growsurf.com/agent-start.md. Use https://growsurf.com/arazzo.yaml for the machine-readable workflow and https://growsurf.com/openapi.json for the API contract. Choose the supported integration method that fits your tools. Do not ask me to choose between REST, an API library, or MCP.

Keep credentials out of chat, logs, screenshots, URLs, analytics, and source files. Stop after account creation and ask me to verify my email.
```

## 2. Confirm your email

GrowSurf emails you to confirm that the account is yours. Open that email and complete the verification yourself. Do not paste the verification link, code, or email contents into your conversation.

After you verify your email, copy this prompt:

```
I verified the email for my new GrowSurf account.

Continue with the account-to-draft workflow at https://growsurf.com/agent-start.md. Create and configure only a draft [referral or affiliate] program for [company name]. Ask me for any business details you still need.

If a step needs a paid plan, payment method, or charge, explain why and wait for my approval. Do not launch the program, enable or fulfill rewards or commissions, change payment details, rotate credentials, delete data, or edit my website or app.

Read the saved program back before you report success. Then stop and show me a plain-language summary.
```

## 3. Review your draft

Your assistant will leave the program as a draft. Review the saved setup before you approve any next step.

Copy this prompt:

```
Show me the saved GrowSurf draft in plain language. Include the program type, company name, design, emails, options, installation settings, and reward or commission settings. Tell me what people will see and list anything that is incomplete or needs a paid plan.

Do not launch the program or change rewards, commissions, payment details, credentials, data, or my website or app. Wait for my separate approval before each next action.
```

## If your assistant asks you to connect GrowSurf

Skip this section unless your assistant says it needs a GrowSurf connection. Use the tab for your AI tool. You do not need to compare REST, API libraries, and MCP yourself.

[GrowSurf's MCP server](https://github.com/growsurf/growsurf-mcp) connects supported AI tools to your GrowSurf account. You sign in to GrowSurf and approve access.

### Try a prompt after you connect

```
Create a GrowSurf referral program for Pied Piper, keep rewards disabled until I approve them, then summarize the Design, Emails, Options, Installation, and Rewards settings.
```

{% hint style="info" %}
Do not have a GrowSurf account yet? Start with [step 1](https://docs.growsurf.com/build-with-ai#1-approve-your-account-setup). Return here only if your assistant asks you to connect GrowSurf.
{% endhint %}

***

### Connect the MCP server

Use the tab for the AI tool you already use. Most hosted tools ask you to sign in to GrowSurf. Local tools and clients without GrowSurf sign-in may ask for an API key. Never paste that key into your conversation.

A default program `id` is optional. Your assistant can create or select a program after it connects.

{% tabs %}
{% tab title="ChatGPT" %}
Add GrowSurf as a developer-mode app (custom connector) in ChatGPT on the web.

1. Open *Settings > Security and login* and turn on **Developer mode**. Managed workspaces may require an admin to enable it.
2. Open *Settings > Plugins*, select **+**, and create a developer-mode app named **GrowSurf** with a short description.
3. Optionally, add the [GrowSurf logo](https://app.growsurf.com/assets/img/logo/iconmark-blue-padded.png).
4. Use this MCP server URL:

   ```
   https://mcp.growsurf.com/mcp
   ```
5. Select **Create**, then sign in to GrowSurf and approve access when ChatGPT prompts you.
6. Start a new chat, select *+ > More*, and choose **GrowSurf** from the available tools.

ChatGPT registers its own OAuth client automatically, so you do not paste an API key.
{% endtab %}

{% tab title="Claude.ai" %}
Add GrowSurf as a remote custom connector in Claude on the web.

1. Open *Customize > Connectors*. On Team or Enterprise, an organization owner must first add the connector under *Organization settings > Connectors*.
2. Select **+**, then **Add custom connector**, and name it **GrowSurf**. Organization owners choose *Add > Custom > Web*.
3. Enter this remote MCP server URL:

   ```
   https://mcp.growsurf.com
   ```
4. Select **Add**, then **Connect**, and sign in to GrowSurf. In a conversation, use *+ > Connectors* to enable GrowSurf.
   {% endtab %}

{% tab title="Claude Desktop" %}
Claude remote connectors are tied to your Claude account and also work in Claude Desktop.

1. Open *Customize > Connectors* for the same Claude account you use in Claude Desktop.
2. Select **+**, then **Add custom connector**, and name it **GrowSurf**. On Team or Enterprise, an organization owner must add it first.
3. Enter this remote MCP server URL:

   ```
   https://mcp.growsurf.com
   ```
4. Select **Connect** and sign in to GrowSurf. In a conversation, use *+ > Connectors* to enable GrowSurf.
   {% endtab %}

{% tab title="Claude Code" %}
Recommended: connect Claude Code to GrowSurf's hosted MCP endpoint:

```bash
claude mcp add --transport http --scope user growsurf https://mcp.growsurf.com
```

On first use, Claude Code opens GrowSurf sign-in and consent. You can also start that flow directly:

```bash
claude mcp login growsurf
```

If you prefer local stdio, install the local server directly into Claude Code:

```bash
claude mcp add growsurf \
  -e GROWSURF_API_KEY=YOUR_API_KEY \
  -- npx -y @growsurfteam/growsurf-mcp
```

For a single existing campaign in local stdio, add:

```bash
-e GROWSURF_CAMPAIGN_ID=YOUR_CAMPAIGN_ID
```

Manual API-key fallback for the hosted endpoint:

```bash
claude mcp add --transport http growsurf https://mcp.growsurf.com/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"
```

For a single existing campaign on the manual hosted path, add:

```bash
--header "x-growsurf-campaign-id: YOUR_CAMPAIGN_ID"
```

{% endtab %}

{% tab title="GitHub Copilot" %}
Add GrowSurf as a remote MCP server in VS Code, then use it from Copilot's agent mode.

Run this in your terminal, or open the Command Palette and run *MCP: Add Server > HTTP*:

```bash
code --add-mcp '{"name":"growsurf","type":"http","url":"https://mcp.growsurf.com"}'
```

Open Copilot Chat, switch to **Agent** mode, start GrowSurf, then sign in and approve access when VS Code prompts you.
{% endtab %}

{% tab title="Cursor" %}
Open *Cursor Settings > Tools & Integrations*, select **New MCP Server**, and add a server named `growsurf`.

Recommended: add GrowSurf's hosted MCP endpoint to `mcp.json`:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "url": "https://mcp.growsurf.com"
    }
  }
}
```

{% endcode %}

For API-key auth instead of OAuth, use the manual hosted path:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "url": "https://mcp.growsurf.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

{% endcode %}

If you prefer local stdio, add this to `mcp.json`:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "command": "npx",
      "args": ["-y", "@growsurfteam/growsurf-mcp"],
      "env": {
        "GROWSURF_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

{% endcode %}

**Sign-in window didn't open?** Cursor sometimes keeps a half-finished sign-in and then shows GrowSurf with only a Logout option, so there is no way to start sign-in again. Logging out does not clear it. This is a bug in Cursor, not your setup. Delete the `growsurf` entry from `~/.cursor/mcp.json`, save the file, then paste it back:

{% code overflow="wrap" %}

```json
{
  "mcpServers": {
    "growsurf": {
      "url": "https://mcp.growsurf.com"
    }
  }
}
```

{% endcode %}

Cursor opens the sign-in window on the next connection.
{% endtab %}

{% tab title="Codex" %}
Recommended: connect Codex to GrowSurf's hosted MCP endpoint:

```bash
codex mcp add growsurf --url https://mcp.growsurf.com
```

Start GrowSurf sign-in and consent:

```bash
codex mcp login growsurf
```

Or create or edit `~/.codex/config.toml`:

```toml
[mcp_servers.growsurf]
url = "https://mcp.growsurf.com"
```

For API-key auth instead of OAuth, point Codex at the manual hosted path and read the API key from an environment variable:

```toml
[mcp_servers.growsurf]
url = "https://mcp.growsurf.com/mcp"
bearer_token_env_var = "GROWSURF_API_KEY"
```

If you prefer local stdio, create or edit `~/.codex/config.toml`:

```toml
[mcp_servers.growsurf]
command = "npx"
args = ["-y", "@growsurfteam/growsurf-mcp"]

[mcp_servers.growsurf.env]
GROWSURF_API_KEY = "YOUR_API_KEY"
```

Or configure it from the CLI:

```bash
codex mcp add growsurf \
  --env GROWSURF_API_KEY=YOUR_API_KEY \
  -- npx -y @growsurfteam/growsurf-mcp
```

{% endtab %}

{% tab title="Gemini CLI" %}
Connect GrowSurf to Gemini CLI over HTTP:

```bash
gemini mcp add --transport http growsurf https://mcp.growsurf.com
```

Open Gemini CLI and run `/mcp auth growsurf` to start sign-in. Approve access in your browser, then run `/mcp` to check the connection.
{% endtab %}

{% tab title="Devin Desktop" %}
Add GrowSurf as a remote MCP server in Devin Desktop, formerly Windsurf.

1. Open the *MCPs* panel, or go to *Devin Settings > Cascade > MCP Servers*, and open the raw `mcp_config.json` file.
2. Add a remote server named `growsurf` with this `serverUrl`:

   ```json
   {
     "mcpServers": {
       "growsurf": {
         "serverUrl": "https://mcp.growsurf.com"
       }
     }
   }
   ```
3. Save the config and refresh the server list, then sign in to GrowSurf and approve access.
   {% endtab %}

{% tab title="Cline" %}
Add GrowSurf as a remote MCP server in the Cline extension.

1. In Cline, open the *MCP Servers* panel and choose *Remote Servers*.
2. Add a server named **GrowSurf** with this URL:

   ```
   https://mcp.growsurf.com
   ```
3. Connect, then sign in to GrowSurf and approve access.
   {% endtab %}

{% tab title="Antigravity" %}
Open Antigravity, click the **…** menu, select *MCP Servers*, then open *Manage MCP Servers > View raw config*.

Recommended: add GrowSurf's hosted MCP endpoint to `mcp_config.json`. Antigravity uses `serverUrl` for remote MCP servers:

```json
{
  "mcpServers": {
    "growsurf": {
      "serverUrl": "https://mcp.growsurf.com"
    }
  }
}
```

For API-key auth instead of OAuth, use the manual hosted path:

```json
{
  "mcpServers": {
    "growsurf": {
      "serverUrl": "https://mcp.growsurf.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

If you prefer local stdio, add this to `mcp_config.json`:

```json
{
  "mcpServers": {
    "growsurf": {
      "command": "npx",
      "args": ["-y", "@growsurfteam/growsurf-mcp"],
      "env": {
        "GROWSURF_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

{% endtab %}

{% tab title="Other" %}
For any other client that supports remote Streamable HTTP MCP servers with OAuth:

1. Add a remote Streamable HTTP MCP server and name it **GrowSurf**.
2. Use this OAuth-capable server URL:

   ```
   https://mcp.growsurf.com
   ```
3. Start the connection, then sign in to GrowSurf and approve access.

If your client asks for a URL and custom headers instead of GrowSurf sign-in, use `https://mcp.growsurf.com/mcp` with header `Authorization: Bearer YOUR_API_KEY`.
{% endtab %}
{% endtabs %}

#### Hosted Streamable HTTP endpoint

Use hosted OAuth when your MCP client supports remote Streamable HTTP with OAuth:

* URL: `https://mcp.growsurf.com`
* Auth: GrowSurf sign-in and consent.
* API keys: not required for OAuth clients.

Use this option if your MCP client asks for a URL and custom headers instead of opening GrowSurf sign-in:

* URL: `https://mcp.growsurf.com/mcp`
* Required header for API-calling tools: `Authorization: Bearer YOUR_API_KEY`
* Optional header for a default campaign: `x-growsurf-campaign-id: YOUR_CAMPAIGN_ID`

Use this option if you do not have a GrowSurf account yet:

* URL: `https://mcp.growsurf.com/onboard`
* Auth: none.
* Tools: `growsurf_create_account` only.

Add the onboarding endpoint the same way as any other MCP server in your client. Your assistant asks for your business email, shows you the Terms of Service and Privacy Policy for approval, and creates the account. Verify the email GrowSurf sends you, then connect to `https://mcp.growsurf.com` for everything else.

Account creation returns an API key once, and a lost key cannot be recovered through the API. Assistants that forget files or memory between turns should not create the account from a chat window at all. Connect `https://mcp.growsurf.com` instead and sign in when your client asks, so the credential stays with your client rather than in the conversation.

The onboarding endpoint, the local server, and the manual fallback can all use the account-bootstrap tool without an API key. OAuth clients use the GrowSurf team you select and approve. Campaign-scoped tools need either a `campaignId` argument or a default campaign header/environment value.

#### Hosted OAuth connector

GrowSurf's hosted MCP endpoint supports OAuth for ChatGPT, Claude.ai, Claude Desktop, Claude Code, GitHub Copilot, Cursor, Codex, Gemini CLI, Devin Desktop, Cline, Antigravity, and other compatible remote MCP clients. Browser-only clients must support custom remote MCP/OAuth connectors; if yours does not, use a supported coding agent or the local stdio setup.

#### What access you approve

When you sign in through the hosted connector, GrowSurf asks you to approve access before the agent can do anything. The agent can then, on your behalf:

* Read and update the selected team.
* Read, create, and update programs; create, update, or delete their reward configuration and webhooks.
* Read, add, update, and remove participants.
* Record or refund sales and approve commissions or rewards.
* Read analytics.

The hosted MCP server asks only for scopes used by its current tools. It does not request permission to rotate API keys, delete programs, read detailed reward, commission, or payout records, delete issued rewards, or fulfill rewards. API-key rotation is not an MCP action. Rotate a key from GrowSurf Settings or through a direct REST/SDK client whose API key has the `api_key:rotate` scope.

MCP Team tools stay on the team selected during approval.

You can review or revoke a connected client at any time from your GrowSurf account settings.

***

### Example prompts

After you connect GrowSurf, copy one of these prompts.

<details>

<summary><strong>Referral programs</strong></summary>

Copy this prompt:

```
Use GrowSurf to create a referral program for Pied Piper. Review the default Design, Emails, Options, Installation, and Rewards. Keep rewards safe until I approve them. Return the campaign editor URL and summarize the settings.
```

{% hint style="info" %}
Your assistant will read the saved setup before it reports success. You only need to review the summary and approve any next step.
{% endhint %}

</details>

<details>

<summary><strong>Affiliate programs</strong></summary>

Affiliate programs can create payable obligations, so have the agent confirm payout and tax settings before launch:

```
Create an affiliate program for Pied Piper in USD. Review commission defaults, payout threshold, tax collection, affiliate portal design, and emails. Do not publish until I approve the money settings.
```

{% hint style="info" %}
Your assistant will include the saved commission, payout, tax, portal, and email settings in its summary. Review those money settings before you approve launch.
{% endhint %}

</details>

***

### If your assistant asks for a GrowSurf skill

Most compatible MCP clients can discover GrowSurf's built-in prompts without a separate skill. If your assistant asks for one, share the [`growsurf-agent-toolkit`](https://github.com/growsurf/growsurf-mcp/tree/main/skills/growsurf-agent-toolkit). It gives the assistant guided workflows for:

* Creating referral programs.
* Creating affiliate programs.
* Embedding the widget.
* Adjusting rewards.
* Wiring webhooks.
* Reading analytics.

{% hint style="info" %}
You do not need to install this skill unless your assistant asks for it.
{% endhint %}

***

### Resources

* [GrowSurf MCP server](https://github.com/growsurf/growsurf-mcp)
* [GrowSurf REST API reference](/developer-tools/rest-api/api-reference.md)
* [Model Context Protocol](https://modelcontextprotocol.io/introduction)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.growsurf.com/build-with-ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
