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 集成