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

@codespar/mcp-x402

v0.1.1

Published

MCP server for x402 — HTTP-native micropayments protocol by Coinbase (USDC on Base/Solana)

Readme

@codespar/mcp-x402

MCP server for x402 — HTTP-native micropayments protocol by Coinbase (USDC on Base/Solana)

npm License: MIT

What is x402?

x402 is an open protocol that enables machine-to-machine micropayments at the HTTP layer. When an AI agent requests a resource and receives HTTP 402 Payment Required, it automatically sends a USDC payment on-chain and retries — no checkout UI, no merchant integration, pure HTTP.

This is the payment rail purpose-built for agentic commerce.

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "x402": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-x402"],
      "env": {
        "X402_API_KEY": "your-key",
        "X402_WALLET_ADDRESS": "your-wallet-address"
      }
    }
  }
}

Claude Code

claude mcp add x402 -- npx @codespar/mcp-x402

Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

{
  "servers": {
    "x402": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-x402"],
      "env": {
        "X402_API_KEY": "your-key",
        "X402_WALLET_ADDRESS": "your-wallet-address"
      }
    }
  }
}

Tools

| Tool | Description | |------|-------------| | pay_request | Pay for a 402-protected resource and return its content | | verify_payment | Verify if a x402 payment was received and settled on-chain | | create_paywall | Create a x402 paywall configuration for an endpoint | | get_paywall | Get paywall configuration for a URL | | list_paywalls | List all configured paywalls | | delete_paywall | Remove a paywall from an endpoint | | get_balance | Get available USDC balance for x402 payments | | list_payments | List x402 payment history with filters | | get_payment | Get details of a specific x402 payment | | get_supported_networks | List supported blockchain networks and tokens |

Authentication

x402 uses a Bearer API key from a registered facilitator.

Get your credentials

  1. Visit the x402 documentation
  2. Set up a facilitator or use Coinbase's hosted facilitator
  3. Generate an API key
  4. Get your wallet address (Base or Solana)
  5. Set the environment variables

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | X402_API_KEY | Yes | API key for x402 facilitator | | X402_WALLET_ADDRESS | Yes | Wallet address for sending/receiving payments | | X402_NETWORK | No | Blockchain network: base (default) or solana |

Use Cases

  • Agent accessing premium APIs — AI agent pays per-request for data feeds, LLM APIs, or premium content
  • Micropayment monetization — Protect your API endpoints with sub-cent paywalls
  • Machine-to-machine commerce — Agents autonomously purchasing compute, data, or services

Roadmap

v0.2 (planned)

  • create_subscription — Set up recurring micropayments for an endpoint
  • estimate_cost — Estimate cost before paying for a resource
  • batch_pay — Pay for multiple resources in a single transaction

v0.3 (planned)

  • Multi-token support (ETH, SOL beyond USDC)
  • Streaming payments for long-running agent tasks

Want to contribute? Open a PR or request a tool.

Links

License

MIT