MCP Server#
PayWatcher is available as a public Model Context Protocol (MCP) server. AI agents can call PayWatcher tools directly from their workflow — no API key, no account. Authentication is handled via x402 ($0.05 USDC per tool call).
Quick Start#
1. Add to your MCP config#
{
"mcpServers": {
"paywatcher": {
"url": "https://api.paywatcher.dev/mcp"
}
}
}This works with Claude Desktop, Cursor, VS Code, and any MCP-compatible client.
2. Make your first tool call#
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
const client = new Client({ name: "my-agent", version: "1.0.0" })
await client.connect(
new StreamableHTTPClientTransport(
new URL("https://api.paywatcher.dev/mcp")
)
)
const result = await client.callTool({
name: "verify_payment",
arguments: {
tx_hash: "0xabc123...",
amount: "1.00",
network: "base",
to: "0xYourWallet...",
},
})The first call returns HTTP 402 with a payment descriptor. Your agent pays $0.05 USDC on-chain, then the tool executes and returns the result.
x402 Authentication#
Every tool call is authenticated via x402 — the HTTP 402 payment protocol. No API key needed, no account registration.
How it works:
- Agent calls a tool → server responds with HTTP 402 + Payment Descriptor
- Agent sends $0.05 USDC to the
payToaddress on any supported network - Agent retries the tool call with the
X-PAYMENTheader containing the tx proof - Server verifies payment → executes tool → returns result
Cost: $0.05 USDC per tool call (read and write tools).
Tool Reference#
create_payment#
Creates a new payment intent. Returns a deposit address and unique amount for the customer to pay.
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Amount in USDC (e.g. "49.99") |
currency | string | Yes | Currency — always "USDC" |
network | string | No | Network — defaults to "base" |
metadata | object | No | Custom metadata (e.g. order ID) |
webhook_url | string | No | Webhook URL for payment events |
expires_in | number | No | Expiration in seconds (default: 3600) |
const result = await client.callTool({
name: "create_payment",
arguments: {
amount: "49.99",
currency: "USDC",
network: "base",
},
})verify_payment#
Verifies an on-chain USDC transaction. Returns verification result with confirmation count.
| Parameter | Type | Required | Description |
|---|---|---|---|
tx_hash | string | Yes | Transaction hash (0x...) |
network | string | Yes | Network: base, ethereum, arbitrum, optimism, polygon |
amount | string | Yes | Expected amount in USDC |
to | string | Yes | Expected recipient wallet address |
tolerance_seconds | number | No | Time tolerance (default: 300) |
const result = await client.callTool({
name: "verify_payment",
arguments: {
tx_hash: "0xabc123...",
amount: "1.00",
network: "base",
to: "0xYourWallet...",
},
})get_payment#
Retrieves payment details by ID, including current status and confirmation count.
| Parameter | Type | Required | Description |
|---|---|---|---|
payment_id | string | Yes | Payment ID (e.g. "pay_2x7k...") |
const result = await client.callTool({
name: "get_payment",
arguments: {
payment_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
},
})list_verifications#
Lists recent verification results for the authenticated wallet.
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | No | Max results (default: 20, max: 50) |
offset | number | No | Pagination offset |
const result = await client.callTool({
name: "list_verifications",
arguments: { limit: 10 },
})Supported Networks#
The MCP server supports USDC on all PayWatcher networks:
| Network | Chain ID |
|---|---|
| Base | 8453 |
| Ethereum | 1 |
| Arbitrum | 42161 |
| Optimism | 10 |
| Polygon | 137 |
x402 payments (the $0.05 per-call fee) can be sent on any of these networks.
Next Steps#
- x402 Quick Start — How x402 authentication works in detail
- Endpoints — Full REST API reference
- Examples — Code examples in multiple languages