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.
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:
AI Agent → MCP Client → [MPP Handshake] → MCP Server Tool
↓
Stripe charges machine wallet
Tool executes and returns resultPrerequisites
- ▸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.
# 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
machine_wallet_idmachine_wallet_secretStep 2: Install the MPP MCP Client Adapter
npm install @stripe/mcp-mpp-adapterStep 3: Configure Your MCP Host
Add MPP credentials to your Claude Desktop config:
{
"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:
{
"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
x-mpp-pricing- ▸Approves the charge and proceeds with the tool call
- ▸Blocks the call if it exceeds your limitcode
MPP_MAX_PER_TOOL_CALL_USD - ▸Prompts for confirmation if configured above a threshold
Step 5: Set Spending Controls
You can fine-tune spending behavior with environment variables:
{
"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"
}
}| Variable | Description |
|---|---|
code | Hard cap per individual tool call |
code | Total spend limit for one session |
code | Ask human before paying above this amount |
code | Comma-separated list of tools to never pay for |
code | 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:
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:
stripe listen --events machine_wallet.balance_low,machine_wallet.transaction.createdBest Practices
- ▸Start with low limits: Set to $0.05 while testingcode
MPP_MAX_PER_TOOL_CALL_USD - ▸Session caps: Always set to prevent runaway costscode
MPP_MAX_SESSION_SPEND_USD - ▸Audit logs: Log every tool call and its cost to your own system
- ▸Server verification: Only connect to servers on Stripe's verified MPP registry
- ▸Separate wallets per agent: Create one machine wallet per AI agent for clear cost attribution
- ▸Monthly budget: Set conservative monthly budgets and increase as you understand usage patterns
Troubleshooting
- ▸: Top up your wallet or increase the monthly budgetcode
mpp_wallet_insufficient_funds - ▸: The server isn't in Stripe's MPP registry — add its domain tocode
mpp_server_not_verifiedonly for testingcodeMPP_ALLOW_UNVERIFIED=true - ▸: A tool costs more than yourcode
mpp_pricing_exceeds_limit— raise the limit or use a cheaper servercodeMPP_MAX_PER_TOOL_CALL_USD - ▸Connection refused: Ensure the upstream MCP server URL supports the MPP protocol version you're running