Skip to content

Merchant MCP Integration

The Model Context Protocol (MCP) is the recommended integration path for AI-native merchant agents. Connect your agent to Nexus Core and gain access to all 6 merchant tools — registration, fulfillment, release, cancellation, and dispute resolution.

Overview

User's AI Agent  →  Nexus Core (MCP)  →  Your Merchant Agent (MCP)
                          │                        │
                    Orchestration             skill.md manifest
                    + Settlement              + MCP tool endpoints

Step 1 — Connect to Nexus Core

Add nexus-core as an MCP server in your client configuration:

json
{
  "mcpServers": {
    "nexus-core": {
      "url": "https://api.nexus.platon.network/mcp"
    }
  }
}

Transport: Streamable HTTP (stateless, single POST /mcp per request).

Step 2 — Register Your Agent

Call the nexus_register_agent tool:

nexus_register_agent({
  merchant_did: "did:nexus:20250407:my_agent",
  name: "My Agent",
  description: "What your agent does",
  category: "travel.flights",
  signer_address: "0xYourSignerAddress",
  payment_address: "0xYourPaymentAddress",
  skill_md_url: "https://my-agent.example.com/skill.md",
  health_url: "https://my-agent.example.com/health",
  webhook_url: "https://my-agent.example.com/webhooks/nexus"
})

Step 3 — Publish Your Skill Manifest

Every MCP-integrated merchant must publish a skill.md file at a public URL. This manifest describes your agent's identity, tools, and payment capabilities using the NUPS/1.5 frontmatter format:

yaml
---
name: my-travel-agent
version: "1.0.0"
description: AI-powered flight booking with XSGD escrow payments
protocol: NUPS/1.5
category: travel.flights
currencies: [XSGD]
chain_id: 20250407
tools:
  - name: search_flights
    role: search
    description: Search available flights by route and date
  - name: nexus_generate_quote
    role: quote
    description: Generate an EIP-712 signed quote for selected flights
---

Step 4 — Generate Quotes

Your agent signs NexusQuote payloads using EIP-712 and returns them in tool responses:

typescript
const quote = {
  merchant_did: "did:nexus:20250407:my_agent",
  merchant_order_ref: "ORD-001",
  amount: "5000000",           // 5 XSGD (6 decimals)
  currency: "XSGD",
  chain_id: 20250407,
  expiry: Math.floor(Date.now() / 1000) + 3600,
  context: {
    summary: "Flight SFO → LAX",
    line_items: [{ description: "Economy seat", amount: "5000000" }]
  },
  signature: "0x..."           // EIP-712 signed by signer_address
};

Return the quote wrapped in the UCP Checkout Response format. The user's agent extracts it from:

response.ucp.payment_handlers["urn:ucp:payment:nexus_v1"][0].config

Step 5 — Handle Payment Lifecycle

Webhook Events

Configure webhook_url during registration to receive HMAC-SHA256 signed notifications:

EventWhenAction
payment.escrowedUser deposited XSGD into escrowDeliver the service
payment.settledFunds released to your payment addressCall nexus_confirm_fulfillment again for COMPLETED
payment.completedFulfillment confirmedNo action needed
payment.cancelledPayment was cancelled (refund if escrowed)Cancel the order on your side
payment.dispute_openedUser opened a disputeRespond via nexus_resolve_dispute

Confirm Fulfillment

After delivering the service:

nexus_confirm_fulfillment({
  payment_id: "PAY-xxx",
  fulfillment_proof: "booking-ref-123"
})

Two-step process:

  1. ESCROWED → SETTLED: Submits release to escrow contract. ChainWatcher detects Released event → SETTLED.
  2. SETTLED → COMPLETED: Call again after SETTLED to finalize.

Available Merchant MCP Tools

ToolPurpose
nexus_register_agentRegister to marketplace
nexus_confirm_fulfillmentTwo-step fulfillment confirmation
nexus_release_paymentRelease escrowed funds (lower-level alternative)
nexus_cancel_paymentCancel a single payment
nexus_cancel_orderCancel an entire order group
nexus_resolve_disputeResolve dispute with merchant/payer split

Contract

  • Escrow Proxy (UUPS): 0xeB33a9C2b4c7D3F44Fd5514F90C355AF6bb79236
  • XSGD: 0x0Fd437613dE3d14F4dDaB8331DC0f2C0C543BdD0
  • Chain: PlatON Devnet (chainId 20250407)
  • RPC: https://devnet3openapi.platon.network/rpc

Full Reference