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.
# 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// 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" }
}
}
}# 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
| Tool | Endpoint | Cost | Returns |
|---|---|---|---|
screen_counterparty | POST /api/v1/screen | 0.01 USDC | decisionId, 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_counterparty | POST /api/v1/watch | 0.05 USDC / 30 d | Watch |
shadow_report | POST /api/v1/shadow | free | summary, entries (≤ 60), paymentsAtRisk |
get_attestation | GET /api/v1/attestation/:address | free | stored verdict + attestation with signatureValid and expired; found: false on 404 |
verify_attestation | offline (SDK) | free | valid, signatureValid, expired, reason, decoded subject / tier / score / decisionHash / validUntil; optional expectedAttester, expectedChainId, ignoreExpiry |
get_network_signal | GET /api/v1/network/:address | free | the endpoint payload, or available: false |
get_decision | GET /api/v1/decision/:id | free | decision-log entry with compact evidence |
list_recent_tier_changes | GET /api/v1/map/changes | free | { items[], limit } (limit ≤ 200) |
company_status | GET /api/v1/company → /numbers + /health | free | status + 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) asCODE: 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.