npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@moltpe/mcp-payments

v0.1.2

Published

MCP payment tools for AI agents — reference implementation with x402, MPP, and fiat

Downloads

32

Readme

MCP Payment Server — Reference Implementation

Part of moltpe-agent-payments. See also: x402 Client SDK | Research

Payment tools for AI agents via MCP (Model Context Protocol). Supports three payment rails: stablecoin (x402), session-based (MPP), and fiat (card/bank).

Disclaimer: This is a reference implementation with mock data. All balances, transactions, and payments are simulated. For production, implement real PaymentProvider adapters. MoltPe's production server is at moltpe.com/mcp.

Quick Start

cd mcp-server
npm install
npm start

The server starts on port 3000 with all three providers loaded.

Interactive Demo

Start the server and visit http://localhost:3000 in your browser for a visual tool explorer. Click any tool to see its request/response JSON. Switch between Stablecoin, Session, and Fiat providers.

See DEMO.md for a full walkthrough.

Provider Flags

node server.js --provider stablecoin   # x402 USDC micropayments
node server.js --provider session      # MPP session-based payments
node server.js --provider fiat         # Card and bank transfer
node server.js --provider all          # All three (default)

Tools

| Tool | Description | Providers | |------|-------------|-----------| | check_balance | Get agent balance | All | | list_transactions | Transaction history | All | | agent_info | Agent details and capabilities | All | | send_payment | Send payment to another agent | All | | call_x402_endpoint | Call x402-protected HTTP endpoint | Stablecoin | | create_invoice | Create a payment invoice | All | | check_invoice_status | Check invoice status | All | | list_invoices | List invoices for an agent | All | | pay_invoice | Pay an invoice via any provider | All | | create_payment_session | Create an MPP payment session | Session | | get_session_status | Check session status | Session |

Architecture

┌──────────────────────────────────────┐
│           MCP Server (JSON-RPC)       │
├──────────────────────────────────────┤
│  Auth Middleware  |  Rate Limiter     │
├──────────────────────────────────────┤
│              11 MCP Tools             │
│  (check_balance, send_payment, ...)   │
├──────────────────────────────────────┤
│           Provider Router             │
├────────────┬───────────┬─────────────┤
│ Stablecoin │  Session  │    Fiat     │
│   (x402)   │   (MPP)   │ (card/bank) │
└────────────┴───────────┴─────────────┘

When to Use Which Provider

| Use case | Provider | Why | |----------|----------|-----| | Per-request API micropayments | Stablecoin (x402) | Immediate on-chain settlement in USDC | | Multi-call session with budget cap | Session (MPP) | One authorization, stream payments, refund unused | | Enterprise billing, existing card setup | Fiat | Standard card/bank rails, 1-3 day settlement | | Agent invoicing and collections | Any | Collections layer sits above all three rails |

Test Agents

| Agent | Description | Stablecoin | Session | Fiat | |-------|-------------|------------|---------|------| | agent-alice | Active trader | 175 USDC (3 chains) | $200 USD | $500 USD, INR, AED | | agent-bob | Service provider | 350 USDC (2 chains) | $500 USD | $1,200 USD, INR | | agent-charlie | New agent | 10 USDC (1 chain) | $25 USD | $50 USD |

Auth tokens: test-token-alice, test-token-bob, test-token-charlie

Docker

docker build -t moltpe-mcp .
docker run -p 3000:3000 moltpe-mcp

Or with docker-compose:

docker-compose up

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | PORT | 3000 | Server port | | AUTH_ENABLED | false | Require bearer token authentication | | RATE_LIMIT | 60 | Max requests per minute per IP |

Examples

See the examples/ directory for:

  • Claude Desktop configuration
  • Claude Code setup
  • Programmatic tool calling
  • MPP session workflow
  • Protocol comparison (same task, three ways)

Health Check

curl http://localhost:3000/health

Returns: {"status":"ok","provider":"all"}

Tests

npm test

Runs 53 test cases across all providers.

Related Docs

License

Apache License 2.0