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
A Model Context Protocol (MCP) server that provides AI assistants with access to the FirstPromoter affiliate management platform. Designed for remote multi-user deployment using HTTP/SSE transport.
π― Features
Referral Management
get_referrals- List all referrals with search, state, and promoter filtersget_referral- Get detailed information about a specific referral
Promoter Management
get_promoters- List all promoters with filterscreate_promoter- Create a new promoterget_promoter- Get detailed promoter informationupdate_promoter- Update promoter detailsadd_promoters_to_campaign- Add promoters to a campaignmove_promoters_to_campaign- Move promoters between campaignsaccept_promoters- Accept pending promotersreject_promoters- Reject pending promotersblock_promoters- Block promotersarchive_promoters- Archive promotersrestore_promoters- Restore archived promoters
Campaign Management
get_promoter_campaigns- List promoter-campaign relationshipsupdate_promoter_campaign- Update campaign settings
Commission Management
get_commissions- List all commissions with filtersapprove_commissions- Approve pending commissionsdeny_commissions- Deny commissions
Payout Management
get_payouts- List all payoutsget_payout_stats- Get payout statisticsget_due_payout_stats- Get due payout statisticsget_payouts_by_promoter- Get payouts grouped by promoter
ποΈ Architecture
π Deployment to Dokploy
Prerequisites
Dokploy v0.26.6+ installed on your Hetzner server
FirstPromoter API Key and Account ID
(Optional) Domain name for HTTPS
Step 1: Create the Project in Dokploy
Log into your Dokploy dashboard
Click "Create Project"
Name it
firstpromoter-mcp
Step 2: Create the Application
Inside the project, click "Create Application"
Select "Docker Compose" as the source type
Choose "Git" or "Upload" based on your preference
Option A: Git Repository
Push this code to a Git repository
Connect the repository in Dokploy
Option B: Direct Upload
Upload all files to Dokploy
Step 3: Configure Environment Variables
In Dokploy's application settings, add these environment variables:
Variable | Description | Required |
| FirstPromoter API Key | β Yes |
| FirstPromoter Account ID | β Yes |
| Token for MCP client auth | π Recommended |
| Server port (default: 8000) | β Optional |
Step 4: Configure Domain (HTTPS)
In Dokploy, go to Domains
Add your domain (e.g.,
mcp.yourdomain.com)Enable HTTPS (Let's Encrypt)
Set the target port to
8000
Step 5: Deploy
Click Deploy in Dokploy. The server will build and start.
π Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Claude Code (CLI)
n8n Integration
Option 1: Using MCP Node (if available)
Configure the MCP node with:
Transport: SSE
URL:
https://mcp.yourdomain.com/sse
Option 2: Direct HTTP Requests
Use the HTTP Request node to call FirstPromoter API directly. The MCP server exposes the same endpoints.
π Security Recommendations
1. Enable HTTPS
Always use HTTPS in production. Dokploy handles this automatically with Let's Encrypt.
2. IP Allowlisting
In Dokploy, you can configure firewall rules to only allow specific IPs:
Your office IP
Your colleagues' IPs
n8n server IP
3. Authentication Token
Set MCP_AUTH_TOKEN to require clients to authenticate. Clients must include this token in their requests.
4. Rate Limiting
FirstPromoter has a rate limit of 400 requests/minute. The MCP server doesn't add additional rate limiting, but you can add a reverse proxy (like Nginx) in front if needed.
π§ͺ Testing
Health Check
List Tools
Local Testing (Docker)
π Example Usage
Once connected, you can ask Claude:
Promoter Management:
"Show me all pending promoters"
"Create a new promoter with email john@example.com"
"Accept promoter ID 12345"
"Move promoters 100, 101, 102 to campaign 5"
Commission Management:
"List all pending commissions"
"Approve commission IDs 500, 501, 502"
"Show commission stats"
Payout Management:
"What are the payout statistics?"
"Show me all pending payouts"
"Get due payout stats"
Referral Management:
"List all referrals from promoter 123"
"Get details for referral ID 456"
π§ Troubleshooting
Server won't start
Check logs in Dokploy or run:
Common issues:
Missing
FP_API_KEYorFP_ACCOUNT_IDPort 8000 already in use
API errors
Verify your FirstPromoter credentials:
Log into FirstPromoter
Go to Settings β Integrations β Manage API Keys
Ensure the API key has appropriate permissions
Connection refused
Check if the container is running
Verify Dokploy domain configuration
Check firewall rules
π License
MIT License
π€ Contributing
Fork the repository
Create a feature branch
Submit a pull request