Affitor

com.affitor由 affitor.com 發布官方發布者v0.2.5更新於 Nov 8, 2026

Affiliate programs in AI tools: read partners, commissions and payouts; track clicks and sales.

已驗證Streamable HTTP可網頁執行開發者工具商業與電商

概覽

AI 產生的概覽

Affitor MCP 伺服器,讓 AI 助理回報聯盟點擊、潛在客戶、銷售與退款,並檢查 Affitor 方案的整合就緒狀態。

可以做什麼
  • 回報點擊與潛在客戶,把客戶綁定到帶來該客戶的聯盟點擊
  • 檢查整合就緒度,回傳第一個未通過的檢查項目與下一步動作
  • 依指定框架與支付服務商取得分步的支付追蹤整合方案
  • 透過真實歸因流程執行一次合成的點擊—潛在客戶—銷售驗證
  • 開啟寫入模式後,記錄銷售與退款,進而產生或沖銷佣金
適用情境
適合經營 Affitor 聯盟方案、希望由代理完成支付追蹤串接與驗證,或從伺服器端程式碼回報轉換而不必手寫 API 呼叫的情境。
執行需求
可使用遠端端點,或以 npx 在本機執行 npm 套件;需要 AFFITOR_API_KEY 中的 Affitor 方案 API 金鑰(缺少時伺服器會結束);可選 AFFITOR_API_URL 覆寫位址;可選 AFFITOR_MCP_WRITE=1 啟用銷售與退款工具;需能連線至 Affitor API。
安裝前請注意
AFFITOR_API_KEY 是伺服器端密鑰,切勿傳到瀏覽器。設定 AFFITOR_MCP_WRITE=1 後,代理可建立真實銷售與佣金,或透過退款沖銷佣金;非必要請保持關閉,並以 testMode 試跑。驗證每小時每方案限 10 次。客戶識別碼與電子郵件會傳送給 Affitor。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Affitor,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.affitor%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "affitor": {
      "type": "http",
      "url": "https://mcp.affitor.com/mcp"
    }
  }
}

README

@affitor/mcp

A Model Context Protocol (MCP) stdio server for Affitor.

It exposes Affitor's affiliate-tracking capabilities as MCP tools so AI agents — Claude Desktop, Cursor, and any other MCP client — can report clicks, leads, sales and refunds, and poll integration readiness, directly as tool calls.

Under the hood it wraps the consolidated server client @affitor/sdk/server (the Affitor class). Authentication is your program API key, supplied via the AFFITOR_API_KEY environment variable.

Add it to your MCP client

Add this to your client's MCP server config (e.g. claude_desktop_config.json for Claude Desktop, or .cursor/mcp.json for Cursor):

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

Restart your client and the affitor tools will be available to the agent.

Environment variables

VariableRequiredDescription
AFFITOR_API_KEYYesYour Affitor program API key (Bearer). Server-side only — never ship it to a browser.
AFFITOR_API_URLNoAPI base override. Defaults to https://api.affitor.com.
AFFITOR_MCP_WRITENoSet to 1 to register the two tools that move money: affitor_track_sale and affitor_track_refund. Off by default, so an agent exploring tools cannot create a real sale or reverse a commission.

If AFFITOR_API_KEY is not set, the server prints a clear message to stderr and exits.

Tools

Every tool carries MCP annotations (readOnlyHint, destructiveHint, idempotentHint), so a client can ask before a write. affitor_track_sale and affitor_track_refund are marked destructive and only exist with AFFITOR_MCP_WRITE=1.

ToolDescription
affitor_readinessCheck this program's integration/onboarding readiness — returns a 5-gate verdict + blocker + next_action. Poll until integration_verified is true.
affitor_track_leadReport a lead/signup. Binds the customer to the click so later sales attribute by customerExternalId alone.
affitor_track_saleNeeds AFFITOR_MCP_WRITE=1. Report a sale: creates a real sale and commission unless testMode is true. Resolves attribution by customerExternalId (bound at lead time).
affitor_track_refundNeeds AFFITOR_MCP_WRITE=1. Report a refund (omit amount = full → commission reversed; partial → refunded). Idempotent by invoiceId. testMode is a dry run.
affitor_track_clickReport a click (usually browser-side; public, no customer needed).
affitor_get_integration_planReturn the deterministic payment-tracking integration plan for a stack — install, checkout-metadata snippet, trackSale snippet + where to inject it, and the verify step. Pure — reads the canonical @affitor/recipes registry; no SDK client, no network, no side-effects. The agent follows this instead of guessing a contract.
affitor_run_verificationFire the synthetic click → lead → sale verification chain through Affitor's REAL attribution pipeline (isolated is_test rows). The agent's proof step: run it, then poll affitor_readiness until integration_verified is true. Rate-limited to 10/program/hour — on a rate_limited result, wait retry_after_seconds, don't hammer.

Inputs

affitor_readiness

  • forceRecheck?: boolean — force a fresh server-side recheck instead of the cached verdict.

affitor_track_lead (one of customerExternalId / clickId is required)

  • customerExternalId?: string — your own user id; binds this customer to the click.
  • clickId?: string — Affitor click id (from the affitor_click_id cookie).
  • email?: string
  • testMode?: boolean — record a test lead (is_test).

affitor_track_sale (one of customerExternalId / clickId is required)

  • customerExternalId?: string — your own user id; resolves attribution (no clickId needed once bound at lead time).
  • clickId?: string
  • amount: number — sale amount in integer cents (e.g. 4999 = $49.99).
  • invoiceId: string — idempotency key (your invoice / transaction id).
  • currency?: string — ISO currency code (default USD).
  • saleType?: "payment" | "subscription"
  • isRecurring?: boolean
  • subscriptionId?: string
  • subscriptionInterval?: "monthly" | "quarterly" | "annual"
  • testMode?: boolean — record a test sale (is_test, no commission), sent as transaction test_<invoiceId> so it never blocks the real sale with the same invoice.

affitor_track_refund

  • invoiceId: string — the sale's idempotency key (the invoiceId you passed to affitor_track_sale).
  • refundAmountCents?: number — integer cents. Omit (or 0) = full refund → commission reversed; partial → refunded.
  • refundReason?: string
  • testMode?: boolean — dry run: returns the refund that would be sent and calls nothing (the API has no test refunds).

affitor_track_click (all optional)

  • affiliateUrl?: string
  • pageUrl?: string
  • referrerUrl?: string
  • existingClickId?: string

affitor_get_integration_plan

  • framework: "next-app" | "next-pages" | "fastify" | "express" | "node" | "unknown" — the detected app framework; determines where trackSale is injected.
  • provider?: "stripe" | "polar" | "lemonsqueezy" | "paddle" | "unknown" — the detected payment provider (default stripe).
  • mode?: "stripe_connect" | "s2s" — payment-tracking mode (default stripe_connect). stripe_connect = Connect autocaptures the sale (metadata only, no trackSale); s2s = inject trackSale in your webhook. Returns { steps, recipe }.

affitor_run_verification (no input)

  • Fires the synthetic verification chain and returns the parsed result. On a rate limit it returns { http_status: 429, retry_after_seconds, … } rather than throwing — back off and retry.

Each tool returns the Affitor API's JSON payload as text content. On a failed request (a thrown error or an { ok: false } envelope) the tool returns an MCP error result with the message.

License

MIT

來源:packages/mcp/README.md,提交 3bd7313

工具

5

affitor_readiness

Check readiness

Check how close this program is to tracking real affiliate sales. Use it first to see what to fix, and after affitor_run_verification, every poll.retry_after_seconds until integration_verified is true. Returns state, integration_verified, blocker (the first failing gate), each gate (profile, economics, payout, tracking, live) with status and next_action, last event times and 24-hour counts.

輸入參數forceRecheck

affitor_track_lead

Report a lead

Record a signup for this program and bind the customer to the affiliate click that brought them, so their later sales attribute from customerExternalId alone. Use it when a referred visitor creates an account, from your server. Send customerExternalId, clickId, or both. Returns { ok, status, data } from the API, or an error naming what is missing.

輸入參數emailclickIdtestModecustomerExternalId

affitor_track_click

Report a click

Record a visit that arrived through an affiliate link. Use it only to track clicks from a server; the Affitor browser tracker does this on its own. Returns { ok, status, data }, where data holds click_id (store it in the affitor_click_id cookie), partner_code and cookie_window_days.

輸入參數pageUrlreferrerUrlaffiliateUrlexistingClickId

affitor_get_integration_plan

Get the integration plan

Get the exact steps to connect a payment stack to Affitor: the install, the checkout metadata snippet, the trackSale snippet and the file it goes in, and the check that proves it works. Use it before writing integration code, instead of guessing the contract. Works offline: it reads a built-in recipe list and calls no API.

輸入參數modeproviderframework必填

affitor_run_verification

Run the verification chain

Prove the integration works: send a test click, lead and sale through Affitor's real attribution pipeline, recorded as is_test rows that are never paid. Use it after setup, then poll affitor_readiness until integration_verified is true. Limited to 10 runs per program per hour; on rate_limited, wait retry_after_seconds. Returns the API response, with http_status added on an error.

無需輸入參數。

版本歷史

3
  1. v0.2.4Oct 21, 2026
  2. v0.2.3Oct 17, 2026
  3. v0.2.2Oct 15, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Affitor 整合