x402 MCP Server
Provides pay-per-use tools for AI agents like web screenshots and crypto intelligence using automatic USDC micropayments on the Base network. It simplifies access to premium APIs by handling blockchain transactions automatically when a payment is required.
README
x402 MCP Server
Pay-per-use APIs for AI agents. One npm install, automatic USDC micropayments on Base.
Tools
| Tool | Description | Price |
|---|---|---|
x402_network_info |
List all APIs with pricing and health status | Free |
x402_screenshot |
Capture any URL as a base64 image | $0.01 / capture |
x402_pdf_extract |
Extract text from a PDF via URL | $0.01 / extraction |
x402_sentiment |
Real-time sentiment analysis for a crypto coin | $0.01 / query |
x402_market_overview |
Broad crypto market sentiment overview | $0.05 / query |
x402_intelligence |
Multi-source crypto intelligence (CoinGecko, DeFiLlama, news, GitHub) | $0.10 / query |
Quick Start — Free Mode
No wallet or private key needed. Add the server to your MCP client config:
{
"mcpServers": {
"x402": {
"command": "npx",
"args": ["-y", "github:jameswilliamwisdom/x402-mcp-server"]
}
}
}
Free mode limitations:
- Screenshots limited to example.com, example.org, and httpbin.org
- PDF extraction limited to first 3 pages
- Sentiment returns mock data with real market structure
Quick Start — Paid Mode
Requires a Base wallet funded with USDC.
{
"mcpServers": {
"x402": {
"command": "npx",
"args": ["-y", "github:jameswilliamwisdom/x402-mcp-server"],
"env": {
"X402_PRIVATE_KEY": "your-private-key-here"
}
}
}
}
Never commit your private key. Store it in your system environment or a local .env file loaded by your shell.
You need USDC on the Base network. Base is an Ethereum L2 with low transaction fees. See the full wallet setup guide for detailed instructions.
MCP Client Configs
Omit the env block entirely for free mode.
Claude Desktop
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"x402": {
"command": "npx",
"args": ["-y", "github:jameswilliamwisdom/x402-mcp-server"],
"env": {
"X402_PRIVATE_KEY": "your-private-key-here"
}
}
}
}
Claude Code
claude mcp add --transport stdio x402 -- npx -y github:jameswilliamwisdom/x402-mcp-server
Then set X402_PRIVATE_KEY in your environment.
Cursor
Config file: ~/.cursor/mcp.json
{
"mcpServers": {
"x402": {
"command": "npx",
"args": ["-y", "github:jameswilliamwisdom/x402-mcp-server"],
"env": {
"X402_PRIVATE_KEY": "your-private-key-here"
}
}
}
}
Windsurf
Config file: ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"x402": {
"command": "npx",
"args": ["-y", "github:jameswilliamwisdom/x402-mcp-server"],
"env": {
"X402_PRIVATE_KEY": "your-private-key-here"
}
}
}
}
How It Works
- Your AI agent calls a tool (e.g.,
x402_screenshot) - The MCP server makes an HTTP request to the API
- The API responds with
402 Payment Required x402-fetchautomatically signs a USDC payment on Base and retries- The API returns the result
The payment flow is handled by x402-fetch — your agent never needs to manage transactions directly.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.