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

@mawdbotsonsolana/x402-claude-mcp

v0.1.0

Published

x402 payments + discovery MCP server for Claude Code on Solana - Autonomous payments for AI agents

Downloads

40

Readme

x402-claude-mcp

╔══════════════════════════════════════════════════════════════════════╗
║  ██╗  ██╗██╗  ██╗ ██████╗ ██████╗                                    ║
║  ╚██╗██╔╝██║  ██║██╔═████╗╚════██╗                                   ║
║   ╚███╔╝ ███████║██║██╔██║ █████╔╝                                   ║
║   ██╔██╗ ╚════██║████╔╝██║██╔═══╝                                    ║
║  ██╔╝ ██╗     ██║╚██████╔╝███████╗                                   ║
║  ╚═╝  ╚═╝     ╚═╝ ╚═════╝ ╚══════╝                                   ║
║                                                                       ║
║  CLAUDE MCP SERVER                                                    ║
║  Autonomous payments for AI agents on Solana                          ║
║                                                                       ║
║  Discovery • Payments • Browser • Terminal                            ║
╚══════════════════════════════════════════════════════════════════════╝

HTTP 402 Payment Required - The status code that's been waiting 30 years for its moment. That moment is now.

What is this?

This is the missing piece that lets Claude Code autonomously:

  • 🔍 Discover x402-enabled services via XGATE
  • 💸 Pay for API calls with USDC on Solana (~$0.00025 per tx)
  • 🌐 Browse websites with Playwright
  • 💻 Execute terminal commands
  • 💰 Manage wallet and spending limits

Built on the x402 protocol - the internet's native payment standard.

The Vision

          ┌─────────────────────────────────────────────────────────────┐
          │                     CLAUDE CODE                              │
          │                         │                                    │
          │                    ┌────┴────┐                               │
          │                    │   MCP   │                               │
          │                    └────┬────┘                               │
          │                         │                                    │
          │              ┌──────────┼──────────┐                         │
          │              ▼          ▼          ▼                         │
          │         ┌────────┐ ┌────────┐ ┌────────┐                     │
          │         │ x402   │ │Browser │ │Terminal│                     │
          │         │Payments│ │  Tool  │ │  Tool  │                     │
          │         └───┬────┘ └────────┘ └────────┘                     │
          │             │                                                │
          │     ┌───────┴───────┐                                        │
          │     ▼               ▼                                        │
          │ ┌────────┐    ┌──────────┐                                   │
          │ │ XGATE  │    │  Solana  │                                   │
          │ │Registry│    │  USDC    │                                   │
          │ └───┬────┘    └────┬─────┘                                   │
          │     │              │                                         │
          │     ▼              ▼                                         │
          │ ┌───────────────────────────────────────┐                    │
          │ │        x402-Enabled Services          │                    │
          │ │  Firecrawl • Zyte • Gloria • DeFi API │                    │
          │ │  Smart Money • Heurist • + thousands  │                    │
          │ └───────────────────────────────────────┘                    │
          └─────────────────────────────────────────────────────────────┘

Build with Lucid → Distribute through XGATE → Get paid on x402

Quick Start

1. Install

npm install
npx playwright install chromium  # For browser tool

2. Configure

Create a .env file:

# Solana RPC (use a fast RPC for best results)
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com

# Your wallet (base58 private key OR path to keypair file)
SOLANA_PRIVATE_KEY=your-base58-encoded-private-key
# OR
SOLANA_KEYPAIR_PATH=/path/to/keypair.json

# Network: solana-mainnet or solana-devnet
X402_NETWORK=solana-mainnet

# Spending limits (in USDC)
X402_MAX_AUTO_APPROVE=1.0    # Max per single request
X402_DAILY_LIMIT=10.0        # Max per day

3. Add to Claude Code

Add this to your Claude Code MCP configuration:

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "x402": {
      "command": "npx",
      "args": ["tsx", "/path/to/x402-claude-mcp/src/index.ts"],
      "env": {
        "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com",
        "SOLANA_PRIVATE_KEY": "your-base58-private-key",
        "X402_NETWORK": "solana-mainnet",
        "X402_MAX_AUTO_APPROVE": "1.0",
        "X402_DAILY_LIMIT": "10.0"
      }
    }
  }
}

4. Use It

Now Claude can:

You: Find me services that can scrape websites

Claude: [calls x402_discover with query "scrape"]
        I found 3 x402 services for web scraping:
        - Firecrawl ($0.01/request) - Turn websites into LLM-ready data
        - Zyte ($0.001/request) - Browser rendering and extraction
        ...

You: Use Firecrawl to scrape https://example.com

Claude: [calls x402_call_service with serviceId "firecrawl"]
        [automatically pays 0.01 USDC via Solana]
        Here's the scraped content: ...

Available Tools

Discovery Tools

| Tool | Description | |------|-------------| | x402_discover | Search for x402 services by capability | | x402_list_services | List all registered services |

Payment Tools

| Tool | Description | |------|-------------| | x402_wallet_status | Check USDC/SOL balance and limits | | x402_check_payment | Check if URL requires payment (without paying) |

HTTP Tools (with auto-payment)

| Tool | Description | |------|-------------| | x402_get | GET request with automatic x402 payment | | x402_post | POST request with automatic x402 payment | | x402_call_service | Call a registered service by ID |

Browser Tools

| Tool | Description | |------|-------------| | browser_goto | Navigate to URL | | browser_screenshot | Take screenshot | | browser_extract_text | Extract page text | | browser_click | Click element | | browser_type | Type in input |

Terminal Tools

| Tool | Description | |------|-------------| | terminal_run | Execute shell command |

Architecture

src/
├── index.ts              # Entry point
├── x402/
│   ├── types.ts          # x402 protocol types
│   ├── solana-client.ts  # Solana payment client
│   └── middleware.ts     # Auto-pay fetch middleware
├── discovery/
│   ├── registry.ts       # Local service registry
│   └── xgate.ts          # XGATE discovery integration
├── tools/
│   ├── browser.ts        # Playwright browser
│   ├── terminal.ts       # Command execution
│   └── http.ts           # x402-enabled HTTP
└── mcp/
    └── server.ts         # MCP server implementation

How x402 Works

1. Agent requests resource
   GET https://api.example.com/premium-data

2. Server responds 402
   HTTP/1.1 402 Payment Required
   {
     "scheme": "exact",
     "network": "solana-mainnet",
     "maxAmountRequired": "10000",  // 0.01 USDC (6 decimals)
     "asset": "USDC",
     "payTo": "RecipientAddress..."
   }

3. Agent pays via Solana
   → Creates USDC transfer transaction
   → Signs with wallet
   → Sends to network (~400ms finality)

4. Agent retries with payment proof
   GET https://api.example.com/premium-data
   X-PAYMENT: <base64-encoded-receipt>

5. Server verifies and responds
   HTTP/1.1 200 OK
   { "data": "Premium content here..." }

Security

Spending Limits

X402_MAX_AUTO_APPROVE=1.0   # Won't auto-pay more than $1 per request
X402_DAILY_LIMIT=10.0       # Hard stop at $10/day

Command Blacklist

Terminal tool blocks dangerous commands:

  • rm -rf /
  • dd if=
  • mkfs
  • shutdown / reboot

Wallet Isolation

Use a dedicated wallet for agent payments, not your main holdings.

Ecosystem

This integrates with:

Contributing

PRs welcome. This is how we build the agentic payments future.

License

MIT


 ██╗   ██╗██████╗ ██╗████████╗
 ██║   ██║██╔══██╗██║╚══██╔══╝
 ██║   ██║██████╔╝██║   ██║   
 ██║   ██║██╔══██╗██║   ██║   
 ╚██████╔╝██████╔╝██║   ██║   
  ╚═════╝ ╚═════╝ ╚═╝   ╚═╝   
                               
 ██████╗ ██╗████████╗
 ██╔══██╗██║╚══██╔══╝
 ██████╔╝██║   ██║   
 ██╔══██╗██║   ██║   
 ██████╔╝██║   ██║   
 ╚═════╝ ╚═╝   ╚═╝   
                               
 Built with 💜 by 8bit
 Powered by x402 on Solana