DEV Community

Oleksandr
Oleksandr

Posted on

From 0 to 6 B2B API products in 6 days: Cloudflare Workers + MCP + x402

TL;DR: I built 6 API products + 2 MCP servers + 914 SEO pages in 6 days using Cloudflare Workers, MCP protocol, and x402 payments. Here's what worked and what didn't.

The products

  1. HS Codes Classifier AI classification for customs. Turn "iPhone 15 Pro" → 8517.13.

Benchmark (Alibaba HSCodeComp, 100 cases):

Metric Accuracy
6-digit exact match 24.5%
4-digit 52.5%
2-digit (chapter) 86.0%
Avg latency 1.3 sec
For comparison: GPT-4o-mini alone gets ~18% on the same benchmark. Best AI agents with web search hit 46.8% but cost $1-10/call. Ours is $0.01/call.

  1. Compliance Engine Sanctions screening + PEP + entity resolution:

OFAC_SDN: 19,417 records

UK_OFSI: 6,408 records

EU_CONS: 6,241 records

UN_CONS: 956 records (auto-ingested daily via GitHub Actions)

PEP: 11,751 records (15 occupations from Wikidata)

GLEIF entities: 19,984 records

Total: ~65,000 records. All queryable via /check/sanctions, /check/pep, /check/entity.

  1. Docs-to-JSON
    Document extraction: invoices, receipts, contracts → structured JSON. Also available as an MCP server in the MCPize marketplace.

  2. Finance Validators
    IBAN, VAT, SWIFT, LEI, Card validators — one REST API.

  3. Watch Engine
    Currency (ECB Frankfurter + NBU), VAT (EU Commission TEDB), tariffs (USITC + EU TARIC). MCP server in MCPize marketplace.

  4. Creator Engine
    Promise extraction for contracts. MCP-ready.

The stack
Compute: Cloudflare Workers (8)
Database: Cloudflare D1 (65K records)
Cache: Cloudflare KV (5 namespaces, Free tier)
Hosting: Cloudflare Pages
Payments: x402 (USDC on Base)
AI: MCP (2 servers in MCPize marketplace)
SEO: 914 programmatic pages
Deploy: git push = deploy

What worked

  1. Programmatic SEO Generate 914 pages from 3 templates (HS codes, documents, finance). One node generator.js creates all pages + sitemap.xml.

No manual SEO work. Each page is a real product landing: "HS code for [product]" → 498 pages.

  1. MCP distribution AI agents find us in the MCPize marketplace. $0.01/call in USDC. No signup, no API keys.

Two servers live:

document-to-json-mcp

watch-engine-mcp

  1. Git-driven deploy
    Every git push → Cloudflare Pages auto-builds. Zero DevOps. No CI/CD setup, no Docker, no k8s.

  2. Cross-promotion network
    6 products promote each other on each landing page. Each landing has 5 backlinks to sibling products. Combined with 914 SEO pages this creates an internal link graph.

  3. IndexNow auto-ping
    GitHub Action pings Bing/Yandex with all 814+ URLs on every push. Automatic sitemap submission.

What didn't work

  1. Paid ads
    Tried Hermoso, Markifact, Merlin. B2B APIs don't convert on these — $0 spent, $0 revenue.

  2. Email marketing
    No contacts. Cold email bans Gmail.

  3. Auto-SDR tools
    Requires human to approve each message. Not really automation.

Benchmark deep dive
Downloaded Alibaba's HSCodeComp dataset (632 products). Tested 100 cases, two runs, stable ±1%:

6-digit: 24.5% exact match
4-digit: 52.5%
2-digit: 86%
Avg time: 1.3 sec

Our API returns 6-digit HS codes. HSCodeComp expects 10-digit US codes, so we compare first 6 digits (international HS level).

The trade-off:

Our API: 24.5% at $0.01/call, 1.3 sec

Best AI agents (with web search): 46.8% at $1-10/call, 10-30 sec

Human experts: 95%

Architecture notes
Two Cloudflare accounts:

Pages: jsonexlab.com

Workers: boring-saas-infra.workers.dev

5 KV namespaces. Free tier: 1000 writes/day shared across all. Learned to use Cache API instead of KV for hot paths (sanctions screening).

For sanctions ingestion we use GitHub Actions (OFAC manual, UN daily 03:30 UTC via Playwright). D1 gives us 5M reads/day free — more than enough.

Links
Site: https://jsonexlab.com

HS Codes: https://jsonexlab.com/

Compliance: https://jsonexlab.com/compliance/

Watch: https://jsonexlab.com/watch/

Watch MCP: https://mcpize.com/mcp/watch-engine-mcp

What would you build with x402 + MCP?

Top comments (1)

Collapse
 
alexcodebytes profile image
Oleksandr •

Some additional numbers that didn't fit in the article:

Benchmark raw data (HSCodeComp, 100 cases, 2 runs):

  • 6-digit: 24.0% / 25.0% (avg 24.5%)
  • 4-digit: 52.0% / 53.0% (avg 52.5%)
  • 2-digit: 87.0% / 85.0% (avg 86%)
  • Avg time: 1353ms / 1316ms

Stability ±1% across runs — good sign for production use.

Compliance breakdown:

  • OFAC_SDN: 19,417
  • UK_OFSI: 6,408
  • EU_CONS: 6,241
  • UN_CONS: 956 (daily auto-refresh at 03:30 UTC)
  • PEP: 11,751 (politician, diplomat, head_of_government, head_of_state, governor, mayor, judge, military_officer + 7 more)
  • GLEIF entities: 19,984

MCP servers:

Both at $0.01/call in USDC on Base.

Source code:

Free tier for everything: jsonexlab.com

Happy to answer questions about the stack, MCP, x402, or programmatic SEO.