x402-agent-mcp
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-agent-mcpFind a news API and get today's top stories"
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-agent-mcp
Universal x402 MCP for AI agents — discover and pay for any x402 endpoint on Base or Solana.
Agents discover services, pay per call in USDC, and consume data — all autonomously. No API keys, no subscriptions, no signup. Just a wallet.
What It Does
Agent: "I need news data"
→ x402_search("news") → finds Tavily, 2s.io, glim.sh
→ x402_describe("Tavily") → gets endpoint schema + price
→ x402_fetch("https://api.tavily.com/search", "POST", body) → pays $0.001 USDC → gets resultsThe agent never sees wallets, private keys, or x402 protocol details. Just search, describe, fetch.
Related MCP server: obolpay-x402-mcp
Tools
Tool | Cost | Description |
| Free | Search x402 endpoints by keyword, category, or chain |
| Free | List all endpoint categories with counts |
| Free | Get detailed info for a specific service (paths, prices, schema) |
| Endpoint price | Fetch any x402 endpoint — handles 402 payment on Base or Solana |
Multi-Chain Support
Chain | Env var | Payment |
Solana |
| USDC via @x402/svm |
Base |
| USDC via @x402/evm |
Chain is auto-detected from the 402 response. Override with chain parameter.
Quick Start
1. Install
git clone https://github.com/dchu3/x402-agent-mcp.git
cd x402-agent-mcp
npm install
npm run build2. Configure
# .env
SOLANA_PRIVATE_KEY=your-base58-solana-key
EVM_PRIVATE_KEY=your-hex-base-key
SOLANA_RPC_URL=https://mainnet.helius-rpc.com/?api-key=your-key
BASE_RPC_URL=https://mainnet.base.orgYou only need the key for chains you want to pay on. Solana-only? Just set SOLANA_PRIVATE_KEY.
3. Connect to Your Agent
Hermes Agent
hermes config set mcp_servers.x402.command "node"
hermes config set mcp_servers.x402.args '["/path/to/x402-agent-mcp/dist/index.js"]'
hermes config set mcp_servers.x402.enabled true
# Set env vars
python3 -c "
import yaml
with open('$HOME/.hermes/config.yaml') as f:
config = yaml.safe_load(f)
config['mcp_servers']['x402']['env'] = {
'SOLANA_PRIVATE_KEY': 'your-base58-key',
'EVM_PRIVATE_KEY': 'your-hex-key',
}
with open('$HOME/.hermes/config.yaml', 'w') as f:
yaml.dump(config, f, default_flow_style=False, allow_unicode=True)
"
hermes gateway restart
hermes mcp test x402Claude Desktop
{
"mcpServers": {
"x402": {
"command": "node",
"args": ["/path/to/x402-agent-mcp/dist/index.js"],
"env": {
"SOLANA_PRIVATE_KEY": "your-base58-key",
"EVM_PRIVATE_KEY": "your-hex-key"
}
}
}
}Usage Examples
Search for endpoints
x402_search({ query: "news" })
x402_search({ category: "social" })
x402_search({ chain: "solana" })Describe a service
x402_describe({ name: "svm402" })Fetch an x402 endpoint
x402_fetch({
url: "https://svm402.com/analyze",
method: "POST",
body: '{"address": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"}'
})x402_fetch({
url: "https://api.tavily.com/search",
method: "POST",
body: '{"query": "latest AI news"}',
chain: "base"
})Endpoint Directory
The endpoints.json file contains known x402 endpoints. To add a new service:
Edit
endpoints.jsonAdd your service with name, description, base_url, chain, category, tags, and endpoints
Submit a PR
Safety
Spending limits via env vars:
MAX_PAYMENT_PER_CALL(default: $0.50),MAX_DAILY_SPEND(default: $10.00)Payment logging to
x402-payments.jsonlPrivate keys never exposed to the agent — MCP handles payment internally
Disclaimer
This software is experimental and provided "as is", without warranty of any kind. Use at your own risk.
This software initiates real cryptocurrency transactions that are irreversible.
Tech Stack
@x402/fetch — x402 payment handling
@x402/svm — Solana x402 scheme
@x402/evm — Base/EVM x402 scheme
@solana/web3.js — Solana SDK
ethers — EVM SDK
License
MIT
Links
x402 Protocol — Payment standard
x402scan — Endpoint explorer
MCP Protocol — Agent tool protocol
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
Alicense-qualityCmaintenanceAn MCP server that enables AI agents to search, pay for, and call paid APIs using the x402 protocol, with automatic USDC settlement.2MIT- FlicenseAqualityBmaintenanceMCP server for a live x402 payment gateway on Base (USDC). Lets AI agents discover, preview for free, then pay per call — with prepaid gasless payments, signed receipts, and delta delivery.7

mpp32-mcp-serverofficial
Alicense-qualityCmaintenanceMCP server that allows AI agents to discover and pay for thousands of APIs (x402 on Solana/Base) using a single key, with automatic payment handling and a federated catalog of machine-payable endpoints.235MIT- Alicense-qualityCmaintenanceMCP server that provides AI agents with pay-per-call access to a suite of tools (honeypot check, token market, DeFi yields, etc.) via USDC on Base using the x402 protocol.23MIT
Related MCP Connectors
Agent-commerce MCP server for x402/USDC payments and affiliate splits on Base.
MCP marketplace: agents pay per call in USDC via x402. Plus Base chain data and a USDC<->bank ramp.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/dchu3/x402-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server