Claude Code + MoltPe: Agent Payments Setup Guide (2026)
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:
- Paid search APIs for up-to-date docs and primary sources.
- Private or rate-limited datasets from marketplaces.
- Paid GPU inference for embedding, vision, or generation during a build.
- Deploy targets (Cloud Run, Fly, managed Postgres) that cost money to provision.
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
- Committing the MoltPe token. Always use
${MOLTPE_AGENT_TOKEN}variable expansion in.claude/mcp.json. Auditgit log -pfor past leaks before making a repo public. - Too-loose policies. $1000/day is not a policy, it is an invitation. Start tight ($10/day, $0.50/call), observe a week of real usage, raise only after you see patterns.
- Skipping
/mcpverification. If the server appears with zero tools, the header is wrong or the token is invalid. Don't assume connection — check. - Approving
moltpe:send_paymentglobally. Scope this permission to ask-every-time. Reads (balance, transactions, x402) can be auto-approved; raw sends should not.
Related Reading
Frequently Asked Questions
Is MoltPe an official Claude Code MCP server?
MoltPe is a third-party MCP server that Claude Code can load like any other streamable-HTTP or stdio server. The MCP protocol is open and Claude Code supports any compliant server. MoltPe's server at https://mcp.moltpe.com/v1/sse exposes wallet, payment, and x402 tools.
Can Claude Code pay for paid APIs during a coding session?
Yes. Once the MoltPe MCP server is connected, Claude Code can call call_x402_endpoint to access any x402-enabled API (paid search, private datasets, premium docs, GPU inference). MoltPe handles the 402 negotiation on the server side and returns the resource body to Claude Code.
What policy settings make sense for a coding agent?
For an interactive coding agent, a good starting policy is $0.50 per call, $10 per day, allowed networks polygon and base, recipients restricted to a short allowlist (your paid APIs, known package registries, known data marketplaces). Raise caps slowly as trust grows. Audit the ledger weekly for surprises.
Can I scope different wallets per project or worktree?
Yes. Create one MoltPe agent per project (claude-code-moltpe, claude-code-sideproject) and configure MoltPe MCP per project via .claude/mcp.json at the repo root. Claude Code loads project-scoped MCP config on top of the user config, so each project automatically authenticates as the right wallet.
How does this compare to giving Claude Code a Stripe key?
A Stripe secret key has no per-call caps, no per-recipient allowlist, and no notion of an isolated agent — if the session is compromised, the whole Stripe account is compromised. A MoltPe agent token is sandboxed by policy on the server side and can only spend what its policy allows, to recipients its policy approves. Different security model for different use case.
Give Claude Code its own wallet
One MCP server, five tools, a policy-bounded USDC wallet. Your coding agent can now buy data, pay APIs, and deploy infra — within the caps you set.
Get Started Free →About MoltPe
MoltPe is AI-native payment infrastructure that gives AI agents isolated wallets with programmable spending policies for autonomous USDC transactions. Live on Polygon PoS, Base, and Tempo. Supports MCP, x402, and REST API, with first-class integrations for LangChain, CrewAI, AutoGen, and Claude Code.