x402 On-Chain Data MCP Server
Pay-per-call MCP server for on-chain blockchain data including wallet profiles, token metrics, protocol TVL, and gas prices.
README
x402 On-Chain Data MCP Server
MCP (Model Context Protocol) server wrapper for the x402 On-Chain Data API. Provides pay-per-call blockchain data including wallet profiles, token metrics, protocol TVL, and gas prices.
Author
0xEtherial
Features
- Wallet Profiles - ETH balance, transaction history, top tokens ($0.10/call)
- Token Metrics - Price, market cap, volume, liquidity ($0.05/call)
- Protocol TVL - Total value locked, chain breakdown ($0.05/call)
- Gas Prices - Real-time gas estimates ($0.02/call)
- Health Check - API status (free)
Installation
npm install
Configuration
Copy .env.example to .env and configure:
cp .env.example .env
Environment Variables
| Variable | Description | Default |
|---|---|---|
API_BASE_URL |
x402 On-Chain API base URL | http://localhost:8900 |
Usage
Start the MCP Server
node server.js
Available Tools
1. x402_wallet_score
Get comprehensive wallet profile.
Parameters:
address(string, required): Ethereum wallet address
Example:
{
"name": "x402_wallet_score",
"arguments": {
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD5e"
}
}
Returns: ETH balance, transaction count, first/last transaction, top 5 tokens
2. x402_token_metrics
Get token price and market data.
Parameters:
address(string, required): Token contract address
Example:
{
"name": "x402_token_metrics",
"arguments": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
}
Returns: Price, market cap, 24h volume, liquidity, FDV
3. x402_protocol_tvl
Get DeFi protocol TVL data.
Parameters:
slug(string, required): Protocol identifier (e.g., "uniswap", "aave")
Example:
{
"name": "x402_protocol_tvl",
"arguments": {
"slug": "uniswap"
}
}
Returns: TVL, 24h change, chain breakdown
4. x402_gas_prices
Get current Ethereum gas prices.
Parameters: None
Example:
{
"name": "x402_gas_prices",
"arguments": {}
}
Returns: Slow/standard/fast gwei + USD estimates
5. x402_health
Check API health status.
Parameters: None
Example:
{
"name": "x402_health",
"arguments": {}
}
Returns: API health status
Integration with AI Clients
Claude Desktop
-
Open Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the MCP server to
claude_desktop_config.json:
{
"mcpServers": {
"x402-onchain": {
"command": "node",
"args": ["/absolute/path/to/mcp-wrapper/server.js"],
"env": {
"API_BASE_URL": "https://nominated-safe-pairs-favorites.trycloudflare.com"
}
}
}
}
-
Restart Claude Desktop
-
The x402 tools will appear in Claude's available tools
Cursor
- Open Cursor settings (Cmd+,)
- Navigate to "Features" → "Model Context Protocol"
- Add new server:
- Name: x402-onchain
- Command:
node /absolute/path/to/mcp-wrapper/server.js - Environment:
API_BASE_URL=https://nominated-safe-pairs-favorites.trycloudflare.com
- Restart Cursor
Windsurf
- Open Windsurf settings
- Go to "AI" → "MCP Servers"
- Click "Add Server"
- Configure:
- Name: x402-onchain
- Command:
node - Args:
["/absolute/path/to/mcp-wrapper/server.js"] - Env:
{"API_BASE_URL": "https://nominated-safe-pairs-favorites.trycloudflare.com"}
- Save and restart Windsurf
Pricing
All endpoints use the x402 payment protocol (pay-per-call):
| Endpoint | Cost | Description |
|---|---|---|
/wallet/:address |
$0.10 | Wallet profile + top tokens |
/token/:address |
$0.05 | Token price + metrics |
/protocol/:slug |
$0.05 | Protocol TVL data |
/gas |
$0.02 | Gas price estimates |
/ |
Free | Health check |
Error Handling
The server returns structured error responses:
{
"error": true,
"status": 404,
"message": "Wallet not found"
}
Development
Requirements
- Node.js >= 18.0.0
- npm
Install Dependencies
npm install
Run Locally
API_BASE_URL=http://localhost:8900 node server.js
License
MIT
Links
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
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.