DEV Community

Kat Laszlo for Tanso

Posted on • Edited on

We built an MCP server so AI coding tools can set up your entire billing system

We built an MCP server so AI coding tools can set up your entire billing system

Every AI and API company we've talked to ends up building the same internal system. Redis counters tracking credits. Cron jobs reconciling usage. If-statements scattered across the codebase gating feature access. It starts as a quick hack when you launch your first pricing tier and becomes a permanent headache every time pricing changes.

Billing platforms like Stripe handle what happens after usage. They meter events, generate invoices, process payments. But nothing in that stack answers the question that matters at runtime: should this request be allowed to run?

Does this customer have enough credits? Are they within their plan limits? Is this feature included in their subscription? That logic is still on your engineering team.

That's what we built Tanso for.

One API call before the request runs. Subscription state, usage limits, and credit balance checked simultaneously. Allow or deny. If denied, no compute runs. No cost incurred. No surprise invoice.

// Check before running compute
const { isAllowed } = await tanso.entitlements.evaluate({
  customerReferenceId: "cust_482",
  featureKey: "ai-analysis",
  usage: { usageUnits: 1 }
});

// Denied? No compute runs. No cost incurred.
if (!isAllowed) return res.status(403);

// Safe to run. This request is billable.
const result = await openai.chat.completions.create({ ... });
Enter fullscreen mode Exit fullscreen mode

The MCP server

We shipped an MCP server with 34 tools so AI coding tools can configure the whole thing. Claude Code, Cursor, VS Code, Windsurf, and ChatGPT can:

  • Create plans with graduated pricing tiers
  • Link features with usage limits and cost models
  • Onboard customers and create subscriptions
  • Check entitlements and ingest usage events
  • Set up model-aware cost tracking for LLM spend

No dashboard clicking required. Point your coding agent at the MCP and describe what you want.

MCP config:

{
  "mcpServers": {
    "tanso": {
      "url": "https://api.tansohq.com/mcp",
      "headers": {
        "X-API-Key": "sk_live_your_api_key_here"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

We also have AI-native docs so coding agents can read the full API in context: https://tansohq.com/llms-mcp.txt

How it fits with Stripe

Tanso plugs into your existing Stripe setup. You define plans and features in Tanso. Invoices push to Stripe. Payment status flows back automatically. Your payment processor still handles transactions. Tanso controls the pricing logic in your product.

What we're seeing

Every team we talk to has some version of this held together with internal tools. The pattern is always the same:

  1. Ship a simple pricing tier
  2. Hardcode some limits
  3. Pricing changes, nothing updates
  4. Customers exceed limits, nobody notices until the invoice
  5. Spend weeks rebuilding

If that sounds familiar, we'd love to hear what you ended up building. What broke first?

Self-serve is live with a free tier at tansohq.com.

Top comments (0)