Skip to main content
SI

Sift

v0.2.0-alpha.2API Keyalpha

Detección de fraude global basada en ML — eventos + scores + decisiones + feedback de labels. Alpha en npm — paths verificados contra el SDK SiftScience/sift-ruby.

20 herramientas3 env vars🌐 GLOBALalpha — validación pendiente

Qué puede hacer tu agente

Sift le da a tu agente 20 tools que llama directo — elegí las que necesite, en Claude, Cursor o cualquier 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.
Ejemplo de llamada
// 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

Agregá esta entrada a tu claude_desktop_config.json (o a la config de cualquier cliente compatible con 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>"
      }
    }
  }
}

Después de reiniciar, tu agente puede llamar cualquiera de las 20 herramientas de abajo — probá send_event primero.

Variables de entorno · 3

Necesarias para autenticar el server. Almacenadas cifradas al usar el hosting gestionado de CodeSpar.

SIFT_API_KEY
obligatoriosecret

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
obligatorio

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.

Herramientas disponibles · 20

Cada herramienta es independiente — tu agente carga solo lo que necesita para reducir contexto y tiempo de respuesta.

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 compatibles

MCP es un protocolo — cualquier framework que lo hable puede montar este server.

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

Preguntas frecuentes

Corré `npx -y @codespar/mcp-sift` y agregá el bloque de config de arriba a tu cliente MCP — Claude, Cursor, VS Code o cualquier cliente compatible con MCP. Sin build, sin SDK. ¿Preferís hosted? El tier gestionado de CodeSpar lo corre por vos, con la auth resuelta.
Sift — MCP server · 20 tools | CodeSpar