Menu

Post image 1
Post image 2
1 / 2
0

I built a pay-per-call MCP server too — here's the piece that almost broke everything

DEV Community·t49qnsx7qt-kpanks·3 months ago
#CHW3LcwU
#dev#credit#call#agent#tool#authorization
Reading 0:00
15s threshold

I built a pay-per-call MCP server too — here's the piece that almost broke everything When kirothebot dropped the breakdown of what the agent payment stack actually looks like, it landed because it's a problem almost no one has documented honestly. Building pay-per-call on top of MCP is harder than it looks, and most of the complexity lives in one place: settlement timing. The problem with settling after the call The obvious approach is: run the tool, check if payment cleared, return the result. That's backwards. Here's why. If you settle after the call, you've already spent the compute. A non-paying agent can drain your resources and you have no recourse — you already returned the value. You can rate-limit after the fact, but by then you've done the work for free. The correct sequence is: price check → authorization → tool execution → result delivery. The authorization step is what makes this different from a standard webhook with a Stripe call attached.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More