- MoltPe
MoltPe
MoltPe Agent Payments
Payment infrastructure for AI agents — reference implementation with x402, MPP, and fiat payment paths.
Disclaimer: This is a reference implementation with mock data. For production, implement real PaymentProvider adapters. MoltPe's production server is at moltpe.com/mcp.
What This Is
This repository contains a reference implementation for handling payments in AI agent systems. It supports three payment paths: stablecoin micropayments (x402), session-based streaming (MPP), and traditional fiat rails. The goal is to show how agents can pay, get paid, and manage money across different protocols.
Quick Start
# MCP Server — payment tools for AI agents
cd mcp-server && npm install && npm start
# Server runs on port 3000 with 11 MCP tools
# Connect Claude Desktop with config from examples/claude-desktop-config.json
# x402 Client — stablecoin micropayments
cd x402-client && npm install && npm run build
# Use in your project:
# import { pay } from '@moltpe/x402-client'
See mcp-server/README.md and x402-client/README.md for full usage.
Demo
Start the server and open http://localhost:3000 to explore all 11 payment tools interactively.
The demo includes:
- Tool explorer with editable inputs for every MCP tool
- Live balance tracking across stablecoin, session, and fiat providers
- MPP session budget visualizer with real-time progress
- Invoice lifecycle: create → send → track → collect
- Transaction timeline of all actions
Run with mock data (default) or connect to MoltPe's live MCP server.
See mcp-server/DEMO.md for a step-by-step walkthrough.
Live Mode
cd mcp-server
PROVIDER_MODE=live MOLTPE_AGENT_TOKEN=swai_... npm start
Connects to moltpe.com/mcp for real on-chain transactions. See mcp-server/README.md for setup.
What's Inside
| Directory | Description |
|---|---|
research/ | Market research, protocol analysis, competitive landscape |
mcp-server/ | MCP payment server with 11 tools, 3 mock providers (x402, MPP, fiat), 53 tests |
x402-client/ | TypeScript x402 client SDK with facilitator adapters and interceptors, 34 tests |
playbook/ | Build playbook: process, templates, results from building this |
docs/ | Architecture docs, protocol landscape, market analysis |
Tri-Rail Architecture
This implementation supports three parallel payment paths:
- Path A — Stablecoin (x402): Per-request micropayments settled on-chain in USDC
- Path B — Session-based (MPP): Authorize a budget, stream payments within a session
- Path C — Fiat: Traditional card authorization, capture, and settlement
Each path serves different use cases. A collections layer sits above all three to handle agent receivables.
flowchart TD
Agent[AI Agent] --> Collections[Collections Layer<br/>Invoicing · Billing · Receivables]
Collections --> A[Stablecoin Path<br/>x402]
Collections --> B[Session Path<br/>MPP]
Collections --> C[Fiat Path<br/>Card / Bank]
A --> A1[USDC Micropayments]
A1 --> A2[On-chain Settlement<br/>Polygon · Base]
B --> B1[Budget Sessions]
B1 --> B2[Streaming Settlement<br/>Tempo Network]
C --> C1[Card Authorization]
C1 --> C2[Gateway Settlement<br/>Razorpay · Stripe]
classDef agent fill:#0ea5e9,stroke:#0284c7,color:#fff
classDef collections fill:#f59e0b,stroke:#d97706,color:#fff
classDef x402 fill:#22d3ee,stroke:#06b6d4,color:#000
classDef mpp fill:#a78bfa,stroke:#8b5cf6,color:#000
classDef fiat fill:#34d399,stroke:#10b981,color:#000
class Agent agent
class Collections collections
class A,A1,A2 x402
class B,B1,B2 mpp
class C,C1,C2 fiat
See docs/tri-rail-architecture.md for the full breakdown.
Research Highlights
- Verified agent payment volume is $1.6M/month — not the $43M self-reported (48-86% is artificial). See research/data/verified-volumes.md.
- Agent collections/receivables is a near-total market gap — only PayPal MCP exists, ecosystem-locked. See docs/collections-gap.md.
- Four protocols (x402, MPP, ACP, AP2) are converging into layers, not competing head-to-head. See docs/protocol-landscape.md.
Quality & Security
| Metric | Value |
|---|---|
| Tests | 87 (53 mcp-server + 34 x402-client) |
| Pass rate | 100% |
| Statement coverage | 86.2% / 95.9% |
| Runtime dependencies | 0 (both packages) |
| npm audit | 0 vulnerabilities |
| Secret scan | 0 findings |
See QUALITY.md for full coverage breakdowns and scan results. See SECURITY.md for vulnerability reporting and security posture. See docs/production-security-checklist.md for the 64-item production deployment checklist.
Integration Examples
Looking to integrate MoltPe Agent Payments with your AI framework? These issues track planned integrations with example code:
- LangChain tool wrapper — Use MCP payment tools as LangChain tools
- AutoGen agent — Payment-capable AutoGen agent with budget guardrails
- Base Sepolia testnet — Real on-chain x402 payments on testnet
- Webhook notifications — Event-driven payment notifications
- Security hardening docs — Threat model and hardening guide
- Eliza plugin — Payment plugin for the Eliza agent framework
Contributions welcome — pick an issue and open a PR.
Deep Dives
Long-form guides covering the MoltPe stack, AI agent payment patterns, and India-specific integration:
For developers evaluating MoltPe
- Why developers choose MoltPe for AI agent payments — five honest reasons, including the tradeoffs
- Integrate MoltPe in 5 minutes: developer quickstart — REST, MCP, x402, Python — all four integration paths with real code
- MoltPe vs building your own AI payment stack — the build-vs-buy analysis with real time estimates
- MoltPe developer experience: a deep dive — error messages, docs, testnet, rate limits
- The MCP server for AI agent payments, explained — Claude Desktop / Cursor / Windsurf config + tool surface
For Indian developers and AI startups
- AI Agent Payments in India: The Complete Infrastructure Guide (2026) — pillar guide for India
- The Cost of AI Agent Payments in India: 2026 Benchmark — 4-scenario cost comparison, 15-28x savings over PayPal
- USDC payments for Indian developers — USDC vs Razorpay vs Stripe India vs PayPal
- Freelance AI developer payments in India — the forex-avoidance playbook
- The complete payments stack for Indian AI startups — 3-layer stack: UPI + MoltPe + agent-to-agent
- x402 protocol for Indian developers — API monetization in USDC
Protocols and fundamentals
- What are AI agent payments?
- The x402 protocol: complete guide
- Machine Payments Protocol (MPP) guide
- AI agent spending policies explained
Short answers (Q&A format)
- What is an AI agent wallet?
- How do AI agents make payments?
- What is an AI agent spending policy?
- How to monetize an API in USDC
Also: FAQ · Glossary · Use cases · Developer docs
License
- Code (everything outside
research/,playbook/,docs/): Apache License 2.0 - Content (
research/,playbook/,docs/): Creative Commons Attribution-ShareAlike 4.0
See NOTICE for attribution details.
Citation
@software{moltpe_agent_payments,
author = {Gupta, Umang},
title = {MoltPe Agent Payments},
year = {2026},
url = {https://github.com/umangbuilds/moltpe-agent-payments},
license = {Apache-2.0}
}
Author
Created by Umang Gupta. MoltPe builds payment infrastructure for AI agents.
Server Config
{
"mcpServers": {
"moltpe": {
"command": "npx",
"args": [
"-y",
"@moltpe/mcp-server"
],
"env": {
"MOLTPE_API_KEY": "<YOUR_API_KEY>"
}
}
}
}