Skip to main content
Glama

@theyahia/mindbox-mcp

用于 Mindbox CDP API 的 MCP 服务器 — 客户档案、订单、细分、商品列表和任意操作。

npm CI License: MIT

功能特性

  • 6 个用于 Mindbox API 的工具

  • 传输方式:stdio(默认)和 Streamable HTTP(--http)

  • 兼容 Claude Desktop、Claude Code、Cursor、Smithery

  • 带退避重试和幂等性(transactionId)的重试机制,HTTP 传输保护

  • 用于自动化典型场景的 Skills

Related MCP server: Constant Contact MCP Server

安装

Claude Desktop

{
  "mcpServers": {
    "mindbox": {
      "command": "npx",
      "args": ["-y", "@theyahia/mindbox-mcp"],
      "env": {
        "MINDBOX_API_KEY": "ваш_ключ",
        "MINDBOX_ENDPOINT_ID": "ваш_endpoint_id"
      }
    }
  }
}

Claude Code

claude mcp add mindbox -e MINDBOX_API_KEY=ваш_ключ -e MINDBOX_ENDPOINT_ID=ваш_endpoint_id -- npx -y @theyahia/mindbox-mcp

Streamable HTTP

MINDBOX_API_KEY=ваш_ключ MINDBOX_ENDPOINT_ID=ваш_endpoint_id npx @theyahia/mindbox-mcp --http
# MCP endpoint: http://127.0.0.1:3000/mcp
# Health check: http://127.0.0.1:3000/health

默认情况下服务器监听 127.0.0.1(参见安全章节)。端口通过 PORT 设置,主机通过 HOST 设置。

Docker(HTTP)

docker build -t mindbox-mcp .
docker run --rm -p 3000:3000 \
  -e MINDBOX_API_KEY=ваш_ключ -e MINDBOX_ENDPOINT_ID=ваш_endpoint_id \
  -e MINDBOX_HTTP_ALLOWED_HOSTS=ваш-домен:3000 \
  mindbox-mcp

容器监听 0.0.0.0:3000。如果使用反向代理,请将您的主机添加到 MINDBOX_HTTP_ALLOWED_HOSTS(DNS 重绑定防护)。

Smithery

已包含 smithery.yaml 文件。必需参数:MINDBOX_API_KEY、MINDBOX_ENDPOINT_ID。

授权与端点

授权头:Authorization: Mindbox secretKey="..."。

请求发送至 POST https://api.mindbox.ru/v3/operations/{sync|async}?endpointId=…&operation=…:

  • sync — 带响应的操作(客户档案、细分、创建订单、商品列表)。默认使用。

  • async — 即发即忘事件(浏览、加入购物车)。可通过 run_operation 的 mode: "async" 使用。

操作的系统名称(operation)在每个 Mindbox 项目中单独配置 — 它们不是通用的内置方法。像 Website.GetCustomerInfo 这样的默认值只是常见约定;项目管理员必须创建具有相同系统名称的操作,否则 Mindbox 将返回 ProtocolError。

环境变量

变量

必填

说明

MINDBOX_API_KEY

是

Mindbox API 密钥(也接受 MINDBOX_SECRET_KEY)

MINDBOX_ENDPOINT_ID

是

集成点 ID(endpointId)

PORT

否

HTTP 服务器端口(默认 3000)

HOST

否

HTTP 绑定主机(默认 127.0.0.1)

MINDBOX_HTTP_TOKEN

否

用于保护 /mcp 的 Bearer 令牌(如果设置 — 请求中必须携带)

MINDBOX_HTTP_ALLOWED_HOSTS

否

额外允许的 Host(逗号分隔),用于 DNS 重绑定防护

MINDBOX_HTTP_ALLOWED_ORIGINS

否

额外允许的 Origin(逗号分隔)

MINDBOX_ALLOW_RAW

否

0/false/off/no 可禁用 run_operation

MINDBOX_MAX_RETRIES

否

429/5xx/超时时的重试次数(默认 3)

MINDBOX_RETRY_BASE_MS

否

退避基础延迟(毫秒)(默认 500)

MINDBOX_TIMEOUT_MS

否

单次尝试的超时时间(毫秒)(默认 15000)

工具(6)

工具

说明

get_customer

按 email/电话/ID 获取客户档案

create_order

创建订单并关联客户

get_segments

获取客户细分

get_product_list

获取商品列表

update_customer

更新客户档案

run_operation

⚠️ 执行任意 Mindbox API 操作(参见安全)

安全

  • run_operation 使用您的密钥执行 Mindbox 的任意操作,可能修改数据。在不受信任的代理场景中,这是 prompt-injection 的载体。调用会记录到 stderr;完全禁用 — MINDBOX_ALLOW_RAW=0。

  • HTTP 传输没有内置认证,除了可选的 MINDBOX_HTTP_TOKEN。服务器默认监听 127.0.0.1,已启用 DNS 重绑定防护(Host/Origin 验证),CORS * 仅允许在 /health 上。对于远程访问,请放在带认证的反向代理后面,非必要不要对外暴露端口。

  • 密钥仅在服务器端使用,绝不应进入浏览器。

Skills

技能

说明

触发词

skill-customer-search

在 Mindbox 中搜索客户

"在 Mindbox 中查找客户"

skill-segment-stats

细分统计

"细分统计"

请求示例

Найди клиента с email user@example.com
Создай заказ для клиента с телефоном +7900...
Какие сегменты у клиента user@example.com?
Покажи список товаров
Обнови имя клиента с ID 12345
Выполни операцию Custom.GetData с телом {"key": "value"}

故障排查

症状

原因和解决方案

环境变量 MINDBOX_API_KEY … 为必填项

未设置 MINDBOX_API_KEY/MINDBOX_ENDPOINT_ID。服务器会启动并在没有它们的情况下返回工具列表,但任何调用都需要密钥。

Mindbox HTTP 401/403

secretKey 或 endpointId 错误,或者密钥没有该操作的权限。

状态:ProtocolError / 未找到操作

操作的系统名称未在 Mindbox 项目中配置。请创建具有相同 systemName 的操作,或传入正确的 operation。

Mindbox:请求超时

超过 MINDBOX_TIMEOUT_MS(默认 15 秒)。服务器已在重试;如有必要请增加超时/重试次数。

HTTP 403 Invalid Host header

触发了 DNS 重绑定防护。请将您的主机添加到 MINDBOX_HTTP_ALLOWED_HOSTS。

开发

npm install          # установка + сборка (prepare)
npm run dev          # stdio
npm run dev:http     # HTTP на порту 3000
npm test             # Vitest
npm run typecheck    # tsc --noEmit
npm run lint         # ESLint

参见 CONTRIBUTING.md。

许可证

MIT

Available Tools

6 tools
create_orderB

Создание заказа в Mindbox с привязкой к клиенту.

Inputs: lines (required), order_id (required), total_price (required), operation, +3 more.

get_customerA

Получение профиля клиента из Mindbox по email, телефону или ID.

Inputs: email, phone, operation, external_id.

get_product_listC

Получение списка товаров из Mindbox.

Inputs: page, operation, page_size.

get_segmentsC

Получение сегментов клиента в Mindbox.

Inputs: email, phone, operation, external_id.

run_operationA

⚠️ ОПАСНО: выполнение ПРОИЗВОЛЬНОЙ операции Mindbox API под секретным ключом. Может изменять данные. Отключается через MINDBOX_ALLOW_RAW=0.

Inputs: operation (required), body, mode.

update_customerC

Обновление профиля клиента в Mindbox.

Inputs: email, phone, last_name, operation, +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct function: customer profile retrieval/update, order creation, segments lookup, product list, and a raw operation escape hatch. No two tools seem to overlap, and the dangerous run_operation is clearly separated by its warning.

    Naming Consistency5/5

    All tools follow a consistent snake_case verb_noun pattern (get_customer, create_order, get_segments, get_product_list, update_customer, run_operation). This is predictable and easy for an agent to parse.

    Tool Count5/5

    With 6 tools, the set is well-scoped for a CRM/ecommerce integration. It covers core customer and order operations without unnecessary bloat, making it easy to navigate.

    Completeness4/5

    The set covers customer retrieval/update, order creation, segments, and products, but lacks explicit order retrieval or listing, and there is no direct customer creation. However, the run_operation tool provides a raw API fallback, mitigating some gaps, though it introduces risk.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      C
      maintenance
      MCP server for MoySklad (МойСклад) warehouse and CRM management API. 21 tools covering the full order lifecycle: products, stock, counterparties, customer orders, shipments, supplies, warehouses, organizations, reports, and webhooks.
      60
      71 npm
      10
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive access to the Constant Contact API v3 for email marketing, campaign management, contact management, analytics, and automation through MCP tools.
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables managing Kontur.Elba data through the official Public API, including organizations, bank accounts, counterparties, products, documents, invoices, and public links via MCP tools.
      4
      8 npm
      MIT