Skip to content

Add x402 payment example with Intelica — competitive intelligence pay-per-call API #167

Description

Feature request

The x402 + MCP template is great. Adding a real-world merchant example showing API pay-per-call (not just content gating) would make it more useful.

Intelica is a competitive intelligence API with x402 v2 that fits well as an example:

import { wrapAxiosWithPayment, x402Client } from "@x402/axios";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(account));

const intelica = wrapAxiosWithPayment(
  axios.create({ baseURL: "https://api.intelica.dev" }),
  client
);

server.tool("analyze_market",
  { text: z.string(), mode: z.string().default("competitive") },
  async ({ text, mode }) => {
    // x402 payment handled automatically — pays $0.05 USDC on 402
    const { data } = await intelica.post("/intel", { text, mode });
    return { content: [{ type: "text", text: JSON.stringify(data.decision_recommendation) }] };
  }
);

Why it's useful as a template example

  • Shows x402 for JSON API pay-per-call, not just static content
  • Real production API with active usage
  • x402Version: 2, PAYMENT-REQUIRED header, Bazaar extension
  • Agentic Market validator: all checks pass

API: https://api.intelica.dev
OpenAPI: https://api.intelica.dev/openapi.json
Full guide: https://github.com/teodorofodocrispin-cmyk/Intelica-docs/blob/main/examples/mcp_x402_claude_desktop.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions