Ermöglicht es AI-Agents, Affiliate-Programme zu verwalten, indem sie Clicks, Leads, Sales und Refunds melden und gleichzeitig die Integrationsbereitschaft tracken.
Auch bekannt als Affitor/cli, mcp, @affitor/mcp
- Stars
- 0
- Tools
- 10
- Downloads, 30 Tage
- 750
- Neueste Version
- 0.2.5
- Letzter Commit
- 21. Okt. 2026
- Lizenz
- MIT
Was ist Affitor MCP?
Affitor ist ein MCP server. Ermöglicht es AI-Agents, Affiliate-Programme zu verwalten, indem sie Clicks, Leads, Sales und Refunds melden und gleichzeitig die Integrationsbereitschaft tracken. Er stellt 10 Tools bereit, etwa affitor_readiness, affitor_track_lead, affitor_track_sale.
Zusammenfassung generiert aus dem README des Projekts
Über Affitor MCP server
Mit Affitor ist es möglich, Affiliate-Programme über AI-Agents zu verwalten. Dies erlaubt Clients wie Claude Desktop oder Cursor, Clicks, Leads, Sales und Refunds zu melden. Dieser stdio-Server verbindet deinen Agent mit der Affitor-Plattform über einen Program API key, den du via AFFITOR_API_KEY Umgebungsvariable übergibst. Er ist für Entwickler konzipiert, die das Tracking von Affiliate-Attribution und den Integrationsstatus direkt aus ihrer Entwicklungsumgebung heraus automatisieren wollen.
Um versehentliche finanzielle Änderungen zu verhindern, erfordert der Server, dass die Umgebungsvariable AFFITOR_MCP_WRITE auf 1 gesetzt ist, bevor die Tools affitor_track_sale und affitor_track_refund verfügbar werden. Der Server enthält zudem spezialisierte Tools für das technische Setup, wie etwa affitor_get_integration_plan zum Abrufen von Implementierungsschritten oder affitor_run_verification zum Testen der Attribution-Pipeline. Nutzer können zudem den Fortschritt ihres Setups mit dem Tool affitor_readiness überwachen, um Blocker oder erforderliche nächste Schritte zu identifizieren.
Was du damit machen kannst
- 1Affiliate-Integrationsbereitschaft prüfenLass den Agent prüfen, ob das aktuelle Affiliate-Programm-Setup vollständig verifiziert und bereit für die Production ist.
- 2Neue Kundensales meldenAnweisung an den Agent, eine abgeschlossene Transaktion und die dazugehörige Provision unter Verwendung einer spezifischen Invoice ID zu erfassen.
- 3Technische Implementierungspläne erstellenFordere eine Schritt-für-Schritt-Anleitung an, um Tracking-Snippets in einen spezifischen Web-Framework- und Payment-Provider-Stack einzubinden.
- 4Transaktions-Refunds verarbeitenLass den Agent eine Provision rückgängig machen, indem er einen vollständigen oder teilweisen Refund für eine zuvor erfasste Invoice meldet.
Geschrieben aus dem README des Projekts. Jeder Use Case wurde gegen ein Zitat daraus geprüft.
So installierst du Affitor MCP
Formate geprüft am 10. Nov. 2026Zu Cursor hinzufügenZu Goose hinzufügenAffitor MCP in Claude Code installieren
$ claude mcp add --env 'AFFITOR_API_KEY=<YOUR_AFFITOR_API_KEY>' mcp -- npx -y @affitor/mcpAffitor MCP in Cursor installieren
~/.cursor/mcp.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@affitor/mcp"
],
"env": {
"AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
}
}
}
}Affitor MCP in VS Code installieren
.vscode/mcp.json
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@affitor/mcp"
],
"env": {
"AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
}
}
}
}Affitor MCP in VS Code CLI installieren
$ code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@affitor/mcp"],"env":{"AFFITOR_API_KEY":"<YOUR_AFFITOR_API_KEY>"}}'Affitor MCP in Claude Desktop installieren
claude_desktop_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@affitor/mcp"
],
"env": {
"AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
}
}
}
}Affitor MCP in Codex installieren
$ codex mcp add mcp --env 'AFFITOR_API_KEY=<YOUR_AFFITOR_API_KEY>' -- npx -y @affitor/mcpAffitor MCP in Codex config.toml installieren
~/.codex/config.toml
[mcp_servers.mcp] command = "npx" args = ["-y", "@affitor/mcp"] [mcp_servers.mcp.env] AFFITOR_API_KEY = "<YOUR_AFFITOR_API_KEY>"
Affitor MCP in Gemini CLI installieren
$ gemini mcp add -s user -e 'AFFITOR_API_KEY=<YOUR_AFFITOR_API_KEY>' mcp npx -- -y @affitor/mcpAffitor MCP in Gemini settings.json installieren
~/.gemini/settings.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@affitor/mcp"
],
"env": {
"AFFITOR_API_KEY": "<YOUR_AFFITOR_API_KEY>"
}
}
}
}Affitor MCP tools 10
Erkannt aus dem READMEaffitor_readinessaffitor_track_leadaffitor_track_saleaffitor_track_refundaffitor_track_clickaffitor_get_integration_planaffitor_run_verificationamountinvoiceIdframework
| affitor_readiness | — | |
| affitor_track_lead | — | |
| affitor_track_sale | — | |
| affitor_track_refund | — | |
| affitor_track_click | — | |
| affitor_get_integration_plan | — | |
| affitor_run_verification | — | |
| amount | — | |
| invoiceId | — | |
| framework | — |
Konfiguration
AFFITOR_API_KEYErforderlichSecretYour Affitor program API key. Server-side only.
AFFITOR_API_URLAPI base override. Defaults to https://api.affitor.com.
AFFITOR_MCP_WRITESet to 1 to register the two tools that move money (track sale, track refund). Off by default.
| Name | Beschreibung | Typ |
|---|---|---|
| AFFITOR_API_KEY | Your Affitor program API key. Server-side only. | ErforderlichSecret |
| AFFITOR_API_URL | API base override. Defaults to https://api.affitor.com. | |
| AFFITOR_MCP_WRITE | Set to 1 to register the two tools that move money (track sale, track refund). Off by default. |
Automatisierte Checks
Geluften am 12. Nov. 2026Vollständiger Bericht →Unsere automatisierten Checks bestanden. Das ist kein Security-Audit: Lies den Code und gib dem Server nur den minimal notwendigen Zugriff. Wie die Checks funktionieren
- Source Repository verknüpft und erreichbarBestanden
- Open Source Lizenz (OSI)Bestanden
- Commit oder Release im letzten JahrBestanden
- Package-Name ähnelt keinem populären PackageBestanden
- Remote Endpoint nutzt HTTPSBestanden
- Destruktive Tools sind markiertBestanden
- Keine versteckten Anweisungen an das ModellBestanden
- Keine kritischen Advisories im Paket oder seinen AbhängigkeitenBestanden
README
Auf GitHub ansehen@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):
{
"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
| Variable | Required | Description |
|---|---|---|
AFFITOR_API_KEY |
Yes | Your Affitor program API key (Bearer). Server-side only — never ship it to a browser. |
AFFITOR_API_URL |
No | API base override. Defaults to https://api.affitor.com. |
AFFITOR_MCP_WRITE |
No | Set 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.
| Tool | Description |
|---|---|
affitor_readiness |
Check this program's integration/onboarding readiness — returns a 5-gate verdict + blocker + next_action. Poll until integration_verified is true. |
affitor_track_lead |
Report a lead/signup. Binds the customer to the click so later sales attribute by customerExternalId alone. |
affitor_track_sale |
Needs 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_refund |
Needs AFFITOR_MCP_WRITE=1. Report a refund (omit amount = full → commission reversed; partial → refunded). Idempotent by invoiceId. testMode is a dry run. |
affitor_track_click |
Report a click (usually browser-side; public, no customer needed). |
affitor_get_integration_plan |
Return 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_verification |
Fire 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 theaffitor_click_idcookie).email?: stringtestMode?: boolean— record a test lead (is_test).
affitor_track_sale (one of customerExternalId / clickId is required)
customerExternalId?: string— your own user id; resolves attribution (noclickIdneeded once bound at lead time).clickId?: stringamount: number— sale amount in integer cents (e.g.4999= $49.99).invoiceId: string— idempotency key (your invoice / transaction id).currency?: string— ISO currency code (defaultUSD).saleType?: "payment" | "subscription"isRecurring?: booleansubscriptionId?: stringsubscriptionInterval?: "monthly" | "quarterly" | "annual"testMode?: boolean— record a test sale (is_test, no commission), sent as transactiontest_<invoiceId>so it never blocks the real sale with the same invoice.
affitor_track_refund
invoiceId: string— the sale's idempotency key (theinvoiceIdyou passed toaffitor_track_sale).refundAmountCents?: number— integer cents. Omit (or0) = full refund → commission reversed; partial → refunded.refundReason?: stringtestMode?: 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?: stringpageUrl?: stringreferrerUrl?: stringexistingClickId?: string
affitor_get_integration_plan
framework: "next-app" | "next-pages" | "fastify" | "express" | "node" | "unknown"— the detected app framework; determines wheretrackSaleis injected.provider?: "stripe" | "polar" | "lemonsqueezy" | "paddle" | "unknown"— the detected payment provider (defaultstripe).mode?: "stripe_connect" | "s2s"— payment-tracking mode (defaultstripe_connect).stripe_connect= Connect autocaptures the sale (metadata only, notrackSale);s2s= injecttrackSalein 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
Affitor MCP Fragen
Wie füge ich Affitor MCP zu Claude Code hinzu?
Führe claude mcp add --env 'AFFITOR_API_KEY=<YOUR_AFFITOR_API_KEY>' mcp -- npx -y @affitor/mcp in deinem Terminal aus. Füge --scope user hinzu, damit der Server in jedem Projekt verfügbar ist.
Wie füge ich Affitor MCP zu Cursor hinzu?
Öffne ~/.cursor/mcp.json und füge den Server unter mcpServers hinzu, mit der Cursor-Config aus dem Installationsabschnitt oben.
Welche Tools bietet Affitor MCP?
Er stellt 10 Tools bereit, darunter affitor_readiness, affitor_track_lead, affitor_track_sale, affitor_track_refund, affitor_track_click.
Wie aktiviere ich das Tracking von Sales und Refunds?
Du musst die Umgebungsvariable AFFITOR_MCP_WRITE auf 1 setzen, um die Tools freizuschalten, die Finanztransaktionen durchführen.
Welche Authentifizierungsmethode nutzt Affitor?
Der Server nutzt einen Program API key, den du über die Umgebungsvariable AFFITOR_API_KEY bereitstellst.
Wie kann ich prüfen, ob meine Integration korrekt funktioniert?
Du kannst das Tool affitor_run_verification nutzen, um eine synthetische Kette aus Click-, Lead- und Sale-Verifizierungen durch die echte Attribution-Pipeline zu jagen.
Kann ich Sales testen, ohne echte Provisionen zu beeinflussen?
Ja, du kannst den Parameter testMode verwenden, um einen Test-Sale zu protokollieren, der keine echte Provision erstellt.