mcp-sift — Claude Code MCP server: Sift fraud scoring
An MCP server that wires your agent into Sift, so events, ML scores and fraud decisions happen from the chat.
claude mcp add --env SIFT_API_KEY=<SIFT_API_KEY> --env SIFT_ACCOUNT_ID=<SIFT_ACCOUNT_ID> --env SIFT_BASE_URL=<SIFT_BASE_URL> --transport stdio sift -- npx -y @codespar/mcp-siftWhat mcp-sift does
Twenty tools cover the three Sift APIs. The Events API takes every signal you care about — signup, login, order, chargeback — as a $-prefixed event. The Score API returns the latest ML score for a user as a float between 0 and 1, split by abuse type: payment_abuse, account_abuse, content_abuse, promotion_abuse. Decisions API v3 turns those scores into workflow outcomes such as block_user_payment_abuse or approve_order_payment_abuse.
Common events have their own wrappers: send_login, send_logout, send_chargeback, send_content_status, link_session_to_user, plus send_custom_event for merchant-defined types. You can force a rescore with rescore_user, and handle manual review by labelling a user or clearing the label. Decisions apply to users, orders, sessions and content items; a separate call reads the status of a workflow run.
Two variables are required: SIFT_API_KEY and SIFT_ACCOUNT_ID, the latter for every Decisions API v3 call. SIFT_BASE_URL is optional and falls back to https://api.sift.com. Pass the raw key — the server injects $api_key into the Events API body itself and base64-encodes it for HTTP Basic on the Score and Decisions calls, with an empty password. The package ships as 0.1.0-alpha.1, and its endpoint paths were checked against Sift's official Ruby SDK.
What it helps with
- push a signup or login signal into Sift
- read a user's ML score for one abuse type
- apply a workflow decision to an order or session
- label a user as fraud after manual review
- report a confirmed chargeback as an event
Example prompts for the agent
- Send a
$loginevent to Sift for the user from the last test run - Show me the current
payment_abusescore for this user - Apply the
block_user_payment_abusedecision to this order
How to install mcp-sift
Platform CLI
claude mcp add --env SIFT_API_KEY=<SIFT_API_KEY> --env SIFT_ACCOUNT_ID=<SIFT_ACCOUNT_ID> --env SIFT_BASE_URL=<SIFT_BASE_URL> --transport stdio sift -- npx -y @codespar/mcp-siftReplace <…> with your own values
Platform CLI
codex mcp add sift --env SIFT_API_KEY=<SIFT_API_KEY> --env SIFT_ACCOUNT_ID=<SIFT_ACCOUNT_ID> --env SIFT_BASE_URL=<SIFT_BASE_URL> -- npx -y @codespar/mcp-siftReplace <…> with your own values
Config file
{
"mcpServers": {
"sift": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-sift"
],
"env": {
"SIFT_API_KEY": "<SIFT_API_KEY>",
"SIFT_ACCOUNT_ID": "<SIFT_ACCOUNT_ID>",
"SIFT_BASE_URL": "<SIFT_BASE_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"sift": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-sift"
],
"env": {
"SIFT_API_KEY": "<SIFT_API_KEY>",
"SIFT_ACCOUNT_ID": "<SIFT_ACCOUNT_ID>",
"SIFT_BASE_URL": "<SIFT_BASE_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SIFT_API_KEY=<SIFT_API_KEY> -e SIFT_ACCOUNT_ID=<SIFT_ACCOUNT_ID> -e SIFT_BASE_URL=<SIFT_BASE_URL> sift npx -y @codespar/mcp-siftReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-sift
How do I install mcp-sift in Claude Code?
Run claude mcp add mcp-sift -e SIFT_API_KEY=<SIFT_API_KEY> -e SIFT_ACCOUNT_ID=<SIFT_ACCOUNT_ID> -- npx -y @codespar/mcp-sift. The other form adds SIFT_BASE_URL and an explicit transport: `claude mcp add --env SIFT_API_KEY=<SIFT_API_KEY> --env SIFT_ACCOUNT_ID=<SIFT_ACCOUNT_ID> --env SIFT_BASE_URL=<SIFT_BASE_URL> --transport stdio sift -- npx -y @codespar/mcp-sift`.
What does mcp-sift do?
It connects your agent to the Sift fraud platform: sending events, fetching scores and applying workflow decisions. The server exposes 20 tools in total.
What do I need before running mcp-sift?
SIFT_API_KEY and SIFT_ACCOUNT_ID; without the account ID no Decisions API v3 call goes through. SIFT_BASE_URL is optional and defaults to https://api.sift.com.