{"mcpVersion":"2025-06-18","name":"revclamp-mcp","title":"RevClamp B2B Revenue, Chargeback & EU VAT MCP Server","version":"1.18.0","description":"Stateless B2B revenue leakage auditing, Stripe 2025-03-31.basil ghost-usage detection, Visa Compelling Evidence 3.0 dispute staging (submit: false), EU/XI VIES VAT validation, Shopify Plus B2B Net-15/30/60 integer-cent reconciliation, and Stripe/Shopify/RevClamp webhook HMAC-SHA256 signature verification.","homepage":"https://revclamp.com/mcp","documentationUrl":"https://revclamp.com/docs/onboarding","repositoryUrl":"https://github.com/lhphong09t2/revclamp-mcp","glamaUrl":"https://glama.ai/mcp/servers/lhphong09t2/revclamp-mcp","transport":{"type":"streamable-http","endpoint":"https://api.revclamp.com/api/mcp","authentication":{"sandbox":"none (zero-key stateless sandbox supported)","workspace":"Authorization: Bearer rg_live_<workspace_key>"}},"tools":[{"name":"revclamp_audit_revenue_leakage","title":"Audit B2B Revenue Leakage & Dispute Readiness","description":"Run a deterministic 90-day B2B revenue leakage and chargeback readiness audit across Stripe subscriptions, AI/API usage telemetry events, and open disputes. Executes as a 100% read-only, stateless diagnostic with zero external Stripe mutations. Returns structuredContent containing ok, mode, statelessEphemeralAudit, tenantId, dunningGracePeriodDays, costPerEventCents, and audit (scannedCustomers, scannedEvents, ghostLeakEventsCount, affectedCustomersCount, estimatedBleedUsd, disputesEligibleForAutoEvidence). Use this tool for portfolio-wide multi-customer audits; use revclamp_evaluate_ghost_usage for single-customer entitlement checks or revclamp_stage_stripe_dispute_ce3 to build a single dispute's Visa CE 3.0 evidence bundle.","annotations":{"title":"Audit B2B Revenue Leakage & Dispute Readiness","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","properties":{"dunningGracePeriodDays":{"type":"integer","minimum":0,"maximum":14,"description":"Custom dunning grace window in integer days (valid range: 0 to 14, default: 3) allowed after latest_invoice_failed_at before flagging past_due subscriptions as unpaid ghost usage."},"costPerEventCents":{"type":"integer","minimum":1,"maximum":10000,"description":"Estimated marginal compute or API cost per leaked usage event in integer USD cents (valid range: 1 to 10000, default: 142 i.e. $1.42/event)."},"customers":{"type":"array","description":"Optional array of up to 50 Stripe customer snapshots (each with id like 'cus_123', optional email, subscriptions array or list object, and subscriptionsHasMore: false). Omit to run against workspace telemetry or deterministic sandbox fixtures."},"usageEvents":{"type":"array","description":"Optional array of up to 200 product/AI API usage telemetry events (each with stripe_customer_id or email, event_name, and occurredAtSec Unix timestamp in seconds)."},"disputes":{"type":"array","description":"Optional array of up to 50 Stripe dispute objects (each with id like 'du_123', customer, amount in cents, reason such as 'fraudulent', and status such as 'needs_response')."}},"additionalProperties":false}},{"name":"revclamp_evaluate_ghost_usage","title":"Evaluate Single-Customer Stripe Basil Ghost Usage","description":"Evaluate whether a specific customer's AI or API usage event constitutes unpaid ghost usage across multi-subscription Stripe 2025-03-31.basil state, enforcing fail-closed pagination (has_more must be explicitly false) and configurable 0-14 day dunning grace windows. Executes as a stateless, read-only entitlement evaluator with zero side effects. Returns structuredContent containing ok, mode, statelessEphemeralAudit, tenantId, and evaluation (isGhostLeak, isGhostUsage, reason). Use this tool for real-time per-customer entitlement gating; use revclamp_audit_revenue_leakage for batch multi-customer portfolio audits.","annotations":{"title":"Evaluate Single-Customer Stripe Basil Ghost Usage","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","required":["customerId","subscriptions"],"properties":{"customerId":{"type":"string","description":"Required Stripe customer identifier to evaluate (format example: 'cus_9s6XKzkNRiz8i3', max 64 chars)."},"subscriptions":{"description":"Required Stripe customer subscriptions payload: either a Stripe list object ({ data: [...], has_more: false }) or a raw array of up to 50 subscription objects containing id, status ('active', 'trialing', 'past_due', 'canceled', 'unpaid'), current_period_end, or items.data[].current_period_end in Unix seconds."},"subscriptionsHasMore":{"type":"boolean","description":"Pagination completeness flag (boolean). Must be explicitly set to false when passing a raw subscriptions array so RevClamp can verify no active subscription was truncated on a later page."},"dunningGracePeriodDays":{"type":"integer","minimum":0,"maximum":14,"description":"Dunning grace window in integer days (valid range: 0 to 14, default: 3) after latest_invoice_failed_at during which past_due subscriptions remain entitled."},"usageTimestampSec":{"type":"integer","description":"Optional Unix epoch timestamp in integer seconds (e.g. 1761264000) when the AI/API usage event occurred (defaults to current server Unix timestamp if omitted)."},"occurredAtSec":{"type":"integer","description":"Optional alias for usageTimestampSec: Unix epoch timestamp in integer seconds (e.g. 1761264000) when the usage event occurred (used when usageTimestampSec is omitted)."}},"additionalProperties":false}},{"name":"revclamp_stage_stripe_dispute_ce3","title":"Stage Visa CE 3.0 Stripe Dispute Evidence Draft","description":"Evaluate Visa Compelling Evidence 3.0 (CE 3.0) qualification across 120-to-365-day historical charges (requiring at least 2 settled, non-refunded, non-disputed prior transactions sharing IP address, device fingerprint, or billing email) and assemble a non-destructive Stripe dispute evidence draft with submit hardcoded to false. Executes as a pure read-only staging computation that never auto-submits to card networks. Returns structuredContent containing ok, mode, statelessEphemeralAudit, tenantId, submitForcedFalse, ce3Qualification, and drawer (including stripeUpdateParams with submit: false and merged access_activity_log). Use this tool for single-dispute CE 3.0 qualification and evidence staging; use revclamp_audit_revenue_leakage for portfolio-wide dispute readiness counts.","annotations":{"title":"Stage Visa CE 3.0 Stripe Dispute Evidence Draft","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","properties":{"disputeId":{"type":"string","description":"Stripe dispute identifier being staged (format example: 'du_1QxyzEnterpriseDispute01', default: 'du_mcp_staged_01', max 64 chars)."},"customerId":{"type":"string","description":"Stripe customer identifier associated with the disputed charge (format example: 'cus_enterprise_88', default: 'cus_mcp_enterprise_01', max 64 chars)."},"disputeReason":{"type":"string","description":"Stripe dispute reason code (e.g. 'fraudulent', 'unrecognized', 'subscription_canceled'; default: 'fraudulent'; Visa CE 3.0 applies to 'fraudulent' disputes)."},"existingUncategorizedText":{"type":"string","description":"Optional existing merchant evidence notes in Stripe evidence.uncategorized_text or access_activity_log (up to 2,000 chars) to preserve via append-only merge without overwriting."},"disputedTransaction":{"type":"object","description":"Optional disputed charge snapshot object containing id (e.g. 'ch_disputed_01'), occurredAtSec (Unix seconds), customer_id, email, ip_address, and device_id."},"priorTransactions":{"type":"array","description":"Optional array of up to 50 historical Stripe charge objects (each with id, status: 'succeeded', disputed: false, refunded: false, occurredAtSec 120-365 days prior to disputedTransaction, email, ip_address, and device_id)."},"usageEvents":{"type":"array","description":"Optional array of up to 200 customer product/API usage telemetry events (each with occurredAtSec Unix seconds, stripe_customer_id, and event_name) for append-only access_activity_log staging."}},"additionalProperties":false}},{"name":"revclamp_validate_eu_vat_vies","title":"Validate EU/XI B2B VAT ID & VIES Reverse-Charge State","description":"Normalize EU-27 and Northern Ireland (XI) B2B VAT identifiers (including mandatory Greece ISO-3166 GR to EL prefix normalization) and evaluate cross-border 0% VAT reverse-charge eligibility, VIES consultation evidence, or MS_UNAVAILABLE circuit-breaker fulfillment hold actions. Read-only and non-destructive; supports deterministic simulation modes ('VALID', 'INVALID', 'MS_UNAVAILABLE') or real-time European Commission VIES SOAP/REST lookup ('LIVE'). Returns structuredContent containing ok, mode, statelessEphemeralAudit, simulatedViesLookup, tenantId, normalizedVat, reverseChargeEligible, and viesDecision (status, action, zeroRateAllowed, consultationId). Use this tool for EU/XI VAT tax compliance; use revclamp_reconcile_b2b_net_terms for wholesale Net-15/30/60 deposit and credit-note accounting.","annotations":{"title":"Validate EU/XI B2B VAT ID & VIES Reverse-Charge State","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true},"inputSchema":{"type":"object","required":["buyerVatId"],"properties":{"sellerCountry":{"type":"string","description":"Two-letter EU-27 or XI member state prefix of the merchant's dispatch warehouse (e.g. 'DE', 'NL', 'FR', 'EL', 'XI'; 'GR' is automatically normalized to 'EL'; default: 'DE')."},"buyerVatId":{"type":"string","description":"Required buyer EU or Northern Ireland VAT registration number to normalize and validate (e.g. 'DE123456789', 'GR123456789', 'NL123456789B01', 'XI123456789', max 40 chars)."},"viesMode":{"type":"string","enum":["VALID","INVALID","MS_UNAVAILABLE","LIVE"],"description":"VIES evaluation mode: 'VALID' (deterministic active VAT simulation, default), 'INVALID' (deterministic rejected VAT simulation), 'MS_UNAVAILABLE' (deterministic member-state outage circuit-breaker simulation), or 'LIVE' (real-time European Commission VIES lookup)."},"consultationNumber":{"type":"string","description":"Optional VIES requester consultation reference number (e.g. 'WAPIAAAAW998877', max 64 chars) to attach to deterministic 'VALID' mode tax audit records."}},"additionalProperties":false}},{"name":"revclamp_reconcile_b2b_net_terms","title":"Reconcile B2B Wholesale Net-15/30/60 Deposits & Credit Notes","description":"Reconcile B2B wholesale Net-15, Net-30, and Net-60 invoice deposits, partial payments, and credit notes using exact integer minor-unit (EUR/USD cent) arithmetic with zero IEEE-754 floating-point drift. Executes as a pure, stateless, read-only financial reconciliation function. Returns structuredContent containing ok, mode, statelessEphemeralAudit, tenantId, and reconciliation (state, status, fulfillmentHold, releaseHoldAction, requiredDepositCents, remainingBalanceCents, creditDueCents, overpaidWarning, orderTag). Use this tool for B2B wholesale order deposit gating and Net-terms balance calculation; use revclamp_validate_eu_vat_vies for cross-border EU VAT number validation.","annotations":{"title":"Reconcile B2B Wholesale Net-15/30/60 Deposits & Credit Notes","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","required":["orderId","totalOrderCents","paidAmountCents"],"properties":{"orderId":{"type":"string","description":"Required B2B wholesale order or invoice identifier (e.g. 'gid://shopify/Order/908812' or 'ORD-2026-9088', max 64 chars)."},"totalOrderCents":{"type":"integer","description":"Required gross invoice total in positive integer minor currency units / cents (e.g. 250000 for 2,500.00 EUR; must be > 0)."},"paidAmountCents":{"type":"integer","description":"Required cumulative amount collected from the buyer in non-negative integer cents (e.g. 75000 for 750.00 EUR; must be >= 0)."},"creditNoteCents":{"type":"integer","description":"Optional post-invoice credit notes or return adjustments in integer cents (valid range: 0 to totalOrderCents, default: 0; singular alias for creditNotesCents)."},"creditNotesCents":{"type":"integer","description":"Optional post-invoice credit notes or return adjustments in integer cents (valid range: 0 to totalOrderCents, default: 0; plural alias for creditNoteCents)."},"requiredDepositCents":{"type":"integer","description":"Optional explicit upfront deposit threshold in integer cents (valid range: 0 to totalOrderCents). Overrides requiredDepositPercent when provided."},"requiredDepositPercent":{"type":"integer","description":"Optional upfront deposit percentage required before releasing warehouse fulfillment hold (valid range: 0 to 100, default: 30 i.e. 30% upfront deposit)."},"paymentTermsDays":{"type":"integer","description":"Optional B2B net payment terms maturity window in integer days (allowed values: 15, 30, or 60 for Net-15, Net-30, or Net-60; default: 30)."}},"additionalProperties":false}},{"name":"revclamp_verify_webhook_signature","title":"Verify Stripe, Shopify & RevClamp Webhook HMAC-SHA256 Signatures","description":"Generate and verify canonical Stripe-Signature (t=<unix>,v1=<hex_sha256>), X-Shopify-Hmac-Sha256 (<base64_sha256>), and X-RevClamp-Signature (t=<unix>,v1=<hex_sha256>) headers over exact UTF-8 webhook payload bytes using crypto.timingSafeEqual and a 300-second replay window guard. Enforces a Zero-Trust guard that blocks known live/production credential patterns (sk_live_, rk_live_, non-test whsec_..., shpss_..., shpat_..., rg_live_, rc_live_, AKIA..., and PEM private keys) with -32602 LIVE_SECRET_FORBIDDEN_IN_SANDBOX. Returns structuredContent containing ok, mode, statelessEphemeralAudit, tenantId, and verification (provider, verificationMode, headerName, generatedHeader, expectedSignature, signatureValid, verificationReason, timingSafeCompared, replayWindowApplicable, timestampSec, timestampSkewSeconds, toleranceSeconds, withinReplayWindow, payloadByteLength, payloadSha256, commonIntegrationTrap). Use this tool to debug webhook signature mismatches and replay skew.","annotations":{"title":"Verify Stripe, Shopify & RevClamp Webhook HMAC-SHA256 Signatures","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","properties":{"provider":{"type":"string","enum":["stripe","shopify","revclamp"],"description":"Webhook signature provider scheme to evaluate: 'stripe' (Stripe-Signature t=<sec>,v1=<hex>, default), 'shopify' (X-Shopify-Hmac-Sha256 Base64 raw UTF-8 HMAC), or 'revclamp' (X-RevClamp-Signature t=<sec>,v1=<hex>)."},"secret":{"type":"string","description":"Synthetic or test webhook signing secret (default: 'whsec_test_revclamp_sandbox_secret_2026', max 256 chars). Live production secrets (sk_live_, rk_live_, non-test whsec_..., shpss_..., shpat_..., rg_live_, rc_live_, AKIA..., and PEM private keys) are rejected."},"rawPayload":{"type":"string","description":"Exact unparsed UTF-8 webhook request body string (up to 16,384 chars) used to compute the canonical SHA-256 HMAC digest. Defaults to a provider-specific sample JSON event if omitted."},"timestampSec":{"type":"integer","minimum":1,"maximum":9999999999,"description":"Optional Unix epoch timestamp in integer seconds (valid range: 1 to 9999999999; defaults to current server Unix timestamp) used when generating or verifying timestamped Stripe/RevClamp headers."},"signatureHeader":{"type":"string","description":"Optional supplied HTTP signature header value to verify via crypto.timingSafeEqual (e.g. 't=1760000000,v1=...' or Base64 digest, max 512 chars). Omit to run in GENERATE_AND_SELF_VERIFY mode."}},"additionalProperties":false}}]}