Supports the creation of Stripe-based promo codes for affiliate campaigns within the FirstPromoter platform.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FirstPromoter MCP Serverlist all pending commissions that need approval"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FirstPromoter MCP Server (Local)
A local MCP (Model Context Protocol) server that connects AI assistants like Claude to your FirstPromoter affiliate management platform. Runs on your machine via Docker or Node.js — your API credentials never leave your device.
Looking for the remote/hosted version? That will be a separate project (coming later).
What is This?
This server acts as a translator between AI assistants and FirstPromoter:
Component | What it Does |
MCP Server | Receives requests from AI, returns structured data |
Tools | Actions the AI can perform (e.g., "Get Promoters") |
Transport | stdio — runs locally on your machine |
FirstPromoter API | The data source — your affiliate management platform |
Quick Start
Prerequisites
Node.js 20+ installed
A FirstPromoter account with API access
Claude Desktop (for testing)
Step 1: Install Dependencies
cd firstpromoter-mcp
npm installStep 2: Configure Credentials
Copy the environment template:
cp .env.example .envEdit
.envand add your FirstPromoter credentials:FP_BEARER_TOKEN: Find at Dashboard > Settings > Integrations > Manage API Keys
FP_ACCOUNT_ID: Find at Dashboard > Settings > Integrations
Step 3: Build & Test
# Build TypeScript
npm run build
# Test locally (loads .env automatically)
npm run dev:stdioYou should see:
FirstPromoter MCP Server running on stdioStep 4: Connect to Claude Desktop
Option A: Docker (recommended)
Build the Docker image:
docker build -t firstpromoter-mcp .Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"firstpromoter": {
"command": "docker",
"args": ["run", "-i", "--rm",
"-e", "FP_BEARER_TOKEN",
"-e", "FP_ACCOUNT_ID",
"firstpromoter-mcp"
],
"env": {
"FP_BEARER_TOKEN": "your_token_here",
"FP_ACCOUNT_ID": "your_account_id_here"
}
}
}
}Option B: Direct Node.js
{
"mcpServers": {
"firstpromoter": {
"command": "node",
"args": ["/full/path/to/firstpromoter-mcp/dist/index.js"],
"env": {
"FP_BEARER_TOKEN": "your_token_here",
"FP_ACCOUNT_ID": "your_account_id_here"
}
}
}
}Restart Claude Desktop after editing the config.
Step 5: Try It Out
Ask Claude:
"List my promoters"
"Show me promoters sorted by revenue"
"Show all commissions for this month"
"Get a campaign performance report for Q1"
"List all promo codes"
Available Tools (43 total)
Promoters (12 tools)
Tool | Description |
| List promoters with 26 filter/sort/search params |
| Get single promoter by ID or lookup (email, auth_token, ref_token, promo_code) |
| Create a new promoter (21 params) |
| Update promoter info (24 params, find_by support) |
| Accept pending promoters into a campaign (batch) |
| Reject promoters from a campaign (batch) |
| Block promoters from a campaign (batch) |
| Archive promoters globally (batch) |
| Restore archived promoters (batch) |
| Move promoters between campaigns (batch) |
| Add promoters to a campaign (batch) |
| Set parent promoter for sub-affiliate relationship (batch) |
Referrals (5 tools)
Tool | Description |
| List referrals with filters (type, promoter_id, state, search) |
| Get single referral by ID or lookup (email, uid, username) |
| Update referral (email, uid, username, promoter_campaign_id, split_details) |
| Move referrals to a different promoter (batch) |
| Delete referrals (batch) |
Commissions (7 tools)
Tool | Description |
| List commissions with filters (status, paid, fulfilled, sale_amount, campaign_id, fraud_check) |
| Create a commission (sale type or custom type) |
| Update commission notes (internal_note, external_note) |
| Approve commissions (batch) |
| Deny commissions (batch) |
| Mark non-monetary commissions as fulfilled (batch) |
| Mark non-monetary commissions as unfulfilled (batch) |
Payouts (4 tools)
Tool | Description |
| List payouts with 18 filter params (status, campaign, dates, method, promoter) |
| Payouts aggregated by promoter |
| Payout statistics with breakdowns (stats_by) |
| Due payout statistics |
Reports (5 tools)
Tool | Description |
| Campaign performance reports (19 available columns, time-period breakdowns) |
| Overview time-series reports |
| Promoter performance reports |
| Traffic source reports (11 columns) |
| URL performance reports (12 columns) |
Promo Codes (5 tools)
Tool | Description |
| List promo codes (optional filter by promoter_campaign_id) |
| Get single promo code by ID |
| Create a promo code (Stripe only — requires code, reward_id, promoter_campaign_id) |
| Update promo code |
| Archive (soft-delete) a promo code |
Promoter Campaigns (2 tools)
Tool | Description |
| List all promoter-campaign links with stats |
| Update promoter campaign (ref_token, state, coupon, rewards, customization) |
Batch Processes (3 tools)
Tool | Description |
| List batch processes with optional status filter |
| Get details of a specific batch process by ID |
| Quick progress overview — map of batch IDs to completion percentage |
All batch operations run asynchronously when more than 5 IDs are provided. Monetary amounts are in cents (divide by 100 for dollars).
Project Structure
firstpromoter-mcp/
├── src/
│ ├── index.ts # Entry point: server creation + stdio transport
│ ├── api.ts # API helper (auth, fetch, errors, rate limiting, retry)
│ ├── logger.ts # Stderr logger (debug/info/warn/error, LOG_LEVEL)
│ ├── formatters.ts # Response formatters (structured text + raw JSON)
│ └── tools/
│ ├── index.ts # Tool registry — registers all 43 tools
│ ├── promoters.ts # 12 promoter tools
│ ├── referrals.ts # 5 referral tools
│ ├── commissions.ts # 7 commission tools
│ ├── payouts.ts # 4 payout tools
│ ├── reports.ts # 5 report tools
│ ├── promo-codes.ts # 5 promo code tools
│ ├── promoter-campaigns.ts # 2 promoter campaign tools
│ └── batch-processes.ts # 3 batch process tools
├── dist/ # Compiled JavaScript
├── Dockerfile # Multi-stage Docker build
├── package.json
├── tsconfig.json
└── .env.exampleConfiguration
Variable | Default | Description |
| — | FirstPromoter API token (required) |
| — | FirstPromoter account ID (required) |
|
| Log verbosity: |
Set LOG_LEVEL=debug to see every API request/response with timing. Logs go to stderr only (stdout is reserved for MCP protocol).
Development Scripts
Command | Description |
| Run server in development mode (auto-loads .env) |
| Compile TypeScript to JavaScript |
| Run compiled server (auto-loads .env) |
| Build Docker image |
Roadmap
Phase 1: Local stdio server with all promoter tools (12 tools)
Phase 2: All remaining API tools — referrals, commissions, payouts, reports, promo codes, promoter campaigns, batch processes (31 tools)
Phase 3: Production polish (error handling, logging, rate limiting)
A remote HTTP server with OAuth authentication will be developed as a separate project.
Troubleshooting
"Credentials not configured" error
Make sure your .env file (local dev) or Claude Desktop config env section contains valid FP_BEARER_TOKEN and FP_ACCOUNT_ID.
Server doesn't appear in Claude Desktop
Check Claude Desktop logs for errors
Verify the Docker image built successfully:
docker images | grep firstpromoterRestart Claude Desktop after config changes
API errors from FirstPromoter
401 Unauthorized— check your Bearer token and Account-ID404 invalid_route— verify Account-ID is correct (not a token)429 Too Many Requests— rate limit is 400 requests/minute
License
MIT
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.