MC PX402 ChatGPT

Provides integration between MCP and x402 to enable pay-for-information flows in chat environments.
  • typescript

1

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "motok2031-mcpx402chatgpt": {
      "command": "npm",
      "args": [
        "run",
        "dev:mcp"
      ],
      "env": {
        "CDP_API_KEY_ID": "YOUR_CDP_KEY_ID",
        "CDP_API_KEY_SECRET": "YOUR_CDP_KEY_SECRET"
      }
    }
  }
}

You can use this MCP server setup to let an AI agent access paid resources through the MCP protocol and an x402 payment flow. After the user completes a payment, the AI can automatically fetch the paid content and deliver it in the chat, creating a seamless pay-for-information experience.

How to use

Start by requesting a paid service in your chat client that supports MCP. Your MCP client will ask the MCP server for a paid service, such as a riddle. The MCP server will generate a unique payid and return a payment link to you. Open that link in a wallet-enabled browser, complete the payment, and wait for confirmation.

How to install

Prerequisites: Install Node.js v18 or newer and npm. You will also configure a Coinbase Developer Platform API key to enable x402 payment verification.

npm install

Create a configuration file to point to the payment and MCP services. At minimum, include your Coinbase API keys for verification.

environment

Optionally customize server settings such as the payment address and price in a configuration file named config.yaml.

# config.yaml
payToAddress: "0x..."
payment:
  price: "$0.01"
  network: "base"

Run the MCP server and the x402 payment server in separate processes during development.

# Terminal 1: Start MCP Server
npm run dev:mcp

# Terminal 2: Start x402 Payment Server
npm run dev:x402

Additional sections

Security and environment: Keep your Coinbase API keys secure. Store sensitive values in a .env file and avoid committing them to version control. The example uses environment variables to pass API credentials to the payment verifier.

ChatGPT integration steps: In the chat client, configure the MCP server URL you are using (for example, https://mcp.mydomain.com). This enables paid services to be requested and paid for within the chat flow.

Troubleshooting tips: Ensure both MCP and x402 servers are running and reachable. Verify that payments are being recorded as paid on the x402 side and that the MCP server can query the payment status when a user reports payment completion.

Available tools

get_riddle

Generates the paid service content (e.g., a riddle) and creates a unique payid along with a payment link that the user can open to complete the payment.

get_answer

After payment completion is verified, retrieves and delivers the paid content to the user in the chat by invoking the paid content provider.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational