APIs·
intermediate
·9 min read·Apr 4, 2026·Updated Oct 10, 2026
By Rad Tome·Lead AI Systems Architect·How we verify this

Paying for MCP Tools with Stripe's Machine Payments Protocol (MPP)

How an MCP client pays for a tool call with MPP: the HTTP 402 challenge, Shared Payment Tokens from a Link agent wallet, and the stablecoin alternative.

StripeMPPMachine Payments ProtocolpaymentsMCP clientAI agentsshared payment tokens
Config Target: claude_desktop_config.json
{
  "mcpServers": {
    "stripe": {
      "command": "npx",
      "args": [
        "-y",
        "@stripe/mcp-server-stripe"
      ],
      "env": {
        "STRIPE_SECRET_KEY": "sk_test_xxxxxxxxxxxx"
      }
    }
  }
}
Interactive Tool
1-Click Export

Generate & Test Stripe MCP Server Config

One-click export with environment variables & path locators for Claude Desktop, Cursor, Windsurf, and OpenAI Codex CLI.

Open in Generator

Paying for MCP Tools with MPP

Machine Payments Protocol (MPP) is an open protocol for paying for API calls programmatically, without a checkout UI. It is co-authored by Stripe and Tempo (opens in a new tab) and documented at Stripe's machine payments docs (opens in a new tab).

If you are building the client side — an agent that calls paid MCP tools — this guide describes what your agent actually has to do. For the server side, see Accepting MPP in your MCP server.

Stripe describes the MCP + MPP approach as experimental. The protocol is new, the tooling is young, and the package versions below move quickly.

The flow your agent has to handle

MPP is an HTTP-level handshake, not an MCP feature. From Stripe's MPP documentation (opens in a new tab):

text
[Agent] -- Request paid resource without payment --> [Server]
[Server] -- HTTP 402 with payment requirements --> [Agent]
[Agent] -- Retry request with payment credential --> [Server]
[Server] -- POST /v1/payment_intents to record payment --> [Stripe]
[Server] -- Return requested resource --> [Agent]

Concretely, when your agent calls a paid MCP tool:

  1. ▸The tool returns a payment link (a normal HTTPS URL on the seller's server), plus instructions. It does not return a result yet.
  2. ▸Your agent POSTs to that URL with no credential.
  3. ▸The server replies 402 Payment Required with a payment challenge that states what is being charged and in which currency.
  4. ▸Your agent obtains a payment credential from a wallet and retries the request with it.
  5. ▸The server verifies the payment, fulfils the purchase, and returns the result with an MPP receipt.

The key design point: MPP never asks a human for a card number. The agent holds a credential it can present without further interaction.

What your agent needs: an agent wallet

To produce a payment credential, the agent needs a wallet. Stripe ships one as the Link agent wallet, distributed as the @stripe/link-cli (opens in a new tab) package. Its own description is the clearest summary of the idea:

Link CLI lets agents get secure, one-time-use payment credentials from a Link wallet to complete purchases on your behalf — without storing your real card details.

Those credentials are Shared Payment Tokens (SPTs) (opens in a new tab). An SPT is scoped, single-use, and does not expose your underlying card number.

Set up the Link agent wallet

bash
npx @stripe/link-cli auth login

Stripe also publishes it as an agent skill, which is the documented way to wire it into an agent harness:

bash
npx skills add stripe/link-cli

To connect an MCP server that charges for tools:

bash
claude mcp add --transport http paid-catalog https://example.com/mcp
bash
codex mcp add paid-catalog --url https://example.com/mcp

Test against a sandbox before moving real funds

Stripe's guidance is to tell the agent explicitly that the flow is a test, so the Link agent wallet issues sandbox credentials that do not charge a real payment method. Put that instruction in CLAUDE.md or your system prompt, then make sure the agent passes the --test flag when it creates a spend request.

Without that, an end-to-end test moves real money.

Paying a real endpoint by hand

You can drive the payment flow manually, which is the fastest way to confirm a seller's implementation works:

bash
npx @stripe/link-cli mpp pay /paid \
  -X POST \
  -d '{}' \
  --context "Testing machine payments integration on Stripe MPP using the link-cli."

The stablecoin alternative

Stripe also supports MPP payments over stablecoins on the Tempo network. If your agent holds a crypto wallet rather than a Link account, it can pay a deposit address instead of presenting an SPT.

There is a hard floor on both rails, from the MPP docs (opens in a new tab):

Payment methodMinimum charge
Shared Payment Tokens (card)0.50 USD
Stablecoin (USDC)0.01 USDC

The card minimum is a real constraint for micropayments. A per-call price below 0.50 USD is only viable on the stablecoin rail unless the seller bundles calls.

Spending controls: what actually exists

Be careful here, because a lot of third-party content about MPP is invented.

There is no MPP-standard budget environment variable. No MPP_MAX_PER_TOOL_CALL_USD, no MPP_MAX_SESSION_SPEND_USD, no MPP_REQUIRE_CONFIRMATION_ABOVE_USD, and no "Machine Wallet" object that holds a balance. POST https://api.stripe.com/v1/machine_wallets is not a Stripe endpoint — it returns 404 Unrecognized request URL.

What genuinely controls spend:

  • ▸The challenge amount. Your server decides the price, and the 402 states it before your agent commits anything. Treat an unexpected amount as an error and stop.
  • ▸Your own agent policy. Enforce per-call and per-session ceilings in the agent's own configuration and system prompt. There is no protocol-level enforcement you can rely on.
  • ▸Credential scope. SPTs are one-time-use, so a leaked credential buys one call, not an open wallet.

That last point is the honest headline: MPP's risk model is scoped, single-use credentials, not a funded wallet with a spending cap. If you need hard budget enforcement, you need to build it in your own agent.

Verifying a seller's implementation

Stripe publishes a validator. If a seller's endpoint claims MPP support, run this against it and see what it reports on discovery, challenge format, and the full payment flow:

bash
npx mppx@latest validate 

Run it against both a sandbox and a live version of the server. In live mode the CLI can complete roundtrip transactions with real funds, so point it somewhere you control.

Reference

Technical Changelog

Weekly Protocol Diffs & Verified Drops

New server guides, benchmarks, and security audits. No spam. Unsubscribe anytime.

Zero marketing spam. 1-click unsubscribe anytime.

Ready to Deploy?

Build your full agent toolstack in the Visual Generator

Combine Paying for MCP Tools with Stripe's Machine Payments Protocol (MPP) with databases, search APIs, and memory graphs in a single configuration file.

Customize in Generator
Developer Verification & Feedback
0 reports

Did this setup guide work with your AI host?

Help test this configuration across Claude, Cursor, and Codex CLI. Be the first to report:

Paying for MCP Tools with Stripe's Machine Payments Protocol (MPP) FAQ

What is the Paying for MCP Tools with Stripe's Machine Payments Protocol (MPP)?

How an MCP client pays for a tool call with MPP: the HTTP 402 challenge, Shared Payment Tokens from a Link agent wallet, and the stablecoin alternative.

How do I configure Paying for MCP Tools with Stripe's Machine Payments Protocol (MPP) in Claude Desktop or Cursor?

You can copy the configuration JSON from our guide or launch the interactive MCP Codex Config Generator at https://mcp-codex.com/generator to export valid configs in 1 click.

Can I use Paying for MCP Tools with Stripe's Machine Payments Protocol (MPP) with the OpenAI Codex CLI?

Yes, OpenAI Codex CLI supports Model Context Protocol. You can add it directly to ~/.codex/config.toml or pass arguments to codex mcp add.

RT

Written by Rad Tome

Lead AI Systems Architect & Maintainer, MCP Codex

@RadTome

Specializing in Model Context Protocol (MCP) integrations, autonomous AI agent orchestration, and distributed developer toolchains. Researches and benchmarks production MCP client-server architectures across OpenAI Codex, Claude, and Cursor.

Editorial Integrity: Package names are checked against the npm registry and repositories against the GitHub API. Where a package could not be verified, the guide says so instead of giving you a command to run.

Related Guides