x402 Payment Gateway MCP Server
Provides tools for creating x402 payment requests and verifying USDC payments on the Solana blockchain, enabling micropayments between AI agents.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@x402 Payment Gateway MCP ServerCreate a payment request for the premium data analysis tool costing 0.5 USDC."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-serverConfiguration
Set your merchant wallet in .env:
MERCHANT_WALLET=YourSolanaWalletAddress
SOLANA_RPC_URL=https://api.mainnet-beta.solana.comUsage with Claude Code
{
"mcpServers": {
"x402": {
"command": "uvx",
"args": ["x402-mcp-server"],
"env": {
"MERCHANT_WALLET": "YourSolanaWalletAddress"
}
}
}
}Tools
Tool | Description |
| Create a 402 payment request for a tool |
| Verify on-chain USDC payment |
| Check payment status |
| Set price for a tool |
| View all tool prices |
| Payment history |
| 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 | |
🌍 Data | Weather · Germany · Agriculture · Space · Aviation · EU Companies |
🔒 Security | |
🤖 Agent Infra | Memory · Directory · Hub · Reputation |
🔬 Research |
License
MIT
This server cannot be installed
Maintenance
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