X402 API MCP Server
by fernsugiio.github.fernsugi/x402-apiv1.0.5
Eight paid DeFi tools: prices, gas, swaps, token security, holders, yields, funding and wallets
context tax
queued
security
queued
cold start
queued
freshness
Active9d ago
Install X402 API MCP server
Install in Claude Code
claude mcp add x402-api -e X402_WALLET_PRIVATE_KEY='<x402-wallet-private-key>' -- npx -y @x402-api/mcp-serverInstall in Cursor
{
"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 (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<x402-wallet-private-key>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"x402-api": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<x402-wallet-private-key>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": [
"-y",
"@x402-api/mcp-server"
],
"env": {
"X402_WALLET_PRIVATE_KEY": "<x402-wallet-private-key>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| X402_API_BASE_URL | — | — | x402 API base URL (default: https://x402-api.fly.dev) |
| X402_WALLET_PRIVATE_KEY | — | yes | Base wallet private key for optional EIP-3009 auto-pay. Default mode inspects payment requirements without paying. |
| X402_MAX_PER_CALL_USDC | — | — | Maximum USDC allowed per automatic tool call (default: 0.01) |
| X402_REFERRAL_SOURCE | — | — | Optional referral label: github, glama, nohumans, bazaar, mcp, eliza, demo or test. Default mcp. |
| X402_EXPECTED_PAY_TO | — | — | Expected payment recipient; defaults to the official x402-api wallet. Change only when using a trusted alternative deployment. |
Freshness
Active — last maintenance signal 9d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-30 · 9d ago · GitHub
Latest release
2026-09-30 · 9d ago · GitHub · v1.0.5
Package published
no data · npm/PyPI
Registry entry updated
2026-09-30 · 9d ago · official registry · v1.0.5
FAQ
›How do I install the X402 API MCP server in Claude Code?
Run: claude mcp add x402-api -e X402_WALLET_PRIVATE_KEY='<x402-wallet-private-key>' -- npx -y @x402-api/mcp-server. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does X402 API require an API key?
Yes. It expects X402_WALLET_PRIVATE_KEY, of which 1 is a secret.
›Can I use X402 API as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is X402 API in the official MCP registry?
Yes, as io.github.fernsugi/x402-api.
Alternatives to X402 API
Other security MCP servers.