╔═╗ ║X║ ║4║ ╚═╝
x402 Payment Protocol
SERVER URL
http://localhost:3000/api/mcp-server/x402-paymentsCONNECTION JSON
{
"mcpServers": {
"x402-payments": {
"command": "npx",
"args": [
"mcp-remote@latest",
"http://localhost:3000/api/mcp-server/x402-payments"
]
}
}
}Learn more about supported MCP clients
MCP HOST CONNECTIONS
Connect this MCP server directly to your AI assistant tools by using the JSON config above. Click on a logo to see a demo video.
╔═══╗ ║ ▸ ║ ║ │ ║ ╚═══╝
┌───┐ │ C │ │ L │ └───┘
≋≋≋≋ ~≋~≋ ≋~≋~ ~~~~
DESCRIPTION
Complete payment protocol for autonomous AI agents on Solana. Handles payment requirements, transaction submission, verification, and wallet management with on-chain proof and cryptographic guarantees.
AVAILABLE TOOLS
get_payment_requirements
Fetch payment instructions for a resource
submit_payment
Submit a signed Solana transaction
verify_payment
Verify payment receipt with x402 facilitator
get_wallet_state
Display wallet balances and recent activity
get_transaction_history
Fetch recent transactions for an address
exchange_rate_feed
Get current USDC/USD and SOL/USD rates
health_check
Check Solana RPC and x402 gateway status
CODE EXAMPLES
// TypeScript Example
import { MCPClient } from '@x402/mcp-client';
const client = new MCPClient('https://api.x402.app');
// Get payment requirements
const payment = await client.callTool({
name: 'get_payment_requirements',
arguments: {
resource_id: 'premium-api-access'
}
});
// Submit payment
const result = await client.callTool({
name: 'submit_payment',
arguments: {
signature: txSignature,
resource_id: 'premium-api-access'
}
});Official MCP SDK Documentation:
https://github.com/modelcontextprotocol/modelcontextprotocol
Installation:
npm install @modelcontextprotocol/sdk
Authentication:
- For MCP Hosts (Cursor, Windsurf, Claude Desktop), saving the JSON config to your tool will automatically trigger the browser OAuth flow
- For programmatic access, obtain the OAuth token by running "npx mcp-remote <url>" in the terminal and follow the instructions