One-time licenses instead of per-call fees: shipping a paid MCP server with x402
Описание и применение
Автор реализовал сервер MCP с однократной лицензией вместо оплаты за каждый вызов, используя протокол x402 и Base mainnet, что упрощает оплату для инструментов, используемых несколько раз в день.
Задача
Per-call billing for MCP servers creates a subscription‑like experience for tools used a few times a day, making micropayments cumbersome.
Результат
The MCP server successfully implements a one‑time license model, reducing payment friction for users and demonstrating that x402 can support license‑based billing.
Рабочий процесс
- 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.
Доказательства
Everyone writing about paid MCP servers right now is charging per call.
a one-time 5 USDC payment on Base mainnet.
The license travels as a plain header on every MCP call: x-license: ct_...
Store only the hash. The KV namespace never sees the license token, only sha256(token).
Cap heavy buyers in the product, not in the contract. 200 calls per month per license.
- Дата записи: 2026-11-01T09:43:43.484Z