Skip to main content
Glama
AiAgentKarl

x402 Payment Gateway MCP Server

by AiAgentKarl

x402 Payment Gateway MCP Server ๐Ÿ’ฐ

MCP Server that enables micropayments between AI agents using USDC on Solana. Based on the x402 protocol (HTTP 402 Payment Required).

What is x402?

x402 is a protocol that lets AI agents pay for services automatically. When an agent calls a premium tool, it gets a "402 Payment Required" response with payment instructions. The agent pays via blockchain, then gets access.

Related MCP server: x402 MCP Payment

Features

  • Payment Requests โ€” Create x402-compatible payment requests for any tool

  • On-Chain Verification โ€” Verify USDC payments directly on Solana

  • Tool Pricing โ€” Set per-call prices for individual tools

  • Revenue Tracking โ€” Dashboard with total revenue, per-tool breakdown

  • Payment History โ€” Full audit trail of all transactions

Installation

pip install x402-mcp-server

Configuration

Set your merchant wallet in .env:

MERCHANT_WALLET=YourSolanaWalletAddress
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com

Usage with Claude Code

{
  "mcpServers": {
    "x402": {
      "command": "uvx",
      "args": ["x402-mcp-server"],
      "env": {
        "MERCHANT_WALLET": "YourSolanaWalletAddress"
      }
    }
  }
}

Tools

Tool

Description

create_payment_request

Create a 402 payment request for a tool

verify_payment

Verify on-chain USDC payment

get_payment_status

Check payment status

set_tool_price

Set price for a tool

get_price_list

View all tool prices

list_payments

Payment history

get_revenue

Revenue statistics

Flow

Agent A                    x402 Gateway                 Agent B (Service)
   |                           |                             |
   |-- "Use premium tool" ---->|                             |
   |                           |-- 402 Payment Required ---->|
   |<-- Payment instructions --|                             |
   |                           |                             |
   |-- USDC payment on-chain ->|                             |
   |                           |-- verify_payment ---------->|
   |                           |<-- verified ----------------|
   |<-- Access granted --------|                             |

More MCP Servers by AiAgentKarl

Category

Servers

๐Ÿ”— Blockchain

Solana

๐ŸŒ Data

Weather ยท Germany ยท Agriculture ยท Space ยท Aviation ยท EU Companies

๐Ÿ”’ Security

Cybersecurity ยท Policy Gateway ยท Audit Trail

๐Ÿค– Agent Infra

Memory ยท Directory ยท Hub ยท Reputation

๐Ÿ”ฌ Research

Academic ยท LLM Benchmark ยท Legal

โ†’ Full catalog (40+ servers)

License

MIT

A
license - permissive license
-
quality - not tested
F
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Pay for HTTP APIs and charge for your own: x402 micropayments in USDC on Base.

  • Pay-per-use weather, environment, finance, and on-chain intelligence tools for AI agents via x402.

  • Batch send SOL or any SPL token to 1000+ wallets via x402. AI agent payments on Solana.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AiAgentKarl/x402-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server