Commet
  • Pricing
Log InTry out
Templates

xmcp Template

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

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

Developers

  • Documentation
  • Templates
  • GitHub

Resources

  • Blog
  • Changelog
  • Pricing

AI

  • Agents
  • MCP Server
  • Agent Skills
  • Claude Code
  • Codex

Learn

  • Guides
  • Glossary
  • Solutions
  • Billing for AI Models
  • Comparison

Company

  • About
  • Open Source
  • Terms
  • Privacy
XLinkedInGitHub