Skip to main content
AgentRef is agent-compatible. You can manage your affiliate program – creating programs, inviting affiliates, checking stats, processing payouts – through any AI assistant that supports tool use. This page covers all four integration methods. Pick the one that fits your stack.
The MCP (Model Context Protocol) server is the fastest way to connect AgentRef to AI assistants. For Claude Code, Claude App, Codex, Cursor, and OpenClaw (mcporter), the recommended flow is OAuth-first: add the server once, finish the browser sign-in, and let your client store tokens for future sessions.Server URL: https://www.agentref.co/api/mcpRecommended auth: MCP OAuth 2.1 with dynamic client registrationFallback auth for custom clients: Authorization: Bearer ak_live_your_key_here

Claude Code

claude mcp add --scope user --transport http agentref https://www.agentref.co/api/mcp
Then open /mcp in Claude Code, select agentref, and complete the OAuth flow once.

Claude App

  1. Open Customize -> Connectors -> + -> Add custom connector
  2. Enter agentref as the name
  3. Enter https://www.agentref.co/api/mcp as the remote MCP server URL
  4. Start a new conversation and send please make a test call to the agentref mcp
  5. Confirm the tool request, then click Reconnect on the AgentRef connector card to authorize access

Codex

Copy this prompt into Codex:
Please run `codex mcp add agentref --url https://www.agentref.co/api/mcp` in your shell.
Codex runs the command for you. Allow command execution once, then complete OAuth in the browser.If AgentRef is already configured and you only need to re-authenticate:
codex mcp login agentref

Cursor

In Settings -> Tools & MCP -> Add Custom MCP, save this mcp.json entry:
{
  "mcpServers": {
    "agentref": {
      "url": "https://www.agentref.co/api/mcp"
    }
  }
}
Then restart Cursor once, open the MCP settings again, and click Connect on the AgentRef server card.

OpenClaw (mcporter)

Install or enable the mcporter skill in OpenClaw, then run:
mcporter --config ~/.openclaw/workspace/config/mcporter.json config add agentref https://www.agentref.co/api/mcp --auth oauth
mcporter --config ~/.openclaw/workspace/config/mcporter.json auth --reset agentref
Approve the browser prompt. On success, the callback page says Authorization successful. You can return to the CLI.

OpenClaw REST skill (fallback)

If you prefer OpenClaw without MCP, install the official skill from ClawHub:
openclaw skills install agentref
Then create the appropriate AgentRef API key and store it in ~/.openclaw/.env before restarting the gateway:
grep -v '^AGENTREF_API_KEY=' ~/.openclaw/.env 2>/dev/null > /tmp/oc_env && printf 'AGENTREF_API_KEY=%s\n' 'ak_live_your_key_here' >> /tmp/oc_env && mv /tmp/oc_env ~/.openclaw/.env && openclaw gateway restart

Other MCP clients

Any remote MCP client that supports OAuth for Streamable HTTP servers can use the same endpoint. Prefer OAuth when available. If your client only supports manual headers, use the same endpoint with Authorization: Bearer ak_live_your_key_here.

Try it out

After connecting, try these prompts with your AI assistant:
  • “Check my onboarding status and tell me what is still blocking launch”
  • “Show me my affiliate program stats for the last 30 days”
  • “List all my affiliates and their performance”
  • “Create a new affiliate program called ‘Partner Program’ with 25% recurring commission”
  • “Check if my tracking script is installed correctly”

Copy for AI assistants

If your AI assistant does not support MCP, point it to https://www.agentref.co/docs/llms-full.txt first. That gives it the full published AgentRef documentation as plain Markdown.
AgentRef docs: https://www.agentref.co/docs
Full docs for LLMs: https://www.agentref.co/docs/llms-full.txt
REST base URL: https://www.agentref.co/api/v1
MCP endpoint: https://www.agentref.co/api/mcp

Preferred MCP auth: OAuth 2.1 + dynamic client registration
Fallback MCP auth: Authorization: Bearer ak_live_* / ak_onb_* / ak_aff_*

Current MCP workflow groups:
- merchant_setup: get_onboarding_status, update_merchant_profile, create_program, list_programs, update_program, get_stripe_connect_url, complete_onboarding, get_tracking_snippet, verify_tracking
- merchant_growth: list_affiliates, set_affiliate_status, list_invites, create_invite, revoke_invite, get_program_overview, list_conversions, list_flags, review_flag
- merchant_payouts: list_pending_payouts, list_payouts, list_upcoming_payouts, create_payout, update_payout_status, export_payouts_csv
- affiliate_workspace: discover_programs, apply_to_program, list_my_programs, list_links, create_link, get_earnings, get_click_stats, list_my_payouts, update_my_payout_profile

Resources:
merchant://me
program://{id}
stats://{programId}
affiliate://me/programs
marketplace://catalog

Prompts:
onboard_program
review_payout_run
debug_tracking_installation
triage_fraud_flags

MCP workflow groups

AgentRef’s MCP release surface is organized into four workflow groups with snake_case inputs and outputs. Mutation tools accept idempotency_key when retries need to be safe.

merchant_setup

  • get_onboarding_status
  • update_merchant_profile
  • create_program
  • list_programs
  • update_program
  • get_stripe_connect_url
  • complete_onboarding
  • get_tracking_snippet
  • verify_tracking

merchant_growth

  • list_affiliates
  • set_affiliate_status
  • list_invites
  • create_invite
  • revoke_invite
  • get_program_overview
  • list_conversions
  • list_flags
  • review_flag

merchant_payouts

  • list_pending_payouts
  • list_payouts
  • list_upcoming_payouts
  • create_payout
  • update_payout_status
  • export_payouts_csv

affiliate_workspace

  • discover_programs
  • apply_to_program
  • list_my_programs
  • list_links
  • create_link
  • get_earnings
  • get_click_stats
  • list_my_payouts
  • update_my_payout_profile
See MCP Server Deep Dive for the full tool, resource, prompt, and setup reference.

What’s next

MCP Server Deep Dive

Advanced MCP configuration, scopes, and resource access.

Node.js SDK

Full SDK reference with all methods and types.

Python SDK

Full SDK reference for Python integrations.