• Pricing
  • Blog
Log inBook a demo

xmcp Template

Subscription-aware billing for MCP servers. Feature gating, usage tracking, and AI token billing for your xmcp tools.

Templates
Source
xmcp Template

Billing template for xmcp servers. Gate tools by plan, track metered usage, and bill AI token consumption per model.

Stack: xmcp, Commet SDK (@xmcp-dev/commet)

Quick Start

pnpm add @xmcp-dev/commet

What's Included

  • Provider middleware with customer identification via headers
  • Feature gating with boolean checks per tool
  • Metered usage tracking with included quotas and overage
  • AI token tracking per model with configurable margins
  • Full SDK access via getClient() for portal, subscriptions, and plans

Key Files

  • src/middleware.ts — Commet provider with API key and environment config
  • src/tools/free-tool.ts — Public tool, no gating
  • src/tools/export-tool.ts — Boolean feature gate
  • src/tools/pro-tool.ts — Metered usage tracking
  • src/tools/ai-tokens-tool.ts — AI token consumption per model

Learn More

  • xmcp Commet Plugin Docs
  • Consumption Models
  • Track Usage
  • AI Token Billing

See the full working example in the xmcp repository on GitHub.

Subscription billing built for developers and agents

Get startedBook a demo

Accept global payments, handle usage-based pricing, subscriptions, and seats — without building your own infrastructure.

Status unavailable

Frameworks

  • Next.js
  • Remix
  • Nuxt
  • SvelteKit
  • Astro
  • Express
  • Hono
  • Django
  • FastAPI

Resources

  • Documentation
  • Guides
  • Blog
  • Templates
  • Changelog
  • Glossary
  • Billing for AI models

Company

  • Solutions
  • About
  • Open Source

Compare

  • Stripe Billing
  • Orb
  • Chargebee
  • Lago
  • Autumn
  • Yuno

AI

  • Commet Agents
  • MCP Server
  • Skills
  • Claude Code
  • Codex
  • Cursor
Follow us
© 2026 Commet Co.TermsPrivacy PolicyCookie Policy