
CRA AGENT
io.github.giupy997由 GitHub 账号 giupy997 发布v0.0.11更新于 Nov 3, 2026
Lets an agent pay for x402 APIs in USDC on Arc, under a spending policy it cannot change.
概览
让 AI 代理在 Arc 上以 USDC 查找、询价并支付 x402 API,支出受环境变量中固定的策略约束。
- 可以做什么
- 搜索并询价 Arc 上可购买的 API,返回方法、URL、参数、价格、卖家以及策略是否允许支付
- 支付某个 URL 并取回响应与签名收据,可选通过闪电网络以比特币支付,并可为单次调用设上限
- 查询钱包与 Circle Gateway 余额,并把钱包中的 USDC 转入 Gateway
- 查看每次尝试的账本,把已结算支付与链上转账对应,并验证其他代理的收据
- 显示当前生效的支出限额,并在测试网上处理 ERC-8183 托管任务
- 适用场景
- 适合希望代理自行用 Arc 上的 USDC 购买 API 调用或数据,同时需要硬性支出限额、收据和审计记录的场景;也适合在付费前先确认某个端点价格。
- 运行要求
- 通过 npx 从 npm 包 @cra-agent/mcp 在本地运行。需要 CRA_KEY_FILE 指向一个权限为 chmod 600、存放代理私钥的文件,并设置 CRA_NETWORK 为 arc 或 arcTestnet。CRA_POLICY 设定支出限额,CRA_RPC_URL 与 DATABASE_URL 可选。钱包需有 USDC,首次支付前还需一次性存入 Circle Gateway。
安装
在 SourceWeft 中
- 打开 控制台中的 CRA AGENT,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@cra-agent/mcp
An MCP server that lets an AI agent pay for an API call. The agent calls one tool, the rail reads the x402 price, checks a spending policy, pays in USDC on Arc through Circle Gateway with no gas for the buyer, and keeps the receipt.
The model never sees the key, and it cannot raise its own limit: both are read from the environment before the conversation starts.
Install
Set it up in one command
Creates the agent's key in ~/.cra-agent/agent.key (readable only by you, never overwritten), checks the limits, writes the entry into the client's config file with a copy of the old one, and prints the address to fund. --client is claude-desktop, cursor, claude-code or terminal; --policy, --network, --key-file and --dry-run do what they say. CRA Factory writes the command for you from four questions.
Or by hand, from any MCP client
CRA_KEY_FILE points at a file holding the private key, chmod 600. Never put a key in a prompt.
Tools
An agent that pays for its own thinking
cra-agent think "<task>" runs a small autonomous agent whose brain is a pay-per-call LLM on Arc: BlockRun's chat completions, found in the bazaar, Claude Haiku 4.5 by default. Every thought is a paid call, and so is every tool the brain asks for: it searches the bazaar for free, then buys what it needs at the listed price. There is no API key anywhere, only the agent's wallet. The session budget (--budget, default $0.10) and the spending policy cover thinking and tools alike, a thought is capped with --ceiling (default $0.01), and the brain can only buy a URL that one of its searches returned. It prints each step with its cost and ends with the bill: so much for thinking, so much for tools. A short task costs a few cents: the run on cra-agent.tech/think that found when Arc mainnet went live and who validates it cost $0.023648, four thoughts and one web search from Exa.
It also knows a few free public APIs, called without paying and shown as such: DexScreener's pairs, boosted tokens and new token profiles, digested to what answers questions (pairs by 24-hour volume). --tools <file> keeps it to a list of URL prefixes: anything else is never shown to it, so never bought.
With --record and a DATABASE_URL, the run is kept in Postgres as it happens, step by step, which is how the page shows it live and replays it after. --questions <file> picks the question when none is given, which is how our server runs it on a timer: the file combines templates (What is the price of {coin} right now?) with lists (@coin = bitcoin (BTC) | ether (ETH)), and a recorded run never repeats one of the last hundred questions.
The same agent can be hired by anyone, over x402 upto: GET https://api.cra-agent.tech/v1/upto/think?task=… asks you to sign for up to $0.10 and charges what the run spent plus $0.005. arc_pay and cra-agent pay pay routes like this one: your policy is checked against the ceiling, since all of it could be taken, and your ledger keeps what was. The default policy allows $0.05 a payment, so give this one more with per_payment=0.10.
Fund the agent from Base or Solana
Paying on Arc takes USDC in Circle Gateway on Arc, and most agents hold theirs on Base or Solana. One command brings it over and deposits it:
It asks Eco for a route, and checks the quote before signing anything, from the transaction's own calldata: a CCTP burn of exactly that amount to Arc's domain, minting to this agent, a fee under the cap (--max-fee, default 0.5% or $0.01), the refund to the same wallet. From Base, the vault the USDC goes into must be the one Eco's Portal derives for that intent. It then waits for the USDC on Arc, usually seconds, and deposits it into Gateway, leaving $0.01 in the wallet for Arc's gas (--keep, or --no-deposit to keep it all in the wallet). From Base the wallet needs a little ETH for two transactions, about a cent; from Solana, a little SOL. The model has no tool for this: moving money between chains is the owner's call, from a terminal.
The same thing from a terminal
Every receipt carries the limits the payment passed under and is signed with the agent's key, so someone who was not there can check it. The signature proves the agent issued the statement and nobody changed it; the settlement on chain is the independent half.
Environment
Two things worth knowing. A payment is settled only after the seller's handler succeeds, so a failing endpoint costs nothing: https://api.cra-agent.tech/v1/paid/selftest/fail always answers 500 so you can check. And identity=required pays only sellers with an ERC-8004 identity on Arc: the address that gets paid must own an agent in the registry, or be the wallet an agent declared for payments. It proves an identity exists, not that the seller is honest; registering costs only gas.
Part of CRA AGENT
Payments for AI agents on Arc, Circle's USDC-native L1. Site: cra-agent.tech · Source: github.com/giupy997/arcagentx402 · MIT
来源:packages/mcp/README.md,提交 47ab8f9
工具
0版本历史
6- v0.0.11最新Sep 23, 2026
- v0.0.9Sep 23, 2026
- v0.0.6Sep 22, 2026
- v0.0.4Sep 21, 2026
- v0.0.3Sep 20, 2026
- v0.0.2Sep 19, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分