# Build with AI

## Model Context Protocol (MCP) <a href="#mcp" id="mcp"></a>

The [GrowSurf MCP server](https://github.com/growsurf/growsurf-mcp) enables your AI agents and tools to directly interact with your GrowSurf referral and affiliate programs.

If you're using an AI tool such as Cursor, Claude Code, Antigravity, or ChatGPT Codex to help you implement GrowSurf, we recommend utilizing our MCP server.

### Installation

View installation instructions for popular AI tools below.

{% tabs %}
{% tab title="Cursor" %}

1. Download the MCP server [here](https://github.com/growsurf/growsurf-mcp)
2. Open [Cursor](https://cursor.com/)
3. In the top menu, click *File > Preferences > Cursor Settings*
4. In the Cursor Settings panel, open *Tools & MCP*
5. Click *Add Custom MCP*
6. In the `mcp.json`  file, add the following:

{% code overflow="wrap" %}

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

{% endcode %}

4. Save the configuration file
5. You should see `growsurf-mcp` under *MCP Tools* with a green dot, indicating the MCP server is successfully running<br>

   <figure><img src="https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FTZQf9hUt81AbuT3EcQui%2F.cursormcp.json%20%E2%80%94%20loyaltysurf%202026-01-12%20at%206.50.45%20PM.png?alt=media&#x26;token=48a019fa-f83b-44e6-afb7-1a8f4887ac43" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Claude Code (CLI-based)" %}
Install the server directly into Claude Code:

```bash
claude mcp add @growsurfteam/growsurf-mcp -- \
  -e GROWSURF_API_KEY=REPLACE_WITH_YOUR_API_KEY \
  -e GROWSURF_CAMPAIGN_ID=REPLACE_WITH_YOUR_CAMPAIGN_ID
```

{% endtab %}

{% tab title="Antigravity" %}

1. Open Antigravity
2. Click the **…** menu in the panel to the right and select *MCP Store*
3. Click *Manage MCP Servers > View raw config*
4. In the `mcp_config.json`  file, add the following:

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

{% endtab %}

{% tab title="ChatGPT Codex" %}

#### Option 1: Configure via `config.toml`

Create or edit the `~/.codex/config.toml` file by adding the following:

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

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

#### Option 2: Configure via Codex CLI

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

{% endtab %}
{% endtabs %}

### Resources

* [GrowSurf MCP server](https://github.com/growsurf/growsurf-mcp): Check out the GitHub repository for the MCP server
* [Model Context Protocol](https://modelcontextprotocol.io/introduction): Learn more about the Model Context Protocol specification
