Skip to content

Quick Start

  • Node.js >= 20
  • npm or pnpm
Terminal window
git clone https://github.com/ango-ya/x402-relay.git
cd x402-relay
npm install

Copy the example environment file:

Terminal window
cp .env.example .env

Key variables:

VariableDescriptionRequired
API_KEYAdmin API key for service managementYes
DB_PATHSQLite database pathNo (default: ./x402-hub.db)
PORTServer portNo (default: 3402)
SCAN_INTERVAL_MSDiscovery scan intervalNo (default: 3600000)
Terminal window
# Development
npm run dev
# Production
npm run build && npm start

The API is now available at http://localhost:3402.

Terminal window
# Health check
curl http://localhost:3402/health
# List categories
curl http://localhost:3402/api/categories
# Search services
curl http://localhost:3402/api/services?query=AI
Terminal window
# Start the MCP server
npm run mcp

Add to your Claude Desktop config (claude_desktop_config.json):

{
"mcpServers": {
"x402-relay": {
"command": "node",
"args": ["<path-to-x402-relay>/dist/mcp-server.js"]
}
}
}