X402 Api
Eight paid DeFi tools: prices, gas, swaps, token security, holders, yields, funding and…
- Pricing
- Open source
- Runs
- Locally
- Version
- 1.0.5
- Listing updated
- 5 days ago
About X402 Api
X402 Api is an open-source MCP server. It runs locally on your machine and is started by your AI client.
Eight paid DeFi tools: prices, gas, swaps, token security, holders, yields, funding and wallets
Install
Run in a terminal
claude mcp add x402-api --env X402_WALLET_PRIVATE_KEY='<X402_WALLET_PRIVATE_KEY>' -- npx -y @x402-api/mcp-serverAdd to claude_desktop_config.json
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<X402_WALLET_PRIVATE_KEY>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<X402_WALLET_PRIVATE_KEY>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"x402-api": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<X402_WALLET_PRIVATE_KEY>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<X402_WALLET_PRIVATE_KEY>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<X402_WALLET_PRIVATE_KEY>"
}
}
}
}Using several servers? Build one config file with the MCP config generator.
Configuration
X402_API_BASE_URLx402 API base URL (default: https://x402-api.fly.dev)X402_WALLET_PRIVATE_KEYBase wallet private key for optional EIP-3009 auto-pay. Default mode inspects payment requirements without paying.X402_MAX_PER_CALL_USDCMaximum USDC allowed per automatic tool call (default: 0.01)X402_REFERRAL_SOURCEOptional referral label: github, glama, nohumans, bazaar, mcp, eliza, demo or test. Default mcp.X402_EXPECTED_PAY_TOExpected payment recipient; defaults to the official x402-api wallet. Change only when using a trusted alternative deployment.
Pricing
Open source
X402 Api FAQ
Is X402 Api free?
Yes. X402 Api is open source, so you can use and self-host it for free.
How do I add X402 Api to Claude Code?
Run this command in your terminal: claude mcp add x402-api --env X402_WALLET_PRIVATE_KEY='<X402_WALLET_PRIVATE_KEY>' -- npx -y @x402-api/mcp-server
Where this comes from
- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.