
X402 MCP Direct Integration
Overview
X402 MCP bridges the Model Context Protocol with the X402 payment protocol, enabling micropayments for AI tool invocations. This integration allows developers to monetize their MCP tools with instant, automatic stablecoin payments directly over HTTP. The system enables programmatic machine-to-machine transactions without accounts or complex authentication, making it ideal for AI agents that need to pay for premium tools and services.Key Features
Instant Micropayments
- Pay-per-use model for MCP tools
- Automatic USDC payments on Base network
- No accounts or authentication required
- Settlement happens transparently during tool invocation
Flexible Architecture
The library supports multiple deployment patterns:
Client Proxy Architecture - Bridge non-payment-aware clients to payment-required servers

Server Proxy Architecture - Monetize existing API-key-protected services
Use Cases
For Tool Developers
- Monetize your MCP tools with minimal setup
- Set custom pricing per tool invocation
- Receive instant payments in USDC
- No payment infrastructure needed
For AI Applications
- Access premium tools programmatically
- Pay only for what you use
- Automatic payment handling
- Works with Claude Desktop and other MCP clients
For Service Providers
- Wrap existing APIs with micropayment layer
- Convert API-key services to pay-per-use
- Create new revenue streams
- Maintain full MCP protocol compatibility
How It Works
- Client requests a tool invocation - Standard MCP request flow
- Server responds with payment requirement - HTTP 402 status with payment details
- Client constructs payment - Automatic USDC transaction on Base
- Server verifies and executes - Tool runs after payment confirmation
- Results returned to client - Standard MCP response with settlement info