RevClamp MCP Server & CLI (revclamp-mcp)
revclamp-mcp is a standalone, zero-dependency Open-Source Model Context Protocol (MCP) Server & CLI (index.mjs + local_engine.mjs) implementing 9 deterministic B2B FinOps, Stripe 2025-03-31.basil, Visa CE 3.0, EU/XI VIES VAT, Shopify Plus B2B Net-15/30/60, and Webhook Security tools in pure Node.js.
- 100% Local In-Process Execution (Default — Zero Network / Zero API Key Required): All 9 MCP tools (
initialize,tools/list, andtools/call) execute locally in-process insidelocal_engine.mjsusing pure Node.js (node:cryptoHMAC-SHA256 verification, integer-cent double-entry accounting, 72-hour webhook replay state machines, and18,000UTF-16 code unit CE 3.0 linting). - Optional Hosted Cloud Workspace Sync (
REVCLAMP_API_KEY): WhenREVCLAMP_API_KEY(rg_live_...) is configured,revclamp-mcpcan optionally connect to RevClamp Enterprise (https://api.revclamp.com/api/mcp) for live workspace telemetry and real-time EU Commission VIES gateway queries.
Open-Source MCP Tools Implemented in local_engine.mjs (9)
| Tool Name | Domain | Local In-Process Implementation (local_engine.mjs) |
Execution Mode |
|---|---|---|---|
revclamp_audit_revenue_leakage |
Stripe Billing & Usage | Runs a 90-day B2B revenue leakage and dispute readiness audit across subscriptions, usage events, and disputes | Local In-Process (or Optional Cloud Key) |
revclamp_evaluate_ghost_usage |
Stripe 2025-03-31.basil |
Evaluates multi-subscription customer snapshots (has_more: false enforced) and 0–14d dunning grace windows for unpaid API/LLM bleed |
Local In-Process (or Optional Cloud Key) |
revclamp_stage_stripe_dispute_ce3 |
Visa 10.4 / CE 3.0 | Evaluates 120d–365d prior undisputed charges (ip_subnet/device_id overlap) and stages a submit: false draft (<= 18,000 UTF-16 code units) |
Local In-Process (or Optional Cloud Key) |
revclamp_validate_eu_vat_vies |
EU & XI B2B VAT |
Normalizes 27 EU member states + Northern Ireland (XI) VAT IDs (GR -> EL), checks cross-border reverse-charge eligibility, and evaluates VIES HTTP 200 errorWrappers |
Local In-Process (or Optional Live VIES) |
revclamp_reconcile_b2b_net_terms |
B2B Wholesale Net-30 | Reconciles Net-15/30/60 upfront deposits and credit notes using integer EUR-cent double-entry accounting | Local In-Process (or Optional Cloud Key) |
revclamp_verify_webhook_signature |
Webhook HMAC-SHA256 | Generates and verifies Stripe-Signature, X-Shopify-Hmac-Sha256, and X-RevClamp-Signature over raw UTF-8 bytes (node:crypto) with 300s replay checks |
Local In-Process (or Optional Cloud Key) |
revclamp_calculate_roi_and_plan_fit |
0% Take-Rate ROI & Plan Fit | Calculates monthly and annual B2B margin savings in integer USD cents vs. 25%–30% chargeback agencies and recommends the optimal tier | Local In-Process (or Optional Cloud Key) |
revclamp_simulate_webhook_replay |
Webhook Replay & FSM | Simulates subscription lifecycle webhooks against a 72h deduplication Set and monotonic createdSec guard vs. naive arrival-order handlers |
Local In-Process (or Optional Cloud Key) |
revclamp_lint_dispute_evidence |
Dispute Evidence UTF-16 & CE 3.0 | Lints evidence[access_activity_log] payloads against the 18,000 UTF-16 code unit ceiling, non-destructive CE 3.0 markers, and merchant note preservation |
Local In-Process (or Optional Cloud Key) |
Quick Start (Claude Desktop / Cursor / Windsurf)
Add revclamp-mcp to your claude_desktop_config.json or .cursor/mcp.json. By default, revclamp-mcp runs 100% locally in-process with zero network calls and zero API keys required:
{
"mcpServers": {
"revclamp": {
"command": "npx",
"args": ["-y", "github:revclamp/revclamp-mcp"]
}
}
}
(Optional) To connect to a live workspace on https://revclamp.com/dashboard, pass REVCLAMP_API_KEY in env or use the hosted Streamable HTTP endpoint (POST https://api.revclamp.com/api/mcp):
curl -sS -X POST https://api.revclamp.com/api/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
CLI Usage
# List all 9 MCP tools and JSON schemas (runs locally in-process)
node index.mjs --list-tools
# Validate an EU or Northern Ireland (XI) B2B VAT ID (auto-converts Greece GR -> EL)
node index.mjs --check-vat GR123456789 DE
# Calculate 0% take-rate ROI and optimal flat-rate plan fit (runs locally in-process)
node index.mjs --calc-roi 10000 600 25 250000
# Simulate out-of-order webhook replay and 72-hour deduplication state machine (runs locally)
node index.mjs --sim-replay out_of_order_stale_update_after_cancel
# Lint Stripe dispute evidence UTF-16 code units and non-destructive CE 3.0 markers (runs locally)
node index.mjs --lint-evidence valid_ce3_non_destructive
# Verify webhook HMAC-SHA256 using REVCLAMP_WEBHOOK_SECRET from environment (runs locally)
REVCLAMP_WEBHOOK_SECRET="whsec_test_secret_revclamp_sandbox_2026" node index.mjs --verify-webhook stripe
# Invoke Visa CE 3.0 readiness staging locally
node index.mjs --call revclamp_stage_stripe_dispute_ce3 '{"disputeId":"du_1Qxyz01","customerId":"cus_ent_88","disputeReason":"fraudulent"}'
Architecture & Engineering Deep-Dives (7 Post-Mortems & 8 Interactive Browser Tools)
1. Stripe 2025-03-31.basil Entitlement Guard & Visa CE 3.0 Two-Tier Routing

- Engineering Post-Mortem #1: Stripe's
basilAPI broke my grace-period logic, and CE 3.0 turned out to be a routing problem - Engineering Post-Mortem #7: Visa CE 3.0
18,000UTF-16 Code Unit Evidence Truncation & Non-Destructive Staging - Interactive Tools (No Signup):
2. EU VIES HTTP 200 OK Soft-Failure Circuit Breaker & B2B Net-Terms Reconciliation

- Engineering Post-Mortem #2: VIES returns
HTTP 200when it's down, and I charged the wrong VAT because of it - Engineering Post-Mortem #3: Shopify Plus B2B Net-15/30/60 Integer-Cent Deposit & Credit-Note Reconciliation
- Interactive Tools (No Signup):
3. Webhook HMAC-SHA256 Raw-Body Security, 72h Replay FSM & 0% Take-Rate ROI
- Engineering Post-Mortem #4: Why Stripe and Shopify Webhook HMAC-SHA256 Verification Fails on Parsed JSON Bodies
- Engineering Post-Mortem #5: Chargeback Contingency Fees (25%) vs. Flat-Rate 0% Commission Automation
- Engineering Post-Mortem #6: Webhook Idempotency & Out-of-Order Subscription State Machines
- Interactive Tools (No Signup):
Security & Resource Bounds
- Local-First Deterministic Execution: Runs all 9 tools locally in-process inside
local_engine.mjswith zero external npm dependencies. - Strict Origin Pinning (Cloud Mode): When
REVCLAMP_API_KEYis provided, only connects tohttps://api.revclamp.com/api/mcporhttps://revclamp.com/api/mcpover TLS (redirect: "error"). - Bounded Execution: Enforces a hard
10,000msrequest timeout (AbortSignal.timeout) and a32,768-byte request/response payload cap. - Full LLM Reference:
https://revclamp.com/llms-full.txt
License
MIT © RevClamp Enterprise
