Why Claude Code + MoltPe

Claude Code is Anthropic's agentic coding CLI. In a typical session it reads files, runs shell commands, edits source, and calls MCP tools on your behalf. Every one of those actions is free today — but a lot of what developers actually need during a session is not:

MoltPe gives Claude Code its own USDC wallet with server-enforced spending policy, exposed as a standard MCP server. Claude Code loads the wallet and payment tools just like any other MCP server — no patches, no forks, no shared secrets — and the wallet is bounded by a policy you control from the MoltPe dashboard.

The result: Claude Code can autonomously spend a bounded amount during a session, the same way it autonomously edits files under /permissions. If the session goes sideways, the blast radius is capped at the agent's daily USDC policy, not your whole billing account.

Prerequisites

You need Claude Code installed, a MoltPe account, and a clear idea of how much autonomy you want to grant. "Autonomous within $10/day for coding workloads" is a reasonable starting point.

npm install -g @anthropic-ai/claude-code
claude --version        # verify install

# Create an account at https://moltpe.com, then create an agent named "claude-code"
# Copy the agent token into an env var (never commit it)
export MOLTPE_AGENT_TOKEN="mpt_live_..."

In the MoltPe dashboard, set a coding workload policy on the agent: per-call cap $0.50, daily cap $10, allowed networks polygon and base, allowed recipients either "any" (if your agent will shop freely) or a short allowlist (if you want to stay inside known marketplaces). Fund with test USDC from the dashboard faucet.

Approach 1: User-Scoped MCP Config

The simplest install — Claude Code loads the MoltPe MCP server on every session. Use this when you want one coding-agent wallet across all your projects.

claude mcp add moltpe \
  --scope user \
  --transport http \
  --url https://mcp.moltpe.com/v1/sse \
  --header "Authorization: Bearer ${MOLTPE_AGENT_TOKEN}"

The command writes an entry to your user-scoped Claude Code settings, something like this. Inspect it with claude mcp list or by opening the config file directly.

{
  "mcpServers": {
    "moltpe": {
      "type": "http",
      "url": "https://mcp.moltpe.com/v1/sse",
      "headers": {
        "Authorization": "Bearer mpt_live_REDACTED"
      }
    }
  }
}

Start a new Claude Code session and type /mcp. You should see moltpe listed with five tools: check_balance, send_payment, list_transactions, call_x402_endpoint, agent_info. If they are missing, run claude mcp get moltpe to see the live status — a bad token shows up as a 401 in the MCP connect log.

Quick smoke test directly in the prompt: "What is my current MoltPe balance?" Claude Code should call moltpe:check_balance and return the USDC figure, gated by your normal tool-approval prompts. Approve once, persist the permission, and you are live.

Approach 2: Project-Scoped MCP Config

For production repos, a project-scoped config is safer. Each repo gets its own MoltPe agent — so the moltpe-backend repo has one wallet, a side project has another, and an accidental send_payment in the wrong repo cannot touch the wrong wallet.

Create .claude/mcp.json at the root of the repo. Claude Code merges this on top of the user config, and it is safely checkable into git with the token removed:

{
  "mcpServers": {
    "moltpe": {
      "type": "http",
      "url": "https://mcp.moltpe.com/v1/sse",
      "headers": {
        "Authorization": "Bearer ${MOLTPE_AGENT_TOKEN}"
      }
    }
  }
}

Claude Code expands ${MOLTPE_AGENT_TOKEN} from the shell env at startup, so the token never lands in git. Commit the config, add .env to .gitignore, and document which MoltPe agent the project uses in README.md.

For multi-repo teams, combine with Claude Code's /permissions rules: allow moltpe:check_balance and moltpe:call_x402_endpoint automatically, but require approval for moltpe:send_payment. The MoltPe policy is the hard ceiling; the Claude Code permission is the soft ceiling. Two independent safety layers.

End-to-End Example: Coding Agent That Pays

Concrete scenario: you ask Claude Code to add a geocoding feature to your app. It needs fresh postal-code data from a paid dataset. With MoltPe connected, the session looks like this.

# Start Claude Code in your project
cd ~/projects/my-app
claude

# Your prompt:
# "Add a /geocode endpoint that returns lat/lon for Indian pincodes.
#  Buy the postal dataset from https://data.example.com/v1/in-pincodes-2026.
#  Budget: max $1 for the dataset."

Claude Code, with the MoltPe MCP loaded, plans: check balance, fetch dataset via x402, parse it, write the endpoint, test. The tool calls you will see approved (once) and then executed during the session look like:

// Tool call 1
{ "tool": "moltpe:check_balance", "arguments": {} }
// Response: "9.82 USDC on polygon"

// Tool call 2
{
  "tool": "moltpe:call_x402_endpoint",
  "arguments": {
    "url": "https://data.example.com/v1/in-pincodes-2026",
    "method": "GET",
    "max_payment_usd": 1.00
  }
}
// Response body: { "pincodes": [...] }  (saved to data/pincodes.json)

// Tool call 3
{ "tool": "moltpe:list_transactions", "arguments": { "limit": 1 } }
// Response: [{ "tx_hash": "0xabc...", "amount_usd": 0.85, "memo": "x402 proxy: data.example.com" }]

The dataset is on disk, Claude Code writes the endpoint, tests pass, total spend is $0.85 out of a $1 ceiling. MoltPe's dashboard shows the transaction with its memo; your ledger reconciles cleanly against the coding session transcript. Compare this to the 5-minute developer quickstart — same primitives, different host.

Common Pitfalls