Skip to main content
CL

ClearSale

v0.2.0-alpha.2API Keyalpha

Pioneira brasileira em prevenção a fraudes (fundada em 2001). Score de risco de pedido, device fingerprinting, feedback de chargeback. Release alpha no npm — endpoints pendentes de validação contra o portal de desenvolvedor da ClearSale fechado por contrato.

18 ferramentas2 env vars🇧🇷 Brasilalpha — validação pendente

O que seu agente faz

O ClearSale dá ao seu agente 18 tools que ele chama direto — escolha as que precisar, no Claude, Cursor ou qualquer cliente MCP.

  • send_order_for_analysisSubmit an order to ClearSale for fraud analysis. Returns a score (0-100) and a decision (APROVADO / REPROVADO / EM_ANALISE). Include as much signal as possible — billing + shipping, IP, device, items, and payment — to improve the decision.
  • get_order_analysisRetrieve the current analysis state of an order previously sent to ClearSale. Useful when the initial response was EM_ANALISE and the decision is made asynchronously.
  • update_order_statusNotify ClearSale of the merchant's final decision on an order (APROVADO / CANCELADO / DEVOLVIDO). This feeds the ML model and is required for accurate future decisions on the same buyer.
Exemplo de chamada
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("send_order_for_analysis", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-clearsale@alpha

Quickstart

Adicione esta entrada ao seu claude_desktop_config.json (ou a config de qualquer cliente compatível com MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "clearsale": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-clearsale@alpha"
      ],
      "env": {
        "CLEARSALE_API_KEY": "<your_clearsale_api_key>"
      }
    }
  }
}

Depois de reiniciar, seu agente pode chamar qualquer uma das 18 ferramentas abaixo — teste send_order_for_analysis primeiro.

Variáveis de ambiente · 2

Necessárias pra autenticar o server. Armazenadas criptografadas ao usar a hospedagem gerenciada da CodeSpar.

CLEARSALE_API_KEY
obrigatóriosecret

ClearSale API key / bearer token used in the Authorization header

CLEARSALE_BASE_URL
opcional

ClearSale API base URL. Defaults to https://api.clearsale.com.br (prod). Override per contract-issued staging URL.

Ferramentas disponíveis · 18

Cada ferramenta é independente — seu agente carrega só o que precisa pra reduzir contexto e tempo de resposta.

WRITEsend_order_for_analysis
Submit an order to ClearSale for fraud analysis. Returns a score (0-100) and a decision (APROVADO / REPROVADO / EM_ANALISE). Include as much signal as possible — billing + shipping, IP, device, items, and payment — to improve the decision.
READget_order_analysis
Retrieve the current analysis state of an order previously sent to ClearSale. Useful when the initial response was EM_ANALISE and the decision is made asynchronously.
WRITEupdate_order_status
Notify ClearSale of the merchant's final decision on an order (APROVADO / CANCELADO / DEVOLVIDO). This feeds the ML model and is required for accurate future decisions on the same buyer.
READlist_orders
List orders submitted to ClearSale with optional filters. Use for dashboards, reconciliation, and reviewing pending manual decisions.
WRITEcreate_chargeback_notification
Report a confirmed chargeback back to ClearSale. Critical for model tuning: unreported chargebacks degrade future decision quality for similar buyers.
READget_order_score
Fetch only the fraud score (numeric 0-100) for an order. Lighter than get_order_analysis when the full decision envelope isn't needed.
WRITEcreate_device_fingerprint_session
Start a device fingerprint session. Returns a session_token the client embeds via ClearSale's browser JS SDK to capture device characteristics. Pass the same session_id into send_order_for_analysis to link the device to the order.
READget_device_fingerprint
Retrieve captured device characteristics for a fingerprint session (OS, browser, timezone, canvas/WebGL hash, suspected emulator, etc).

Frameworks compatíveis

MCP é um protocolo — qualquer framework que o fale pode montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Qualquer cliente MCPProtocolo

Perguntas frequentes

Rode `npx -y @codespar/mcp-clearsale` e adicione o bloco de config acima ao seu cliente MCP — Claude, Cursor, VS Code ou qualquer cliente compatível com MCP. Sem build, sem SDK. Prefere hospedado? O tier gerenciado da CodeSpar roda pra você, com a auth resolvida.
ClearSale — MCP server · 18 tools | CodeSpar