Skip to main content
SI

Sift

v0.2.0-alpha.2API Keyalpha

Detecção de fraude global baseada em ML — eventos + scores + decisões + feedback de labels. Alpha no npm — paths verificados contra o SDK SiftScience/sift-ruby.

20 ferramentas3 env vars🌐 GLOBALalpha — validação pendente

O que seu agente faz

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

  • send_eventSend a fraud signal to Sift's Events API (POST /v205/events). The `type` parameter selects the event kind ($create_order, $transaction, $login, $create_account, $update_account, $chargeback, $order_status, etc). Additional fields ($user_id, $session_id, $order_id, custom fields) are passed via `fields` and merged into the body. Use `return_score=true` to get a synchronous score in the response.
  • get_user_scoreFetch the latest Sift score(s) for a user (GET /v205/users/{user_id}/score). Does NOT trigger a rescore — it returns whatever score was last computed. The score is a float in [0, 1]; higher means more fraud-like. Optionally filter by abuse_types.
  • rescore_userForce Sift to recompute a user's score right now (POST /v205/users/{user_id}/score). Use when you have externally-observed signal that should invalidate the last score (e.g. a manual decision) but have not sent a new event.
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_event", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-sift@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": {
    "sift": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-sift@alpha"
      ],
      "env": {
        "SIFT_API_KEY": "<your_sift_api_key>",
        "SIFT_ACCOUNT_ID": "<your_sift_account_id>"
      }
    }
  }
}

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

Variáveis de ambiente · 3

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

SIFT_API_KEY
obrigatóriosecret

Sift API key. Used in the Events API request body ($api_key) and as the HTTP Basic auth username (empty password) for Score + Decisions APIs.

SIFT_ACCOUNT_ID
obrigatório

Sift Account ID. Required for all Decisions API v3 endpoints (path segment /v3/accounts/{account_id}/...).

SIFT_BASE_URL
opcional

Sift API base URL. Defaults to https://api.sift.com.

Ferramentas disponíveis · 20

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

WRITEsend_event
Send a fraud signal to Sift's Events API (POST /v205/events). The `type` parameter selects the event kind ($create_order, $transaction, $login, $create_account, $update_account, $chargeback, $order_status, etc). Additional fields ($user_id, $session_id, $order_id, custom fields) are passed via `fields` and merged into the body. Use `return_score=true` to get a synchronous score in the response.
READget_user_score
Fetch the latest Sift score(s) for a user (GET /v205/users/{user_id}/score). Does NOT trigger a rescore — it returns whatever score was last computed. The score is a float in [0, 1]; higher means more fraud-like. Optionally filter by abuse_types.
READrescore_user
Force Sift to recompute a user's score right now (POST /v205/users/{user_id}/score). Use when you have externally-observed signal that should invalidate the last score (e.g. a manual decision) but have not sent a new event.
READlabel_user
Label a user as fraud or not-fraud via the legacy Labels API (POST /v205/users/{user_id}/labels). Labels are the classic supervised-learning feedback channel for Sift's ML model. Note: most new integrations use the Decisions API (apply_decision_to_user) instead — labels are kept for backward compatibility. Still supported for ongoing model feedback.
READunlabel_user
Remove any existing label on a user (DELETE /v205/users/{user_id}/labels). Optionally scope by abuse_type.
READapply_decision_to_user
Apply a workflow Decision to a user (POST /v3/accounts/{account_id}/users/{user_id}/decisions). Decisions are the modern replacement for Labels — they both classify the entity for Sift's ML and trigger any configured side effects (e.g. a Block decision on a $payment_abuse user will cause that user's future $transaction events to be blocked). Requires SIFT_ACCOUNT_ID.
READapply_decision_to_order
Apply a workflow Decision to a specific order (POST /v3/accounts/{account_id}/users/{user_id}/orders/{order_id}/decisions). Order-level decisions target a single transaction rather than the whole user (e.g. 'approve_order_payment_abuse' on a manually-reviewed high-value order). Requires SIFT_ACCOUNT_ID.
READget_user_decisions
Fetch the decisions currently applied to a user (GET /v3/accounts/{account_id}/users/{user_id}/decisions). Returns the active decision per abuse type. Requires SIFT_ACCOUNT_ID.

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-sift` 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.
Sift — MCP server · 20 tools | CodeSpar