Marketplace MCP Client

Connect Codex, ChatGPT Apps, or any MCP-aware agent to the x402Nova marketplace so it can discover APIs and invoke them without touching wallets.

Setup

cd mcp-server
npm install
export FIREBASE_PROJECT_ID=...
export FIREBASE_SERVICE_ACCOUNT='{ "project_id": "..." }'
export MARKETPLACE_API_KEY=mkp_live_xxx
export MARKETPLACE_GATEWAY_URL=https://us-central1-x402-nova.cloudfunctions.net/callMarketplaceService
export MARKETPLACE_GATEWAY_TIMEOUT_MS=30000

Run npm run dev for STDIO or npm run build && node dist/index.js for production.

Add to Codex / ChatGPT

codex mcp add x402nova 'node /path/to/mcp-server/dist/index.js' --label "x402 Marketplace"

Hosted MCP deployments work the same way—just expose the built server over Streamable HTTP and secure it with bearer auth.

Tools

  • listMarketplaceApis(goal?: string, limit?: number) — mirrors the Discover catalog with IDs, capability tags, pricing, chain/token, and remote indicators so models can map intents like “produce a video” to the right API.
  • invokeMarketplaceApi(serviceId, path?, method?, query?, headers?, body?) — posts to the Marketplace Gateway. The gateway fetches a 402 challenge, signs it with the operator wallet, and forwards the call with X-PAYMENT headers. Responses include upstream status/body pluscreditsDebited and remainingCreditsUsd.

Non-MCP Usage

The MCP server is just a thin wrapper over HTTPS. Feel free to run it locally for development, host it once for your whole org, or embed the logic directly in your agent codebase if MCP isn't available yet.