FirstPromoter MCP Server
An MCP server that provides AI assistants with access to the FirstPromoter affiliate management platform for managing referrals, promoters, campaigns, and commissions. It is designed for remote multi-user deployment and supports operations via HTTP/SSE transport.
README
FirstPromoter MCP Server
An MCP (Model Context Protocol) server that connects AI assistants like Claude to your FirstPromoter affiliate management platform.
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 | How the AI connects — stdio (local) or HTTP (remote) |
| 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 install
Step 2: Configure Credentials
-
Copy the environment template:
cp .env.example .env -
Edit
.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:stdio
You should see:
FirstPromoter MCP Server running on stdio
Step 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"
- "Find promoters who joined this month"
- "Show accepted promoters with more than 10 customers"
Available Tools
get_promoters
Lists promoters from your FirstPromoter account with full filtering, sorting, and search capabilities.
Search & Pagination:
| Parameter | Type | Description |
|---|---|---|
q |
string | Search by email, name, or ref_id |
ids |
number[] | Filter by specific promoter IDs |
page |
number | Page number (starts at 1) |
per_page |
number | Results per page (1-100, default 20) |
Filters:
| Parameter | Type | Description |
|---|---|---|
state |
enum | pending, accepted, rejected, blocked, inactive, not_set |
campaign_id |
number | Filter by campaign |
parent_promoter_id |
number | Filter by parent promoter (sub-affiliates) |
archived |
boolean | Archived status |
has_wform |
enum | W-form status: yes or no |
subscribed_to_email |
boolean | Email subscription status |
custom_field1 |
string | Custom field 1 value |
custom_field2 |
string | Custom field 2 value |
fraud_suspicions |
string[] | same_ip_suspicion, same_promoter_email, ad_source, no_suspicion |
Range Filters:
| Parameter | Type | Description |
|---|---|---|
revenue_amount_from / _to |
number | Revenue range (in cents) |
customers_count_from / _to |
number | Customer count range |
referrals_count_from / _to |
number | Referral count range |
clicks_count_from / _to |
number | Click count range |
Date Filters:
| Parameter | Type | Description |
|---|---|---|
joined_at_from / _to |
string | Join date range (YYYY-MM-DD HH:MM:SS) |
last_login_at_from / _to |
string | Last login date range |
Sorting:
| Parameter | Type | Description |
|---|---|---|
sort_by |
enum | clicks_count, referrals_count, customers_count, revenue_amount, joined_at |
sort_direction |
enum | asc or desc |
Response fields per promoter:
- Identity: id, email, name, state, note, custom_fields
- Profile: website, company, country, phone, social links (instagram, youtube, linkedin, etc.)
- Stats: clicks, referrals, sales, customers, active customers, revenue (in cents)
- Campaigns: campaign name, ref link, coupon code
- Dates: joined_at, last_login_at, created_at, archived_at
- Fraud: fraud_suspicions array
Project Structure
firstpromoter-mcp/
├── src/
│ ├── index.ts # Entry point: server creation + stdio transport
│ ├── api.ts # FirstPromoter API helper (auth, fetch, errors)
│ ├── formatters.ts # Response formatters (structured text + raw JSON)
│ └── tools/
│ ├── index.ts # Tool registry
│ └── promoters.ts # get_promoters tool definition
├── dist/ # Compiled JavaScript
├── Dockerfile # Multi-stage Docker build
├── package.json
├── tsconfig.json
└── .env.example
Development Scripts
| Command | Description |
|---|---|
npm run dev:stdio |
Run server in development mode (auto-loads .env) |
npm run build |
Compile TypeScript to JavaScript |
npm start |
Run compiled server (auto-loads .env) |
docker build -t firstpromoter-mcp . |
Build Docker image |
Roadmap
- [x] Phase 1: Local stdio server with get_promoters (all API params)
- [ ] Phase 2: Remote deployment (Streamable HTTP transport)
- [ ] Phase 3: OAuth authentication (Google)
- [ ] Phase 4: Production polish (error handling, logging, rate limiting)
- [ ] Phase 5: Smart caching (SQLite for historical reports)
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 firstpromoter - Restart 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.