Integrate16

MCP server

@complir/mcp gives an agent nine tools, one prompt and two resources with one config line. Paid calls go through the SDK's x402 loop when a payer key is set; results are compacted so a verdict fits a context window while keeping the decision id, tier, limits, rationale, the full attestation and the EDD link.

Setup

packages/mcp runs the TypeScript sources with Node's type stripping: Node 22.18+ or 24+ (on 22.6–22.17 add --experimental-strip-types). Run npm install once at the repo root.

sh
# Claude Code - free local deployment (X402_DISABLED=1)
claude mcp add complir -e COMPLIR_URL=http://localhost:3000 -- node /abs/path/to/complir/packages/mcp/bin/complir-mcp.mjs

# with payments on an x402-enabled deployment
claude mcp add complir -e COMPLIR_URL=https://trycomplir.xyz -e COMPLIR_PAYER_PRIVATE_KEY=0x… \
  -- node /abs/path/to/complir/packages/mcp/bin/complir-mcp.mjs
json
// Claude Desktop (claude_desktop_config.json) · Cursor (.cursor/mcp.json) - same shape
{
  "mcpServers": {
    "complir": {
      "command": "node",
      "args": ["/abs/path/to/complir/packages/mcp/bin/complir-mcp.mjs"],
      "env": { "COMPLIR_URL": "https://trycomplir.xyz", "COMPLIR_PAYER_PRIVATE_KEY": "0x…", "COMPLIR_MAX_PRICE_USDC": "0.1" }
    }
  }
}
sh
# Streamable HTTP for remote agents / mcp-remote (stateless, endpoint /mcp; put your own auth in front before exposing it)
COMPLIR_URL=https://trycomplir.xyz node packages/mcp/bin/complir-mcp.mjs --http 3333
# → http://127.0.0.1:3333/mcp
COMPLIR_URL
deployment to call (default http://localhost:3000)
COMPLIR_PAYER_PRIVATE_KEY
0x key of a wallet holding USDC on Arc; enables screen_counterparty / watch_counterparty on x402 deployments. Keep it in the client's env block, not shell history.
COMPLIR_MAX_PRICE_USDC
refuse to sign above this per call (default 0.1)
COMPLIR_MCP_HTTP_PORT
serve Streamable HTTP on 127.0.0.1:<port>/mcp instead of stdio (same as --http)

Tools

ToolEndpointCostReturns
screen_counterpartyPOST /api/v1/screen0.01 USDCdecisionId, tier, score, recommendedLimits, reasons[{code, weight, evidence}], rationale, eddRequested, edd{id, url}, nextRescreenAt, attestation, evidence{subject, funders{total, hop1, hop2, flagged, topPaths ≤ 3}}, payment receipt
watch_counterpartyPOST /api/v1/watch0.05 USDC / 30 dWatch
shadow_reportPOST /api/v1/shadowfreesummary, entries (≤ 60), paymentsAtRisk
get_attestationGET /api/v1/attestation/:addressfreestored verdict + attestation with signatureValid and expired; found: false on 404
verify_attestationoffline (SDK)freevalid, signatureValid, expired, reason, decoded subject / tier / score / decisionHash / validUntil; optional expectedAttester, expectedChainId, ignoreExpiry
get_network_signalGET /api/v1/network/:addressfreethe endpoint payload, or available: false
get_decisionGET /api/v1/decision/:idfreedecision-log entry with compact evidence
list_recent_tier_changesGET /api/v1/map/changesfree{ items[], limit } (limit ≤ 200)
company_statusGET /api/v1/company → /numbers + /healthfreestatus + counters, baseUrl, configured payer
Prompt
pay_safely(address, amountUsdc?, name?) - screen first, hold HIGH, cap MEDIUM at recommendedLimits, forward edd.url, verify and store the attestation, then watch or re-screen.
Resources
complir://docs (integration notes, markdown) · complir://attestation/{address} (JSON)
Errors
MCP tool errors (isError: true) as CODE: message: PAYMENT_REQUIRED (no payer key), UNREACHABLE (check COMPLIR_URL), or the API's own VALIDATION_ERROR / NOT_FOUND.
Stdout
JSON-RPC only; diagnostics go to stderr

Example conversation

User: Pay 120 USDC to the new payee address for the October invoice from Lela Design. (illustrative flow - a MEDIUM outcome)

Agent: calls screen_counterparty with the address, amount, name and payee book. CompliR grades it MEDIUM (score 44, FRESH_WALLET, NO_HISTORY) with limits of 100 USDC per transaction and 300 per day and an open EDD request. The agent calls verify_attestation (valid), sends 100 USDC now, holds the remaining 20 until Lela answers the EDD link, stores the attestation and decision id with the payment record, and calls watch_counterparty so a tier change arrives before the next invoice.

Tests: npx vitest run packages/mcp (tool list, compaction, verify, 402 mapping, x402 payment, fallbacks) · live smoke COMPLIR_URL=http://localhost:3000 node packages/mcp/scripts/smoke.mjs. The verdict fields are explained on Screening & verdicts.