Docs / MCP Support
MCP Support
Use Chargly through a lightweight MCP server to check balances, meter AI actions, and create credit top-ups from agent-native workflows.
Why use MCP with Chargly
Integrate with MCP-aware tools and runtimes. Expose billing as standard agent tools. Avoid rebuilding billing logic in each agent workflow.
MVP MCP tools
Initial tool surface
Chargly's first MCP release focuses on wallet lookups, event metering, and top-ups.
chargly.get_walletFetch the current wallet balance for a customer.
Input
Output
customerId walletId balance unitchargly.meter_eventRecord a billable AI action and deduct credits.
Input
Output
success eventId deductedCredits remainingBalancechargly.create_checkoutCreate a Stripe checkout session for a credit top-up. Uses Stripe for payment processing.
Input
Output
checkoutId checkoutUrl creditschargly.list_credit_packsReturn available credit packs for purchase.
Input
Output
id, name, credits, pricePricing Advisor tools
MCP can inspect and apply Pricing Advisor recommendations. See Pricing Advisor MCP for when and how agents use these tools. Agents can fetch pricing rules, list recommendations, explain why a change was suggested, and apply or reject it — all through tools.
chargly.get_pricing_ruleFetch a pricing rule by feature or ID.chargly.list_pricing_recommendationsList recommendations for your project.chargly.get_pricing_recommendationGet a single recommendation by ID.chargly.explain_pricing_recommendationGet the reason and confidence for a recommendation.chargly.apply_pricing_recommendationApply a recommendation (creates new immutable version).chargly.reject_pricing_recommendationReject a recommendation (preserves audit history).Example workflow
- 1Call
chargly.get_wallet - 2If balance is sufficient, call
chargly.meter_event - 3If balance is low, call
chargly.list_credit_packs - 4Call
chargly.create_checkout
SDK vs MCP
Use the SDK for direct app integration. Use MCP for agent-native tool integrations. Both map to the same Chargly billing primitives.
MVP scope note
The initial MCP surface focuses only on wallet lookups, event metering, checkout creation, and credit pack listing. Admin or analytics tools are not included yet.
Implementation note
The MCP server maps to the same core Chargly billing primitives used by the SDK and API.