Mcp Clearsale

io.github.codespar由 GitHub 账号 codespar 发布v0.2.0-alpha.3更新于 Oct 24, 2026

MCP server for ClearSale — Brazilian fraud prevention, order risk scoring, device fingerprinting

概览

AI 生成的概览

让助手把订单提交给 ClearSale 进行巴西反欺诈评分、获取决策结果,并处理相关的 KYC 与案件流程。

可以做什么
将 ClearSale 反欺诈 API 封装为 18 个工具,覆盖“分析—决策—反馈”流程:send_order_for_analysis 提交订单,get_order_analysis 和 get_order_score 返回订单状态与 0-100 风险分,update_order_status 上报商家的最终决定。还支持设备指纹会话、行为事件跟踪、CPF/CNPJ 与地址校验、按证件或联系方式查询评分、OTP/KBA 验证、拒付通知以及欺诈调查案件管理。
适用场景
当助手需要处理巴西电商订单的 ClearSale 反欺诈决策时使用,例如提交订单分析、轮询或上报订单结果,或查询某个证件、联系方式的风险信号。它面向已与 ClearSale 签约的商家,而非通用场景。
运行要求
通过 npm 包 @codespar/mcp-clearsale 以 stdio 在本地运行(需要 Node.js;npx @codespar/mcp-clearsale)。需要 ClearSale 签发的 bearer token,放在 CLEARSALE_API_KEY 中;可选 CLEARSALE_BASE_URL,默认指向生产 API,可改为合同提供的测试地址。需要访问 ClearSale 的网络连接,且没有公开沙箱。
安装前请注意
该服务器在 CLEARSALE_API_KEY 中保存 ClearSale bearer token,可访问订单、支付和客户数据,应视为敏感密钥。多个工具会写入 ClearSale 或改变订单状态,包括 send_order_for_analysis、update_order_status、resolve_manual_review、create_chargeback_notification 以及案件相关工具。提交订单和按证件、联系方式查询会把客户与订单数据发送给 ClearSale,验证工具还可能向买家发送 OTP 消息。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Clearsale,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@codespar/mcp-clearsale

MCP server for ClearSale — Brazilian fraud prevention.

ClearSale pioneered fraud analytics in Brazil (founded 2001, São Paulo) and remains the default antifraud layer for most major BR ecommerce. This is the first entry in the CodeSpar fraud category — no other server in the catalog does fraud scoring. Future entries (Konduto, Legiti, Sift, Cybersource) will follow the same analyze → decide → feedback shape.

Tools (18)

ToolPurpose
send_order_for_analysisSubmit an order to ClearSale for fraud analysis.
get_order_analysisRetrieve the current analysis state of an order previously sent to ClearSale.
update_order_statusNotify ClearSale of the merchant's final decision on an order (APROVADO / CANCELADO / DEVOLVIDO).
list_ordersList orders submitted to ClearSale with optional filters.
create_chargeback_notificationReport a confirmed chargeback back to ClearSale.
get_order_scoreFetch only the fraud score (numeric 0-100) for an order.
create_device_fingerprint_sessionStart a device fingerprint session.
get_device_fingerprintRetrieve captured device characteristics for a fingerprint session (OS, browser, timezone, canvas/WebGL has...
resolve_manual_reviewManually resolve an order currently in EM_ANALISE by approving or declining it.
get_score_by_documentLook up the risk score and historical signals associated with a Brazilian document (CPF or CNPJ).
get_score_by_contactLook up the risk score for a contact identifier (email or phone).
validate_documentKYC: validate a CPF or CNPJ against Receita Federal.
validate_addressKYC: validate a Brazilian postal address against the Correios database.
track_behavior_eventLog a behavior signal (page view, login, signup, custom event) tied to a fingerprint session.
issue_challengeIssue an authentication challenge (OTP via SMS/email or KBA question) to a buyer.
validate_challenge_responseVerify a buyer's response to a challenge issued via issue_challenge.
create_caseOpen a fraud investigation case (e.g.
update_caseUpdate an existing fraud investigation case — change status, add notes, reassign, or attach more orders.

Install

bash
npm install @codespar/mcp-clearsale@alpha

Environment

bash
CLEARSALE_API_KEY="..."    # Bearer token issued by ClearSaleCLEARSALE_BASE_URL="..."   # Optional. Defaults to https://api.clearsale.com.br. Override per contract-issued staging URL.

Authentication

Server-side Bearer token:

Authorization: Bearer <CLEARSALE_API_KEY>

ClearSale issues the token via the developer portal or through your commercial contract. There is no public sandbox — staging URLs are provisioned per contract; override CLEARSALE_BASE_URL to point at it.

Typical flow

  1. On page load, the merchant calls create_device_fingerprint_session and embeds ClearSale's browser JS using the returned session_token.
  2. At checkout, the merchant calls send_order_for_analysis with the same session_id plus full order, payment, items, and billing/shipping data.
  3. The response carries a decision: APROVADO (ship it), REPROVADO (block), or EM_ANALISE (poll get_order_analysis or wait for a webhook).
  4. Once the order lifecycle completes, call update_order_status with the final merchant decision — this is required for ongoing model quality.
  5. If a chargeback arrives later, call create_chargeback_notification so ClearSale can tune its model.

Run

bash
# stdio (default — for Claude Desktop, Cursor, etc)npx @codespar/mcp-clearsale
# HTTP (for server-to-server testing)MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-clearsale

Category

fraud — first server in this CodeSpar category. Fraud servers share a common shape (analyze → decide → feedback) distinct from payments, which makes cross-provider swaps (ClearSale ↔ Konduto ↔ Legiti) more straightforward than cross-acquirer swaps.

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

来源:packages/fraud/clearsale/README.md,提交 d0a519a

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.0-alpha.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分