How to Monetize Your MCP Server (x402 and Polar)
Two practical approaches to charging for MCP tool usage: x402 for per-call micropayments and Polar for subscription-based access — using xmcp integrations.
If your MCP server wraps a paid API, costs compute per call, or provides specialized capability, you probably want to charge for it. Two available xmcp monetization approaches are: x402 for per-call micropayments and Polar for subscription-based access with license keys.
Two monetization models
| x402 | Polar | |
|---|---|---|
| Billing model | Per tool call (micropayments) | Subscription or one-time purchase |
| Payment method | Crypto (via Coinbase x402) | Card, Stripe |
| User accounts required | No | Yes (Polar account) |
| Best for | Pay-as-you-go usage, agents | SaaS-style access, recurring revenue |
| Integration | @xmcp-dev/x402 plugin | @xmcp-dev/polar plugin |
x402: per-call micropayments
x402 is a protocol built by Coinbase on the long-reserved HTTP 402 status code. A client sends a signed crypto payment with each request; the server verifies it before executing the tool. No accounts, no subscriptions — just pay and use.
This model fits tools with unbounded usage patterns: an agent that calls a search tool hundreds of times in a session, a data enrichment tool where usage varies wildly per user, or any capability where a flat monthly fee doesn't match consumption.
Install the plugin:
Register the HTTP provider in middleware:
Mark the tools that require payment:
This provider does not automatically charge every tool. Test with a compatible payment client and a test-network wallet. Follow the x402 guide and runnable example for the complete flow.
Polar: subscription access
Polar is a developer-first monetization platform that handles subscriptions and license keys. The xmcp provider exposes license validation methods that your application must call before allowing protected operations.
This model fits when you want predictable revenue — a monthly plan for teams, a one-time purchase for individuals, or tiered access based on subscription level.
Install the plugin:
Create a provider for the product you configured in Polar:
Creating the provider does not enforce access by itself. Validate the request's license key and stop execution when validation fails. The Polar guide and runnable example show the validation and usage flow. Test concurrent callers and invalid keys before enabling live access.
Which model to choose
Use x402 when:
- Usage varies heavily per user or per session
- You want zero-friction access (no accounts, no sign-up)
- Your target users are autonomous agents that can handle crypto payments
Use Polar when:
- You want predictable, subscription-based revenue
- Your users are developers or teams buying access for a period
- You want usage analytics and customer management in a dashboard
Choose and test one access model first. Combining payment systems requires explicit routing and authorization design; installing two packages does not create that policy.
Next steps
- Pay-per-use MCP tools with x402 — detailed x402 setup and client-side payment flow.
- Integrating Polar with xmcp — Polar product setup, license keys, and usage tracking.
- Deployment docs — ship your monetized server to Vercel with zero config.
