I built an MCP server that charges AI agents per call using x402 micropayments
By Toolstem
You built an MCP server. Agents call it. You pay the API costs. They pay nothing. Every tools/call invocation burns a few cents of your budget while the agent that triggered it has no idea — and no incentive to care. The standard answer is "wrap it in a SaaS subscription," but that requires a human in the loop to sign up, enter a card, and manage a billing relationship. Most agents don't have humans watching every call. What if the agent just paid for its own data, automatically, without a human anywhere in the loop?
That's what I built. Here's what I learned.
What x402 actually is






