mcp-clearsale — Claude Code MCP server: what it does, how to install
Connects your coding agent to ClearSale for fraud screening and Brazilian buyer verification. Handy for online stores selling in Brazil.
claude mcp add --env CLEARSALE_API_KEY=<CLEARSALE_API_KEY> --env CLEARSALE_BASE_URL=<CLEARSALE_BASE_URL> --transport stdio clearsale -- npx -y @codespar/mcp-clearsaleWhat mcp-clearsale does
The server exposes 18 tools to manage ecommerce risk workflows directly from your agent. It lets the model submit shopping carts for evaluation, fetch risk scores on a 0 to 100 scale, and return merchant resolutions like order cancellations or approvals. It also handles Brazilian KYC, including checking CPFs and CNPJs with Receita Federal or verifying delivery addresses against Correios.
Integration needs a token passed in CLEARSALE_API_KEY. Staging endpoints go into CLEARSALE_BASE_URL. You cannot test this without a formal contract because ClearSale provides no public sandbox. The package runs over stdio by default, but you can switch to HTTP using MCP_HTTP=true and MCP_PORT=3000.
What it helps with
- evaluate transaction fraud risk before shipping goods
- verify CPF or CNPJ identity numbers via official Brazilian registries
- send dispute notices and chargebacks back to the risk engine
- trigger SMS or email authentication challenges for suspicious shoppers
Example prompts for the agent
- Submit order 4921 to ClearSale and return the fraud score
- Verify this shipping address against Correios records
- Report a confirmed chargeback for transaction 8812
How to install mcp-clearsale
Platform CLI
claude mcp add --env CLEARSALE_API_KEY=<CLEARSALE_API_KEY> --env CLEARSALE_BASE_URL=<CLEARSALE_BASE_URL> --transport stdio clearsale -- npx -y @codespar/mcp-clearsaleReplace <…> with your own values
Platform CLI
codex mcp add clearsale --env CLEARSALE_API_KEY=<CLEARSALE_API_KEY> --env CLEARSALE_BASE_URL=<CLEARSALE_BASE_URL> -- npx -y @codespar/mcp-clearsaleReplace <…> with your own values
Config file
{
"mcpServers": {
"clearsale": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-clearsale"
],
"env": {
"CLEARSALE_API_KEY": "<CLEARSALE_API_KEY>",
"CLEARSALE_BASE_URL": "<CLEARSALE_BASE_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"clearsale": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-clearsale"
],
"env": {
"CLEARSALE_API_KEY": "<CLEARSALE_API_KEY>",
"CLEARSALE_BASE_URL": "<CLEARSALE_BASE_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e CLEARSALE_API_KEY=<CLEARSALE_API_KEY> -e CLEARSALE_BASE_URL=<CLEARSALE_BASE_URL> clearsale npx -y @codespar/mcp-clearsaleReplace <…> 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-clearsale
How do I install mcp-clearsale in Claude Code?
Run claude mcp add mcp-clearsale -e CLEARSALE_API_KEY=<CLEARSALE_API_KEY> -- npx -y @codespar/mcp-clearsale. For custom endpoints, supply both variables: `claude mcp add --env CLEARSALE_API_KEY=<CLEARSALE_API_KEY> --env CLEARSALE_BASE_URL=<CLEARSALE_BASE_URL> --transport stdio clearsale -- npx -y @codespar/mcp-clearsale`.
What does mcp-clearsale do?
It integrates ClearSale antifraud capabilities into AI coding assistants. The server lets agents analyze order risk, validate Brazilian identification documents, and update merchant decisions.
Can I test mcp-clearsale without a paid account?
No. ClearSale requires an account or active merchant contract to issue credentials, and staging environments are assigned individually rather than open to the public.