FirstPromoter MCP Server

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.

Category
访问服务器

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

  1. Copy the environment template:

    cp .env.example .env
    
  2. Edit .env and 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

  1. Check Claude Desktop logs for errors
  2. Verify the Docker image built successfully: docker images | grep firstpromoter
  3. Restart Claude Desktop after config changes

API errors from FirstPromoter

  • 401 Unauthorized — check your Bearer token and Account-ID
  • 404 invalid_route — verify Account-ID is correct (not a token)
  • 429 Too Many Requests — rate limit is 400 requests/minute

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选