Proxy
← Back to Blog
TutorialApril 8, 2026

How to Give Claude Code a Credit Card with Proxy

Step-by-step tutorial for giving Claude Code payment capabilities using Proxy virtual cards, MCP integration, and spend policies.

Proxy
Proxy Team
5 min read

If you want to give Claude Code a credit card, you need more than just a card number pasted into a prompt. You need dedicated payment infrastructure that issues cards on demand, enforces spending limits, and gives you a full audit trail.

This tutorial walks you through setting up Proxy with Claude Code so your agent can make real purchases safely.

What You Will Need

Before starting, make sure you have:

  • A Proxy account (sign up here)
  • Claude Code installed (npm install -g @anthropic-ai/claude-code)
  • Node.js 18+ on your machine
  • A funded Proxy wallet (ACH, wire, or USDC)

The whole setup takes about 10 minutes.

Step 1: Install the Proxy CLI

The Proxy CLI lets you manage cards, policies, and transactions from your terminal.

npm install -g @anthropic-ai/proxy-cli
proxy auth login

After logging in, verify your connection:

proxy whoami

You should see your account ID, funding balance, and active policies.

Step 2: Create a Spending Policy

Before issuing any cards, define what Claude Code is allowed to do. Policies are the guardrails that prevent runaway spending.

proxy policy create \
  --name "claude-code-dev-tools" \
  --max-per-transaction 100 \
  --max-daily 500 \
  --allowed-merchants "github.com,aws.amazon.com,vercel.com,namecheap.com" \
  --require-approval-above 50

This policy caps each transaction at $100, limits daily spend to $500, restricts purchases to specific merchants, and requires your manual approval for anything over $50.

You can also create policies via the API:

curl -X POST https://api.useproxy.ai/v1/policies \
  -H "Authorization: Bearer $PROXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "claude-code-dev-tools",
    "max_per_transaction_cents": 10000,
    "max_daily_cents": 50000,
    "allowed_merchants": ["github.com", "aws.amazon.com", "vercel.com"],
    "require_approval_above_cents": 5000
  }'

Step 3: Configure MCP for Claude Code

MCP (Model Context Protocol) is how Claude Code connects to external tools like Proxy. You need to add the Proxy MCP server to your Claude Code configuration.

Open your Claude Code MCP config file:

code ~/.claude/mcp.json

Add the Proxy server:

{
  "mcpServers": {
    "proxy-pay": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/proxy-mcp-server"],
      "env": {
        "PROXY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Save the file and restart Claude Code. You should see "proxy-pay" listed when Claude Code initializes its MCP connections.

Step 4: Test the Integration

Ask Claude Code to make a small test purchase:

Buy the cheapest .dev domain on Namecheap for my project "hello-agents"

Here is what happens behind the scenes:

  1. Claude Code calls proxy.createIntent with the purchase details
  2. Proxy validates the intent against your spending policy
  3. If approved, Proxy issues a single-use virtual card
  4. Claude Code receives the card details and fills the checkout form
  5. The transaction settles and Proxy records the full audit trail

You can verify the transaction:

proxy transactions list --last 1

Step 5: Review and Approve (Optional)

If your policy includes approval requirements, Claude Code will pause and wait for your sign-off. You will see a prompt like:

[Proxy] Approval required: $24.99 at namecheap.com
Purpose: Register hello-agents.dev domain
Approve? (y/n)

Type y to approve, and the transaction proceeds. This human-in-the-loop pattern is critical for keeping agent spending safe.

Using with Claude Desktop and Cursor

The same MCP configuration works with Claude Desktop and Cursor. The only difference is the config file location.

Claude Desktop (~/.claude/mcp.json):

{
  "mcpServers": {
    "proxy-pay": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/proxy-mcp-server"],
      "env": {
        "PROXY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Cursor (.cursor/mcp.json in your project root):

{
  "mcpServers": {
    "proxy-pay": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/proxy-mcp-server"],
      "env": {
        "PROXY_API_KEY": "your-api-key-here"
      }
    }
  }
}

For more on setting up Cursor specifically, see our Cursor payments tutorial.

What Claude Code Can Buy

With Proxy configured, Claude Code can handle tasks like:

  • Domain registration: "Buy example.dev on Namecheap"
  • SaaS subscriptions: "Subscribe to the Pro plan on Vercel"
  • API credits: "Top up our OpenAI account with $50"
  • Cloud resources: "Spin up a $20/month Postgres instance on Neon"
  • Dev tools: "Purchase a Raycast Pro license"

Each purchase is isolated to its own virtual card, with its own spend limit, tied to a declared intent. If the card details leak, the damage is contained to that single transaction.

Security Best Practices

A few tips for production use:

  1. Start with low limits. You can always increase them later.
  2. Use single-use cards for one-off purchases. The card burns after the first successful charge.
  3. Enable approval flows for anything over your comfort threshold.
  4. Review the audit log weekly. Every transaction links back to the agent, the intent, and the policy that authorized it.
  5. Rotate API keys on a regular schedule, just like any other credential.

For a deeper dive into agent payment security, check out our spending security checklist.

Get Started

Proxy is the fastest way to give Claude Code real payment capabilities without sharing your personal card. Create a free account at useproxy.ai, configure MCP in under five minutes, and let your agent start handling purchases with the guardrails you define.

Related

Looking for agent spending controls? Start with virtual cards, then choose a plan that fits your workload.

Ready to get started?

Issue your first virtual card in minutes.