mcpField
M
mcp-legiti

mcp-legiti

Local
github.com/codesparSecurity275Updated 4w ago

About mcp-legiti

mcp-legiti is an MCP server for Legiti, a Brazilian fraud prevention service aimed at ticketing and mid-size retail. The package is deprecated because its default host does not resolve in DNS, so no tool currently reaches a service. A working endpoint can be set through LEGITI_BASE_URL.

Key features

  1. 01Order, sale and account event tracking tools
  2. 02Synchronous order fraud evaluation
  3. 03Chargeback outcome reporting back to provider
  4. 04Endpoint configuration through LEGITI_BASE_URL

Use cases

  1. 01Evaluating fraud risk for ticketing checkout orders
  2. 02Reporting confirmed chargebacks to improve decisions
  3. 03Running integration tests against a user-provided endpoint

MCP support

The server exposes 18 fraud prevention tools to MCP clients, covering order evaluation, event tracking and decision lookup. With the default endpoint unavailable, none of these tools can currently complete a request.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-legiti": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-legiti"
],
"env": {
"LEGITI_API_KEY": "<LEGITI_API_KEY>",
"LEGITI_BASE_URL": "<LEGITI_BASE_URL>"
}
}
}
}
Run commandnpx -y @codespar/mcp-legiti
Environment variables to set
LEGITI_API_KEYSecretLegiti API key (JWT-format bearer token). Use the sandbox key while testing — Legiti trains its ML models on every request, so test data hitting a production key pollutes the model.
LEGITI_BASE_URLLegiti API base URL. Defaults to https://collection-prod.inspcdn.net. Legiti issues customer-specific base URLs — override per contract.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-legiti0.2.0-alpha.4

Tools

18

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
ipstringNoBuyer's IP at order time (IPv4 or IPv6)
sale_idstringYesMerchant-side sale/order id (must be unique and stable — used to correlate future status updates and chargebacks)
account_idstringYesId of the account attempting the purchase
holder_cpfstringYesCard holder's CPF. Dots and dashes are tolerated but not required.
sale_itemsarrayNoLine items (e.g. tickets). Each item typically has { item_id, event_date_id, unit_price, quantity }.
event_date_idstringNoTicketing-specific: the primary event datetime id associated with the sale. If a sale has multiple tickets across event dates, pass the main one.
sale_datetimenumberYesUnix timestamp (seconds) for when the sale occurred
billing_addressobjectNoBilling address: { street, number, city, state, zip_code, country }
sale_total_valuenumberYesTotal monetary value of the sale in BRL (major units, e.g. 199.90)
shipping_addressobjectNoShipping address: same schema as billing_address
request_evaluationbooleanNoIf true, Legiti returns a synchronous decision in the response. Default true.
first_six_digits_ccstringYesFirst six digits of the credit card (BIN). Never pass the full PAN.
last_four_digits_ccstringYesLast four digits of the credit card

Details

From the project README

@codespar/mcp-legiti

Deprecated: no live endpoint. Measured on 2026-09-27 against two public DNS resolvers (8.8.8.8 and 1.1.1.1): collection-prod.inspcdn.net, the host this server calls, does not resolve in DNS. No tool in this server reaches a service. The package is deprecated on npm and stays in this repository for reference only. If you have a working endpoint, point the server at it with LEGITI_BASE_URL. To bring the package back, open an issue in mcp-dev-latam with the provider's documented base URL.

MCP server for Legiti — Brazilian fraud prevention, ticketing-native with a simple synchronous evaluation API.

Fourth entry in the CodeSpar fraud category, after @codespar/mcp-clearsale, @codespar/mcp-konduto, and @codespar/mcp-sift. Legiti (formerly Inspetor, São Paulo) occupies the mid-size BR tier: smaller public footprint than ClearSale, more vertical depth than Konduto for ticketing / events, and a simpler API surface than Sift.

Positioning

StrengthTypical fit
ClearSaleBR pioneer (2001), large chargeback historyDefault for large BR retail
KondutoBR, API-first, behavioral device intelDigital-native BR ecommerce
Legiti (this)BR, ticketing-native, sync evaluationBR ticketing marketplaces, mid-size retail
SiftGlobal, multi-abuse-type ML, workflowsInternational enterprise

BR merchants frequently bundle 2-3 of these for best-of-breed scoring — Legiti for its ticketing-specific signals, ClearSale or Konduto for the generalist fraud layer, Sift for cross-border flows.

Tools (18)

ToolPurpose
evaluate_orderSubmit an order to Legiti for real-time fraud evaluation via the v2 order endpoint.
update_orderNotify Legiti of a status change on an existing order (e.g.
mark_order_fraudulentReport a confirmed chargeback / fraud outcome back to Legiti.
evaluate_saleLegacy single-shot sale evaluation via POST /evaluation.
track_accountNotify Legiti of an account lifecycle event (created / updated / deleted).
track_eventNotify Legiti of an Event (concert, show, match, session) lifecycle change.
track_saleNotify Legiti of a Sale state change (created / updated).
track_authNotify Legiti of an authentication or password event (login attempt, logout, password recovery request, pas...
track_loginNotify Legiti of a login attempt (successful or failed).
track_logoutNotify Legiti of a logout event.
track_signupNotify Legiti of a new account creation.
track_account_updateNotify Legiti of an account profile change (email, phone, CPF, address).
track_password_recoveryNotify Legiti of a password recovery request (the 'forgot password' click).
track_event_viewNotify Legiti that a user viewed an event/show page.
track_paymentNotify Legiti of a payment-method-level event (authorization attempt, capture, refund, void).
get_decisionFetch the latest Legiti decision for an order.
update_decision_statusManually override Legiti's decision for an order — typically used to accept or decline a sale that landed i...
mark_dispute_resolutionReport the outcome of a chargeback dispute back to Legiti — i.e.

Install

npm install @codespar/mcp-legiti@alpha

Environment

LEGITI_API_KEY="eyJhbGciOi..."   # JWT bearer token; required
LEGITI_BASE_URL="..."             # optional; defaults to https://collection-prod.inspcdn.net

Authentication

Bearer token (JWT-format):

Authorization: Bearer <LEGITI_API_KEY>

Legiti issues separate sandbox and production keys. The sandbox key tags every request as test data so it does NOT train the ML model. Always develop and run integration tests with the sandbox key — hitting production with test data pollutes the model.

Decision values

evaluate_order and evaluate_sale return one of three decisions:

  • approve — ship it
  • reject — block the sale
  • manual — route to manual review

Evaluation is synchronous; the response may take up to ~20 seconds.

Typical flow (ticketing)

  1. At signup / login, call track_account (create/update) and track_auth (login/logout, password_recovery, password_reset). Every auth attempt — successful or failed — is valuable signal for account-takeover detection.
  2. When a new event (concert, show, match) is published on the platform, call track_event (create). Update on price/capacity/date changes.
  3. At checkout, call evaluate_order with the sale, account, payment, CPF, and the primary event_date_id. Act on the returned decision: approve → ship, reject → block, manual → human review.
  4. As the order progresses (paid, shipped, delivered, cancelled, refunded), call update_order.
  5. When a chargeback is confirmed by the issuer, call mark_order_fraudulent. This is Legiti's primary ML feedback channel — unreported chargebacks degrade future decision quality for similar buyers.

Typical flow (non-ticketing ecommerce)

Skip track_event. The event_date_id fields become optional in evaluate_order — Legiti will still evaluate on account + sale + payment signal, though ticketing-vertical features will be unused.

Alpha note

Shipped as 0.1.0-alpha.1. Legiti's public documentation is tighter than ClearSale's or Konduto's:

  • Documented in open-source github.com/legiti/docs-backend: POST /evaluation, plus the Collection API (account, event, sale, transfer, auth, password) shape and the Authorization: Bearer scheme.
  • Documented on docs.legiti.com integration guides: the v2 order family (POST /v2/order, PUT /v2/order, POST /v2/order/mark_fraudulent).
  • Dropped from the original category spec: create_rule / list_rules / update_rule / delete_rule — no public custom-rules surface exists on Legiti. If a customer contract exposes one, promote to 0.2.0.

Promote to 0.1.0 once the v2 order payload schema is confirmed in production.

Run

# stdio (default — for Claude Desktop, Cursor, etc)
npx @codespar/mcp-legiti

# HTTP (for server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-legiti

Category

fraud — fourth server in this CodeSpar category alongside ClearSale, Konduto, and Sift. Fraud servers share a common shape (analyze → decide → feedback) distinct from payments, which makes cross-provider swaps (ClearSale ↔ Konduto ↔ Legiti) more straightforward than cross-acquirer swaps.

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.