Back to Codex
APIs·
intermediate
·12 min read·Apr 4, 2026

How to Use Stripe's Machine Payments Protocol (MPP) as an MCP Client

Learn how to configure your AI agent as an MCP client that can automatically pay per tool usage using Stripe's Machine Payments Protocol — enabling access to premium, monetized MCP servers.

StripeMPPMachine Payments ProtocolpaymentsMCP clientAI agentsmonetization

Using Stripe's Machine Payments Protocol as an MCP Client

Stripe's Machine Payments Protocol (MPP) enables AI agents to autonomously pay for tool usage on monetized MCP servers. Instead of a human authorizing each payment, your agent holds a payment budget and settles micro-payments per tool call — automatically.

This guide covers setting up your MCP client to connect to MPP-enabled servers and pay per use.

What Is Machine Payments Protocol?

MPP is Stripe's extension to MCP that adds a payment layer. When an MCP server exposes paid tools, the tool schema includes pricing metadata. Your MCP client (the agent host) presents a Stripe-issued machine wallet that settles charges on each tool invocation.

The flow looks like this:

code
AI Agent → MCP Client → [MPP Handshake] → MCP Server Tool
                              ↓
                    Stripe charges machine wallet
                    Tool executes and returns result

Prerequisites

  • Stripe account with MPP enabled (currently in beta — request access at stripe.com/mpp)
  • An MCP host (Claude Desktop, a custom agent, etc.)
  • Node.js 18+ or Python 3.10+
  • A monetized MCP server to connect to

Step 1: Create a Machine Wallet

A machine wallet is a Stripe object that represents your agent's payment identity and budget.

bash
# Install the Stripe CLI
npm install -g stripe

# Create a machine wallet via the Stripe API
curl https://api.stripe.com/v1/machine_wallets \
  -u sk_live_your_secret_key: \
  -d "display_name=My AI Agent" \
  -d "budget[amount]=10000" \
  -d "budget[currency]=usd" \
  -d "budget[period]=monthly"

This creates a wallet with a $100/month budget. Stripe returns a

code
machine_wallet_id
and a
code
machine_wallet_secret
— save both.

Step 2: Install the MPP MCP Client Adapter

bash
npm install @stripe/mcp-mpp-adapter

Step 3: Configure Your MCP Host

Add MPP credentials to your Claude Desktop config:

json
{
  "mcpServers": {
    "paid-data-server": {
      "command": "npx",
      "args": ["-y", "@stripe/mcp-mpp-adapter"],
      "env": {
        "UPSTREAM_MCP_SERVER": "https://api.example-mcp-server.com/mcp",
        "STRIPE_MACHINE_WALLET_ID": "mw_live_abc123",
        "STRIPE_MACHINE_WALLET_SECRET": "mws_live_xyz789",
        "MPP_MAX_PER_TOOL_CALL_USD": "0.50",
        "MPP_REQUIRE_CONFIRMATION_ABOVE_USD": "1.00"
      }
    }
  }
}

The adapter acts as a transparent proxy between your AI agent and the upstream MCP server, intercepting tool calls to handle payment negotiation.

Step 4: Understanding the MPP Handshake

When your client connects, the server advertises its pricing in the tool schema:

json
{
  "name": "search_financial_data",
  "description": "Search SEC filings and financial records",
  "inputSchema": { ... },
  "x-mpp-pricing": {
    "model": "per_call",
    "amount": 25,
    "currency": "usd",
    "unit": "cent"
  }
}

The adapter reads

code
x-mpp-pricing
, checks your wallet balance, and either:

  • Approves the charge and proceeds with the tool call
  • Blocks the call if it exceeds your
    code
    MPP_MAX_PER_TOOL_CALL_USD
    limit
  • Prompts for confirmation if configured above a threshold

Step 5: Set Spending Controls

You can fine-tune spending behavior with environment variables:

json
{
  "env": {
    "MPP_MAX_PER_TOOL_CALL_USD": "0.10",
    "MPP_MAX_SESSION_SPEND_USD": "5.00",
    "MPP_REQUIRE_CONFIRMATION_ABOVE_USD": "0.25",
    "MPP_BLOCKED_TOOLS": "generate_report,bulk_export",
    "MPP_ALLOW_SERVERS": "verified-servers.stripe.com"
  }
}
VariableDescription
code
MPP_MAX_PER_TOOL_CALL_USD
Hard cap per individual tool call
code
MPP_MAX_SESSION_SPEND_USD
Total spend limit for one session
code
MPP_REQUIRE_CONFIRMATION_ABOVE_USD
Ask human before paying above this amount
code
MPP_BLOCKED_TOOLS
Comma-separated list of tools to never pay for
code
MPP_ALLOW_SERVERS
Whitelist of MPP server domains

Step 6: Monitor Usage

View all machine wallet transactions in the Stripe Dashboard under Machine Payments → Wallets, or via API:

bash
curl https://api.stripe.com/v1/machine_wallet_transactions \
  -u sk_live_your_secret_key: \
  -d "machine_wallet=mw_live_abc123" \
  -d "limit=20"

Or set up webhooks for real-time spend alerts:

bash
stripe listen --events machine_wallet.balance_low,machine_wallet.transaction.created

Best Practices

  1. Start with low limits: Set
    code
    MPP_MAX_PER_TOOL_CALL_USD
    to $0.05 while testing
  2. Session caps: Always set
    code
    MPP_MAX_SESSION_SPEND_USD
    to prevent runaway costs
  3. Audit logs: Log every tool call and its cost to your own system
  4. Server verification: Only connect to servers on Stripe's verified MPP registry
  5. Separate wallets per agent: Create one machine wallet per AI agent for clear cost attribution
  6. Monthly budget: Set conservative monthly budgets and increase as you understand usage patterns

Troubleshooting

  • code
    mpp_wallet_insufficient_funds
    : Top up your wallet or increase the monthly budget
  • code
    mpp_server_not_verified
    : The server isn't in Stripe's MPP registry — add its domain to
    code
    MPP_ALLOW_UNVERIFIED=true
    only for testing
  • code
    mpp_pricing_exceeds_limit
    : A tool costs more than your
    code
    MPP_MAX_PER_TOOL_CALL_USD
    — raise the limit or use a cheaper server
  • Connection refused: Ensure the upstream MCP server URL supports the MPP protocol version you're running