SalesBox MCP Server

SalesBox MCP Server

Wraps the SalesBox public API to manage cashbacks, categories, chats, SEO, custom fields, discounts, and filters via MCP tools.

Category
访问服务器

README

SalesBox MCP Server

An MCP server that wraps the SalesBox public API (https://prod.salesbox.me). It exposes the /openapi/* endpoints as MCP tools so Claude / any MCP client can manage cashbacks, categories, chats, SEO, custom fields, discounts, and filters.

It ships with two transports:

  • Streamable HTTP (default) — for running on a VPS and connecting remotely.
  • stdio — for local MCP clients (Claude Desktop, etc.).

Rate limits (100 req/min per company; upload 200/hour) are handled automatically: on HTTP 429 the server reads Retry-After and retries.


1. Prerequisites

  • A SalesBox OpenAPI token — get it from the support bot.
  • Node.js 20+ or Docker.

2. Configure

cp .env.example .env
# edit .env — set SALESBOX_API_TOKEN and (recommended) MCP_AUTH_TOKEN

Key settings (see .env.example for all):

Var Purpose
SALESBOX_API_TOKEN Default SalesBox token. Clients can override per-request via the X-Salesbox-Token header.
MCP_TRANSPORT http (VPS) or stdio (local).
PORT / HOST HTTP listen address.
MCP_AUTH_TOKEN Shared secret guarding /mcp. Clients send Authorization: Bearer <token>. Set this if the port is public.

3. Run locally

npm install
npm run build
npm start            # HTTP on :3000
# or
npm run start:stdio  # stdio

Health check: curl http://localhost:3000/health


4. Deploy to a Hetzner VPS

Two options — Docker (recommended) or systemd.

A note on the SDK security default

The Streamable HTTP transport validates the Origin header on requests it processes; keeping the container bound to 127.0.0.1 and terminating TLS at a reverse proxy (below) is the safe setup. Always also set MCP_AUTH_TOKEN.

Quickest path — one-shot script (Docker + Caddy + firewall)

On a fresh Ubuntu Hetzner box, with a DNS A record mcp.yourdomain.com → server IP:

# 1. Authenticate to GitHub once (private repo), then clone
gh auth login            # or set up an SSH deploy key
git clone https://github.com/andriistakhov/salesbox-mcp.git /opt/salesbox-mcp
cd /opt/salesbox-mcp

# 2. Run the installer with your domain
sudo bash deploy/setup.sh mcp.yourdomain.com

The script installs Docker + Caddy, generates .env (multi-tenant: empty SALESBOX_API_TOKEN, a random MCP_AUTH_TOKEN it prints for you), builds and starts the container, configures Caddy for automatic HTTPS, and opens the firewall (22/80/443). Endpoint: https://mcp.yourdomain.com/mcp.

To redeploy after pushing new code: sudo bash deploy/update.sh.

The manual steps below do the same thing by hand.

Option A — Docker + Caddy (auto HTTPS)

On a fresh Hetzner Cloud Ubuntu box:

# 1. Install Docker
curl -fsSL https://get.docker.com | sh

# 2. Get the code
git clone <your-repo-url> /opt/salesbox-mcp
cd /opt/salesbox-mcp
cp .env.example .env && nano .env   # set tokens

# 3. Build & run (binds to 127.0.0.1:3000 by compose default)
docker compose up -d --build
docker compose logs -f

Put TLS in front with Caddy (gets a Let's Encrypt cert automatically):

apt install -y caddy
# Point an A record: mcp.yourdomain.com -> <VPS IP>, then:
cp deploy/Caddyfile /etc/caddy/Caddyfile
nano /etc/caddy/Caddyfile      # replace mcp.example.com with your domain
systemctl restart caddy

Your endpoint is now https://mcp.yourdomain.com/mcp.

Firewall (Hetzner Cloud firewall or ufw): allow only 22, 80, 443. Do not expose port 3000 publicly — Caddy proxies to it over localhost.

ufw allow 22,80,443/tcp && ufw enable

Option B — systemd (no Docker)

# Install Node 22
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && apt install -y nodejs

# Code + build
git clone <your-repo-url> /opt/salesbox-mcp
cd /opt/salesbox-mcp
npm ci && npm run build
cp .env.example .env && nano .env

# Dedicated user + service
useradd --system --no-create-home salesbox || true
chown -R salesbox:salesbox /opt/salesbox-mcp
cp deploy/salesbox-mcp.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now salesbox-mcp
systemctl status salesbox-mcp

Then front it with Caddy/Nginx for TLS the same way as Option A.


5. Connect a client

Claude Code / any HTTP MCP client

{
  "mcpServers": {
    "salesbox": {
      "type": "http",
      "url": "https://mcp.yourdomain.com/mcp",
      "headers": {
        "Authorization": "Bearer <MCP_AUTH_TOKEN>",
        "X-Salesbox-Token": "<optional-per-client-salesbox-token>"
      }
    }
  }
}

X-Salesbox-Token is only needed if you did not bake SALESBOX_API_TOKEN into .env, or you want a different token per client.

Claude Desktop (stdio, local)

{
  "mcpServers": {
    "salesbox": {
      "command": "node",
      "args": ["/opt/salesbox-mcp/dist/index.js"],
      "env": {
        "MCP_TRANSPORT": "stdio",
        "SALESBOX_API_TOKEN": "<your-token>"
      }
    }
  }
}

Quick manual test

curl -X POST https://mcp.yourdomain.com/mcp \
  -H "Authorization: Bearer <MCP_AUTH_TOKEN>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

6. Tools

Grouped by resource. Every tool accepts an optional token argument to override the server token for that call.

  • Cashback — salesbox_cashback_list, _get, _create, _update, _delete
  • Categories — salesbox_categories_list, salesbox_category_get, _create_many, _update_many, _delete, _set_ordering
  • Category custom fields — salesbox_category_custom_fields_get, _set, salesbox_category_custom_field_clear
  • Category SEO — salesbox_category_seo_get, _set, _clear_field, salesbox_categories_seo_list, _seo_update_many, _seo_delete_many
  • Chats — salesbox_chats_by_user, salesbox_chat_send_message
  • Company — salesbox_company_custom_fields_get, _set, salesbox_company_custom_field_clear, salesbox_company_seo_get, _set, _clear_field
  • Custom field definitions — salesbox_custom_field_definitions_list, _definition_create, _definition_update, _definition_delete
  • Discounts — salesbox_discounts_list, salesbox_discount_get, _create, _update, _delete, salesbox_discounts_delete_many
  • Filters — salesbox_filters_list, _create_many, _update_many, _delete_many
  • Escape hatch — salesbox_raw_request — call any /openapi/* endpoint not covered above (the provided OpenAPI was large; use this for offers, orders, users, uploads, etc.).

The salesbox_raw_request tool covers any endpoint that doesn't have a dedicated wrapper yet. If you want first-class tools for more resources (offers, orders, users, S3 upload…), the pattern in src/tools.ts is easy to extend.

Project layout

src/
  index.ts     entrypoint (http + stdio transports)
  server.ts    builds the MCP server
  tools.ts     all tool definitions
  client.ts    SalesBox HTTP client (auth, 429 retry)
  config.ts    env-based config
  context.ts   per-request token (X-Salesbox-Token)
Dockerfile, docker-compose.yml
deploy/salesbox-mcp.service, deploy/Caddyfile

推荐服务器

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 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
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 模型以安全和受控的方式获取实时的网络信息。

官方
精选