AI agents: MCP server & CLI

Let Claude, ChatGPT, Cursor, or any agent operate your affiliate program — via the hosted MCP server or the partli CLI. Both expose identical operations.

Partli ships two agent surfaces with full parity — both are thin adapters over the same operations registry, so anything one can do, the other can:

  • MCP server — hosted at https://partli.app/api/mcp, for MCP clients (Claude, ChatGPT, Cursor, …)
  • partli CLI — for terminals and terminal-native agents (often more token-efficient than tool schemas)

Both authenticate with a workspace API key (Dashboard → API keys). Keys are workspace-scoped and revocable, and billing-gated like the rest of the API.

MCP server

Claude Code

claude mcp add --transport http partli https://partli.app/api/mcp \
  --header "Authorization: Bearer pk_live_..."

Claude.ai / ChatGPT (custom connector)

Add a custom connector with URL https://partli.app/api/mcp and header Authorization: Bearer pk_live_….

Cursor / other MCP clients

{
  "mcpServers": {
    "partli": {
      "url": "https://partli.app/api/mcp",
      "headers": { "Authorization": "Bearer pk_live_..." }
    }
  }
}

CLI

npm install -g partli

partli config set-key pk_live_...     # or export PARTLI_API_KEY=pk_live_...

partli stats
partli partners list --status pending
partli partners approve --email jane@example.com
partli commissions list --status approved
partli payouts run                    # asks for confirmation (--yes to skip)
partli sales attribute --email jane@example.com --external-id cs_live_x \
  --amount 79.20 --customer buyer@example.com --note "cookie-less checkout"

Output is JSON (agent-friendly; pipe through jq for reading). Two parity-guaranteeing escape hatches: partli ops lists every operation with its schema straight from the server, and partli call <op> --json '{...}' runs any operation directly — so the CLI can never lag the MCP server.

Operations

  • list_partners / get_partner — roster, status, links, click/sale stats, earnings
  • approve_partner / reject_partner — full approval side-effects (link, email, webhook, coupon)
  • list_commissions — filter by status or partner
  • release_commission — approve a pending commission early (admin override of the holding period)
  • list_payouts / run_payouts — payout history; trigger a run (real money movement)
  • attribute_sale — manually credit a missed referral, with dedupe by external id
  • list_bounties — one-off task rewards
  • workspace_stats — clicks, sales, revenue, partner/commission totals

The definitive list (with JSON Schemas) is always GET /api/agent/ops with your API key — the same registry both surfaces serve.

Raw HTTP (no MCP client, no CLI)

curl -X POST https://partli.app/api/agent/ops/list_partners \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"status": "pending", "limit": 10}'

Safety

Two operations have real-world consequences

  • run_payouts transfers real money via Stripe Connect — the CLI asks for confirmation, and the MCP server's instructions tell agents to confirm with you first.
  • attribute_sale creates a real commission — it's deduped by external id, so it can't double-count, but only attribute sales you've verified.
  • Everything else is read-only or reversible. Revoke a key any time from Dashboard → API keys and both surfaces lose access instantly.