# Affitor MCP server

> Allows AI agents to manage affiliate programs by reporting clicks, leads, sales, and refunds while tracking integration readiness.

- Repository: https://github.com/Affitor/cli
- Page: https://hostedmcp.org/servers/affitor/mcp
- Transport: stdio, remote
- Stars: 0
- License: MIT
- Latest version: 0.2.5

## Install

### Claude Code

```sh
claude mcp add --env 'AFFITOR_API_KEY=<YOUR_AFFITOR_API_KEY>' mcp -- npx -y @affitor/mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@affitor/mcp"
      ],
      "env": {
        "AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@affitor/mcp"
      ],
      "env": {
        "AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@affitor/mcp"],"env":{"AFFITOR_API_KEY":"<YOUR_AFFITOR_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@affitor/mcp"
      ],
      "env": {
        "AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add mcp --env 'AFFITOR_API_KEY=<YOUR_AFFITOR_API_KEY>' -- npx -y @affitor/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

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

[mcp_servers.mcp.env]
AFFITOR_API_KEY = "<YOUR_AFFITOR_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'AFFITOR_API_KEY=<YOUR_AFFITOR_API_KEY>' mcp npx -- -y @affitor/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@affitor/mcp"
      ],
      "env": {
        "AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `AFFITOR_API_KEY` | yes | yes | Your Affitor program API key. Server-side only. |
| `AFFITOR_API_URL` | no | no | API base override. Defaults to https://api.affitor.com. |
| `AFFITOR_MCP_WRITE` | no | no | Set to 1 to register the two tools that move money (track sale, track refund). Off by default. |

## Tools (10)

- `affitor_readiness`
- `affitor_track_lead`
- `affitor_track_sale`
- `affitor_track_refund`
- `affitor_track_click`
- `affitor_get_integration_plan`
- `affitor_run_verification`
- `amount`
- `invoiceId`
- `framework`

## FAQ

### How do I enable sales and refund tracking?

You must set the AFFITOR_MCP_WRITE environment variable to 1 to enable the tools that move money.

### What authentication method does Affitor use?

The server uses a program API key provided through the AFFITOR_API_KEY environment variable.

### How can I verify if my integration is working correctly?

You can use the affitor_run_verification tool to fire a synthetic click, lead, and sale verification chain through the real attribution pipeline.

### Can I test sales without affecting real commissions?

Yes, you can use the testMode parameter to record a test sale which does not create a real commission.
