Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

One-time licenses instead of per-call fees: shipping a paid MCP server with x402

Description and use

The author implemented an MCP server with a one‑time license instead of per‑call fees, using x402 and Base mainnet, simplifying payment for tools used a few times a day.

Problem

Per-call billing for MCP servers creates a subscription‑like experience for tools used a few times a day, making micropayments cumbersome.

Outcome

The MCP server successfully implements a one‑time license model, reducing payment friction for users and demonstrating that x402 can support license‑based billing.

Workflow

  • 1. Client requests /api/comprar and receives a 402 response with payment details.
  • 2. Client pays via an x402‑capable facilitator and retries with an X-PAYMENT header.
  • 3. Server verifies payment, mints a license token, and returns it in a JSON response.
  • 4. Client includes the x-license header on subsequent MCP calls.
  • 5. Server validates the license hash stored in KV and enforces a 200‑call/month limit per license.

Evidence

Everyone writing about paid MCP servers right now is charging per call.

Source

a one-time 5 USDC payment on Base mainnet.

Source

The license travels as a plain header on every MCP call: x-license: ct_...

Source

Store only the hash. The KV namespace never sees the license token, only sha256(token).

Source

Cap heavy buyers in the product, not in the contract. 200 calls per month per license.

Source

  • Record date: 2026-11-01T09:43:43.484Z