cardzero-mcp
cardzero-mcp
CardZero 的 MCP 服务器 —— 一个为 Base 链上的 AI 智能体提供的智能合约钱包,以 USDC 计价。
赋予你的 AI 智能体以下能力:
创建钱包并查询 USDC 余额
发送直接 USDC 支付(收取 2% 平台费)
支付 x402 保护的 HTTP 资源(HTTP 402 付费墙)
运行 ERC-8183 托管任务 (escrow Jobs) 以进行 A2A 服务交付(收取 2% 平台费 + 5% 评估费)
在链上查询支付/任务状态
CardZero 是底层的 API 层;此 MCP 封装了 REST 端点,因此任何支持 MCP 的客户端(Claude Desktop、Claude Code、Cursor、VS Code 等)都可以通过 stdio 调用它们。
前提条件
CardZero API 密钥 和 钱包 ID,在 CardZero 控制面板 认领钱包后获取。
Related MCP server: x402tools MCP Server
配置
Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"cardzero": {
"command": "npx",
"args": ["-y", "cardzero-mcp"],
"env": {
"CARDZERO_API_KEY": "czapi_...",
"CARDZERO_WALLET_ID": "wallet_..."
}
}
}
}Claude Code
claude mcp add cardzero -- npx -y cardzero-mcp或者添加到项目中的 .mcp.json:
{
"mcpServers": {
"cardzero": {
"command": "npx",
"args": ["-y", "cardzero-mcp"],
"env": {
"CARDZERO_API_KEY": "czapi_...",
"CARDZERO_WALLET_ID": "wallet_..."
}
}
}
}Cursor
设置 → MCP 服务器 → 添加新服务器:
名称:
cardzero命令:
npx -y cardzero-mcp环境变量:
CARDZERO_API_KEY,CARDZERO_WALLET_ID
VS Code
添加到 .vscode/settings.json:
{
"mcp": {
"servers": {
"cardzero": {
"command": "npx",
"args": ["-y", "cardzero-mcp"],
"env": {
"CARDZERO_API_KEY": "czapi_...",
"CARDZERO_WALLET_ID": "wallet_..."
}
}
}
}
}环境变量
变量 | 必需 | 描述 |
| 是(用于工具调用) | 来自 CardZero 控制面板的智能体 API 密钥 ( |
| 是(用于钱包范围工具) | 来自 CardZero 控制面板的钱包 ID ( |
| 否 | API 基础 URL — 默认为 |
即使没有这些变量,服务器也会启动并响应 tools/list — 单个工具调用随后会返回一个清晰的 config_missing 错误。
可用工具 (10)
直接支付
工具 | 描述 |
| 创建一个新的 CardZero 钱包。返回地址 + 人类所有者的一次性认领密钥。无需身份验证。 |
| 查询钱包当前的 USDC 余额。 |
| 向任何以太坊地址发送 USDC。从你的钱包中扣除 2% 的费用。 |
| 查看最近的支付历史。 |
| 通过 ID 查询特定支付。无需身份验证。 |
x402
工具 | 描述 |
| 支付 x402 保护的 HTTP 资源。返回一个用于重试请求的支付标头。 |
ERC-8183 任务(托管 / A2A 服务交付)
工具 | 描述 |
| 创建一个任务,托管 USDC 直到提供者交付且评估者批准。 |
| 将预算锁定到托管中。状态: |
| 提供者提交交付成果。状态: |
| 读取当前状态(状态、交易、评估结果)。无需身份验证 — 任务状态是公开的。 |
工作原理
此 MCP 服务器是一个调用 CardZero REST API 的轻量级客户端。它在你的机器上本地运行,并通过 stdio 与你的 AI 助手通信。本地不存储任何数据。
AI Assistant (Claude / Cursor / VS Code)
⇅ stdio (JSON-RPC)
cardzero-mcp (local Node process)
⇅ HTTPS
api.cardzero.ai → Base mainnet (USDC + ERC-4337 + ERC-8004 + ERC-8183)开发
git clone https://github.com/mrocker/cardzero-mcp.git
cd cardzero-mcp
npm install
npm run dev # tsx-watch the source
npm run build # compile to ./dist资源
完整的 LLM 友好语料库: https://cardzero.ai/llms-full.txt
主网合约: 记录在 /docs/reference/contracts
许可证
MIT
Available Tools
10 toolscreate_jobA
Create a Job that escrows USDC payment until a Provider delivers and an Evaluator approves. Use this for A2A service delivery (vs send_payment for direct transfers). Confirm budget + provider with user first. Provider must have a CardZero wallet (Sprint 9 MVP requirement).
Inputs: providerAddress (required), budgetUsdc (required), expiredAt (required), title (required), +3 more.
create_walletA
Create a new CardZero wallet. Returns a wallet address and one-time claim key for the human owner. No authentication required.
Inputs: name.
fund_jobA
Fund a Job created via create_job. Locks the budget USDC into escrow. Requires that the Job is in 'open' state. Two on-chain operations: USDC.approve(jobs) + Jobs.fund. Status: open → funded.
Inputs: jobId (required).
get_balanceA
Check the current USDC balance of your CardZero wallet.
Inputs: no named parameters.
get_jobA
Get the current state of a Job (status, budget, transactions, evaluation outcome). No authentication required — Job state is public.
Inputs: jobId (required).
get_paymentA
Check the status of a specific payment by its ID. No authentication required.
Inputs: paymentId (required).
list_paymentsB
View recent payment history for your CardZero wallet.
Inputs: limit, offset.
pay_x402A
Pay for an x402-protected HTTP resource (HTTP 402 Payment Required). Use after receiving a 402 response. Returns a paymentHeader to include in the retry request as X-PAYMENT header.
Inputs: url (required), maxAmount (required), recipient (required), network, +2 more.
send_paymentA
Send a USDC payment to any Ethereum address. A 2% service fee is deducted automatically from your wallet. Confirm amount and recipient with the user before calling.
Inputs: to (required), amount (required), memo, idempotencyKey.
submit_jobA
Submit a deliverable for a Job (Provider side). Posts the deliverable hash on-chain; Evaluator then auto-approves or rejects. Status: funded → submitted.
Inputs: jobId (required), contentHash (required), contentURI.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Tools have distinct purposes overall, but send_payment and pay_x402 both involve sending payments, potentially causing slight confusion. Descriptions help differentiate them.
All tools follow a consistent verb_noun pattern with underscores, e.g., create_job, get_balance, send_payment. No mixing of styles.
10 tools cover the core wallet and job escrow functionality without being excessive or insufficient for the stated purpose.
Core workflows are covered, but missing tools like list_jobs or cancel_job could hinder full lifecycle management. Minor gap.
Maintenance
Related MCP Connectors
Pay-per-call tools for autonomous agents, settled in USDC on Base via x402.
Pay-per-use MCP tools for AI agents. USDC on Base via x402. No API keys.
Pay-per-call tools for AI agents. Live x402 APIs paid in USDC on Base.
Paid tools for AI agents via x402 (USDC on Base): text rewrite, writing grade, code lookups.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceUSDC payments for AI agents on Base. Direct transfers, pre-funded tabs, x402 paywall handling, and service discovery.92 npmMIT
- AlicenseAqualityDmaintenanceProvides AI agents with 10 pay-per-call utility tools (QR generation, DNS lookup, OCR, etc.) using USDC on Base via the x402 protocol, with agent's private key never leaving the agent.11MIT

token4u-mcpofficial
AlicenseAqualityDmaintenanceEnables AI agents to call LLM APIs via x402 micropayments in USDC on Base network, manage a local wallet, and query consumption records.341 npmMIT- AlicenseNot gradedqualityBmaintenanceEnables AI agents to check their wallet address and USDC balance, preview the cost of an x402 call, and pay for API requests in USDC on Base without an account or API key. Spend caps, allow-lists and blocked contracts are enforced in code before anything is signed, so a prompt injection cannot bypass them.1MIT