Guide · December 2026

How to charge for your MCP server

You run a remote MCP server or an HTTP API, and agents are starting to call it. This guide covers the three common pricing models, what you should count, how Stripe's usage-based billing fits in, and the plumbing you need around it.

Three ways to charge

  1. Flat subscription with an API key. Simple to explain and to bill. Your price has to cover the heaviest users, and you need a quota anyway, or one busy agent can use up your whole margin.
  2. Prepaid credits. The customer buys a block of calls in advance and you deduct from it. You get paid first, but you have to keep the balances, top-ups and expiry rules yourself.
  3. Usage-based billing (metering). You count each call and invoice at the end of the period. This fits agents best: they make many small, irregular calls, and nobody has to guess the right plan in advance.

Many providers combine them: a monthly base fee with included units, plus a price per unit above that. All of these models need the same thing underneath, which is a reliable count per customer.

What to count on an MCP server

  • Count successful tools/call requests only. initialize, tools/list and pings are protocol overhead; charging for them annoys customers and invites disputes.
  • Decide how to handle tool errors. A result with isError: true is technically a response, but most customers expect not to pay for it. Our default is to count it as 0.
  • Weight expensive tools. A 30-day forecast or a large search costs you more than a lookup. Give tools a weight (for example 1 and 5) and bill units, not raw calls.
  • Count per key, not per IP address. Agents share infrastructure. Issue one key per customer, or per agent if your customer wants separate limits, and attribute every call to a key.
  • Never log arguments or results for billing. Time, key, tool name and weight are enough. Anything else turns your billing data into personal data you have to protect.

How Stripe meters work

Stripe's usage-based billing has three parts:

  1. A meter with an event name, for example api_calls, that adds up the values it receives.
  2. A price attached to that meter (per unit, per package or tiered) and a subscription for each customer.
  3. Meter events that you send for each customer: POST /v1/billing/meter_events with the event name, payload[stripe_customer_id], payload[value] and a unique identifier.
curl https://api.stripe.com/v1/billing/meter_events \
  -u "rk_live_...:" \
  -d event_name=api_calls \
  -d "payload[stripe_customer_id]=cus_..." \
  -d "payload[value]=5" \
  -d identifier=call-7f3a9c

Stripe adds the events up on the meter and puts the total on the customer's invoice at the end of the billing period. The money goes directly to your Stripe account.

Use a restricted key (rk_...) that can only write meter events. A full secret key can also create refunds and payouts, so it should not be stored in a metering service.

The plumbing around it

Sending one HTTP request per call looks easy. Running it in production means building more than that:

  • Key management: issuing keys, storing only their hashes, revoking them, and linking each key to a Stripe customer later without changing the key.
  • Quotas and rate limits per key and per account, answered in a way that agents understand. On MCP that means a JSON-RPC error with a clear reason, not an HTML error page.
  • A durable queue: Stripe can be slow or unreachable, so record the call first and send the meter event afterwards, with retries.
  • Idempotency: derive the identifier from your own usage record, so that a retry can never bill twice.
  • Reconciliation: at month end you need to show which units Stripe accepted, which are still pending and which failed. This is the first thing a customer asks about when an invoice looks too high.
  • Threshold alerts: warn customers at 80 % and 100 % of their quota before they get blocked.
  • Streaming: MCP over Streamable HTTP can answer with server-sent events, so the proxy has to pass the stream through and still recognise when the call succeeded.

If you already run an API gateway, most of this goes into a plugin or middleware. If you run a single MCP server on a small budget, it is often more work than the server itself.

Or use Earnstile

Earnstile is a hosted gateway for exactly this. You put it in front of your MCP server or HTTP API. It issues a key per customer, counts only successful tools/call requests with tool weights, enforces quotas with JSON-RPC errors, and sends meter events to your own Stripe account through a restricted key. Reconciliation comes as JSON or CSV. We take no fee on your revenue and no money passes through us.

Free for one gateway and 10,000 units a month; Starter €19 and Pro €49 per month incl. 19 % VAT, for businesses. An agent can set everything up through the management MCP server at https://earnstile.com/api/mcp.

Meter your MCP server in 5 minutes

General information, not tax or legal advice.