mcp-legiti — Claude Code MCP server: what it does, how to install
Connects Legiti fraud detection tools to an AI coding assistant for transaction risk analysis. The package is marked deprecated because its default host cannot be resolved via DNS.
claude mcp add --env LEGITI_API_KEY=<LEGITI_API_KEY> --env LEGITI_BASE_URL=<LEGITI_BASE_URL> --transport stdio legiti -- npx -y @codespar/mcp-legitiWhat mcp-legiti does
This MCP server exposes 18 tools for interacting with Legiti, a Brazilian risk scoring engine built for ticketing platforms and retail. It submits purchase payloads for immediate synchronous evaluation, returning verdicts like approve, reject, or manual. It also logs user actions, including login attempts, account profile edits, and ticket viewing events.
Authentication relies on a JWT bearer token supplied via LEGITI_API_KEY. Legiti provides separate keys for sandbox testing and production environments to prevent test events from degrading live predictive scoring. Synchronous evaluation requests can take up to 20 seconds.
The package is deprecated because its built-in endpoint collection-prod.inspcdn.net fails DNS resolution. The server will not reach any backend service unless a valid alternative URL is specified in LEGITI_BASE_URL.
What it helps with
- evaluate order fraud risk synchronously before fulfillment
- report confirmed chargebacks back to the scoring engine
- record authentication and credential reset events to spot account takeovers
- track event and ticket sales lifecycle changes
Example prompts for the agent
- Check risk for this order via evaluate_order with the customer CPF and card payload
- Report a confirmed chargeback for this purchase using mark_order_fraudulent
- Log a failed authentication attempt using track_login
How to install mcp-legiti
Platform CLI
claude mcp add --env LEGITI_API_KEY=<LEGITI_API_KEY> --env LEGITI_BASE_URL=<LEGITI_BASE_URL> --transport stdio legiti -- npx -y @codespar/mcp-legitiReplace <…> with your own values
Platform CLI
codex mcp add legiti --env LEGITI_API_KEY=<LEGITI_API_KEY> --env LEGITI_BASE_URL=<LEGITI_BASE_URL> -- npx -y @codespar/mcp-legitiReplace <…> with your own values
Config file
{
"mcpServers": {
"legiti": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-legiti"
],
"env": {
"LEGITI_API_KEY": "<LEGITI_API_KEY>",
"LEGITI_BASE_URL": "<LEGITI_BASE_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"legiti": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-legiti"
],
"env": {
"LEGITI_API_KEY": "<LEGITI_API_KEY>",
"LEGITI_BASE_URL": "<LEGITI_BASE_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e LEGITI_API_KEY=<LEGITI_API_KEY> -e LEGITI_BASE_URL=<LEGITI_BASE_URL> legiti npx -y @codespar/mcp-legitiReplace <…> 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-legiti
How do I install mcp-legiti in Claude Code?
Run claude mcp add --env LEGITI_API_KEY=<LEGITI_API_KEY> --env LEGITI_BASE_URL=<LEGITI_BASE_URL> --transport stdio legiti -- npx -y @codespar/mcp-legiti. Replace the placeholders with your API token and an active endpoint URL.
What does mcp-legiti do?
It connects AI tools to Legiti's fraud analysis API with 18 tools to score transactions, log account security events, and record dispute resolutions.
Why is this server deprecated?
Its default destination host collection-prod.inspcdn.net does not resolve via public DNS. It only functions if you configure a reachable endpoint using LEGITI_BASE_URL.