Skip to content

MCP Integration

Overview

x402 Relay provides a native MCP (Model Context Protocol) server that exposes the catalog as tools for Claude, OpenClaw, and other MCP-compatible agents.

The MCP server is published as @x402relay/mcp — just npx and go.

Setup

Claude Desktop

Add to claude_desktop_config.json:

{
"mcpServers": {
"x402-hub": {
"command": "npx",
"args": ["@x402relay/mcp"]
}
}
}

Cursor

Add to .cursor/mcp.json:

{
"mcpServers": {
"x402-hub": {
"command": "npx",
"args": ["@x402relay/mcp"]
}
}
}

OpenClaw

Add to your skill configuration:

{
"transport": "stdio",
"command": "npx @x402relay/mcp"
}

Custom Database Path

By default, the server creates/uses ./x402-hub.db in the current directory. To specify a custom path:

{
"mcpServers": {
"x402-hub": {
"command": "npx",
"args": ["@x402relay/mcp"],
"env": {
"X402_DB_PATH": "/path/to/your/x402-hub.db"
}
}
}
}

Available Tools

search_services

Search x402-enabled services by keyword or category.

ParameterTypeRequiredDescription
querystringNoSearch keyword
categorystringNoCategory ID filter
limitnumberNoMax results (default: 20)

get_service_detail

Get detailed information about a specific service.

ParameterTypeRequiredDescription
serviceIdstringYesService ID

list_categories

List all service categories with counts. No parameters.

check_service_status

Check the current status and trust score of a service.

ParameterTypeRequiredDescription
serviceIdstringYesService ID

why_this_api

Get an explanation of why a specific API is recommended, including trust score, tier, and alternatives considered.

ParameterTypeRequiredDescription
serviceIdstringYesService ID
querystringNoOriginal search context

Example Conversation

User: Find me an API for image generation that accepts crypto payments
Agent: [calls search_services with query="image generation"]
Found 3 services. Let me check the top result...
[calls get_service_detail with serviceId="svc-neural-api-1"]
[calls check_service_status with serviceId="svc-neural-api-1"]
NeuralAPI offers image generation at $0.003/request via USDC on Base.
Trust Score: 85/100 (verified). Uptime: 99.2%.