Skip to main content

Set Up AffiliateBase AI Connectors and MCP

Create a scoped AffiliateBase MCP token and connect ChatGPT, Claude, Cursor, Codex, or another compatible AI client.

Table of Contents

AffiliateBase can expose a scoped Model Context Protocol (MCP) connector so an AI client can help with setup, read program state and optionally manage affiliate promo codes.

Use this when you want ChatGPT, Claude, Cursor, Codex, or another MCP-compatible client to answer questions like:

  • What setup step is incomplete?
  • Which tracking instructions should I follow?
  • What test affiliate link should I open?
  • Has AffiliateBase seen a first click or conversion?
  • What campaigns, affiliates, referrals, commissions, or payouts exist?

Create a connector token

  1. Open AffiliateBase.
  2. Go to Settings -> AI Connectors.
  3. Enter a token name and expiry. To manage promo codes, select Allow promo-code management.
  4. Click Create token.
  5. Copy the token immediately. It is only shown once.

The default setup-assistant token is scoped to:

  • setup status and setup guidance
  • setup integration confirmation
  • read-only reporting
  • read-only campaign and affiliate lists

It does not grant payout execution, commission voiding, affiliate deletion, API key creation, or account-wide destructive access.

MCP endpoint

Use this MCP URL:

https://app.affiliatebase.io/mcp

Most clients need:

  • the MCP URL
  • the connector token
  • your AffiliateBase account ID

Use the token as a bearer token:

Authorization: Bearer ab_live_your_connector_token
X-Account-Id: your_account_id

Example client config

For clients that accept a JSON MCP server config, use:

{
  "mcpServers": {
    "affiliatebase": {
      "url": "https://app.affiliatebase.io/mcp",
      "headers": {
        "Authorization": "Bearer ab_live_your_connector_token",
        "X-Account-Id": "your_account_id"
      }
    }
  }
}

Starter prompt

After connecting the MCP server, start with:

Use AffiliateBase MCP to read my setup status, get install instructions, and help me verify that Stripe Checkout receives the generated referral ID as client_reference_id before marking setup complete. Do not use the ?via token as client_reference_id.

The AI should read setup state first, then recommend the simplest next action.

What the connector can do

Setup tools:

  • read_setup_status
  • get_setup_context
  • get_install_instructions
  • get_test_affiliate_link
  • verify_tracking_installation
  • mark_integration_confirmed

Read-only operating tools:

  • list_campaigns
  • list_affiliates
  • list_referrals
  • list_commissions
  • list_payouts
  • get_dashboard_summary

Optional promo-code management

Select Allow promo-code management when creating a connector token to grant mcp.affiliate_coupons.read and mcp.affiliate_coupons.write. Existing connector tokens keep their original permissions; create a new token with this option and update your client to enable these actions.

The affiliate_promo_codes tool can list assignments, search Stripe codes, list discounts, assign an existing code, create a code in Stripe, refresh an assignment or stop tracking locally. Writes default to preview. Importing an existing code does not change Stripe; creating a code does.

Follow Manage Promo Codes with MCP for copyable preview and execution examples, safe retries and Stripe reconnection guidance.

Read complete lists and currency totals

List tools accept page (starting at 1), limit (1–50), and an optional exact id. Affiliate lists also accept state; referral, commission, and payout lists accept state and affiliate_id. Follow pagination.next_page until pagination.has_more is false. Responses include total_count, total_pages, and the current page and limit; the first 50 records are not the full account history.

Dashboard monetary totals are nested by currency, then state. For example, commission_totals_cents can contain {"USD":{"due":1000},"EUR":{"due":900}}. Keep currencies separate; these values do not represent a converted account-wide total. Setup-test records are excluded from operating lists and commission/payout summaries.

get_test_affiliate_link prefers an existing setup test link. Check setup_verification_link; if false, open the setup screen to obtain its dedicated test link before collecting confirmation evidence.

Safe write behavior

The only setup write in the default connector is mark_integration_confirmed.

Use it only after you have verified:

  1. an affiliate link was opened
  2. a Stripe checkout was started
  3. the Stripe Checkout Session has the generated referral ID as client_reference_id

The tool requires an idempotency key of at least eight characters. Call it first with dry_run: true to check readiness. Confirmation uses the same stored setup-test referral and Stripe checkout evidence as the setup screen; a verbal confirmation alone is insufficient. If proof is missing, the tool returns verification_required. A successful confirmation records an onboarding event; retrying the same key returns the prior result. It does not execute payouts or change commission state.

Ask the AI client to:

  1. Call read_setup_status.
  2. Call get_setup_context.
  3. Call get_install_instructions with the right checkout path.
  4. Call get_test_affiliate_link.
  5. Help you update your checkout code or Payment Link.
  6. Call verify_tracking_installation.
  7. Call mark_integration_confirmed with dry_run: true, then confirm using the same idempotency key only after the readiness check succeeds.

For most Stripe Payment Link setups, the AI should keep you on the default path: install the tracking script on the same published page as the Payment Link, then confirm Stripe received the generated referral ID as client_reference_id.

Security notes

  • Use AI connector tokens, not full-access REST API keys.
  • Revoke connector tokens you no longer use.
  • Create short-lived tokens for testing.
  • Do not paste tokens into public chats, shared documents, or issue trackers.
  • Use a disposable test account before testing setup writes.