Skip to main content
Glama

MCP x402 — 面向 AI 代理的基于证据的网页验证

在代理采取行动之前验证卖家、产品、报价、政策或声明

向 AI 代理提供一个公开的 HTTP(S) 页面和 1 到 10 个具体条件。verificar_condicoes 工具会为每个条件返回基于证据的决策:

  • confirmado — 页面明确支持该条件。

  • rejeitado — 页面明确与该条件矛盾。

  • incerto — 页面可用证据不足。

每次验证都包含最终源 URL、页面标题、时间戳、逐条件解释、可用的引用证据、唯一的 verificationId 以及 SHA-256 pageHash。

适用场景

  • AI 采购和采购代理;

  • 卖家、产品和报价验证;

  • 购买前尽职调查;

  • 政策和条款检查;

  • 需要在采取行动前获得证据的商业自动化。

简单的 x402 集成

  • 支付前免费预检验证。

  • Base 主网上每次验证 $0.05 USDC。

  • 无需账户或订阅。

  • 可通过 MCP 和 HTTP 使用。

  • 本仓库包含开箱即用的买家。

  • 已通过 Coinbase x402 验证并启用 Bazaar 发现。

实时端点

  • MCP: https://mcp-x402-production.up.railway.app/mcp

  • 免费验证预检:POST https://mcp-x402-production.up.railway.app/preflight/verify-conditions

  • 付费验证:POST https://mcp-x402-production.up.railway.app/verify-conditions

  • 健康检查:GET https://mcp-x402-production.up.railway.app/health

该服务还通过 analisar_url 和 consultar_ia 提供付费的公共 URL 分析和通用 AI 咨询。

Related MCP server: x402-data-gateway

实时服务

  • 基础 URL:https://mcp-x402-production.up.railway.app

  • 健康检查:GET /health

  • MCP 端点:POST /mcp

  • 付费 URL 分析:POST /analyze

  • 价格:每次付费请求 $0.05 USDC

  • 网络:Base 主网(eip155:8453)

生产状态

  • 在 Railway 上活跃的生产部署

  • x402 版本 2 支付流程

  • Base 主网支付(eip155:8453)

  • 已通过 Coinbase x402 验证

  • 模拟接受 HTTP 402

  • 已启用 Bazaar 发现元数据

  • Coinbase 索引活跃

MCP 工具

决策验证

verificar_condicoes — $0.05 USDC

面向代理的付费决策验证工具。

给它一个公开的 URL 和一个或多个具体条件。它仅根据从该页面提取的证据返回决策:

  • confirmado — 页面明确证明该条件。

  • rejeitado — 页面明确与该条件矛盾。

  • incerto — 页面未提供足够证据。

每个结果都包含最终源 URL、页面标题、验证时间戳、逐条件解释以及可用的简短引用证明。

示例条件:

  • “页面标识了卖家。”

  • “该产品在葡萄牙有售。”

  • “页面显示欧元价格。”

  • “文档声明该服务支持 x402。”

这专为需要在采取下一步行动前获得基于证据的决策的代理而设计。

工具

描述

价格

consultar_ia

向 OpenAI Responses API 发送提示。

$0.02 USDC

analisar_url

获取并分析公开的 HTTP 或 HTTPS 页面。

$0.05 USDC

verificar_condicoes

在公开页面上验证具体条件并返回基于证据的决策。

$0.05 USDC

技术

  • Node.js 和 TypeScript

  • Express

  • 模型上下文协议

  • OpenAI Responses API

  • x402 支付

  • viem

  • Cheerio

  • Railway

安全

  • 由 Railway 提供的 HTTPS

  • Helmet 安全头

  • 每 15 分钟 100 个请求的速率限制

  • 带有唯一请求 ID 的结构化请求日志

  • 主机验证和 Railway 健康检查支持

  • 受限的 OpenAI API 密钥,仅可访问 /v1/responses

  • 环境文件和密钥已从 Git 中排除

环境变量

服务器

变量

必需

描述

OPENAI_API_KEY

是

OpenAI 项目 API 密钥。

OPENAI_MODEL

否

OpenAI 模型。默认为 gpt-5-mini。

HOST

否

监听主机。默认为 0.0.0.0。

PORT

否

监听端口。默认为 3000。

RAILWAY_PUBLIC_DOMAIN

Railway

由 Railway 自动提供。

本地买家

变量

必需

描述

EVM_PRIVATE_KEY

是

Base 主网买家钱包的私钥。切勿提交此值。

示例本地 .env.test 文件:

EVM_PRIVATE_KEY=your_private_key_here

本地开发

安装依赖:

npm install

启动开发服务器:

npm run dev

构建项目:

npm run build

启动编译后的服务器:

npm start

健康检查

健康端点公开,无需支付:

curl https://mcp-x402-production.up.railway.app/health

开箱即用的 x402 买家

该仓库包含适用于应用程序和 AI 代理的开箱即用买家。MCP 买家连接到实时服务,根据 Base 主网 USDC 和最高 $0.05 的支付金额验证 x402 支付要求,签署支付,重试相同的工具调用,并打印结算收据和结果。

克隆并准备买家:

git clone https://github.com/Diogoup26/mcp-x402.git
cd mcp-x402
npm install

在项目根目录创建本地 .env.test 文件:

EVM_PRIVATE_KEY=0xYOUR_64_HEX_CHARACTER_PRIVATE_KEY

切勿提交 .env.test 或暴露私钥。

构建项目:

npm run build

以下命令授权 Base 主网上的真实 x402 支付:

  • consultar_ia:$0.02 USDC

  • analisar_url:$0.05 USDC

  • verificar_condicoes:$0.05 USDC

HTTP URL 分析

npm run analyze -- "https://example.com" "Summarize this page."

HTTP 决策验证

npm run verify -- "https://example.com" "The page identifies the seller."

MCP URL 分析

npm run mcp:analyze -- "https://example.com" "Summarize this page."

MCP AI 咨询

npm run mcp:consult -- "Reply only with: MCP OK"

MCP 决策验证

npm run mcp:verify -- "https://example.com" "The page identifies the seller."

成功的 MCP 支付会打印:

  • PAGAMENTO MCP: success

  • 结算收据

  • 工具响应

MCP 买家从不打印私钥,并拒绝任何满足以下条件的支付:

  • 不在 Base 主网上;

  • 未使用配置的 Base USDC 合约;

  • 超过 $0.05 USDC。

部署

main 分支已连接到 Railway。每次成功推送都会触发新的部署。Railway 使用:

npm run build
npm start

部署健康检查路径为 /health。

许可证

ISC

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets AI agents make automated USDC micro-payments on Base mainnet via x402/MPP to unlock clean structured data from URLs and other pay-per-call tools like Markdown reading, security scans, wallet enrichment, and settlement proof, with no API key or subscription.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to call pay-per-call x402 endpoints on Base mainnet using the caller's own USDC wallet, covering single and batch token risk checks, the latest BTC radar signal, project info, and a free health probe. Payments are EIP-3009 signed with a configurable per-call spending cap, and any quote with an unexpected payee, network, or asset is refused before payment.
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents and bots to buy per-call data and intelligence — token safety verdicts, prices, news, weather, web-to-text, and research dossiers — without signup or API keys, since each call is authenticated by an on-chain USDC payment on Base via the x402 protocol. Clients hit any paid endpoint, receive an HTTP 402 challenge, sign an EIP-3009 transfer authorization, and retry to get the data.
      1
      MIT