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 產生的概覽

讓 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。
安裝前請注意
它持有私鑰並在主網上花費真實 USDC,錢包只應放入願意花掉的金額,且不要把私鑰寫進提示詞。支付不可撤銷且流向第三方賣家;策略限額從環境變數讀取,模型無法自行提高。選用的閃電網路支付使用另一個錢包檔案,帳本也可存入 Postgres。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 CRA AGENT,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

bash
npm i -g @cra-agent/mcp

Set it up in one command

bash
cra-agent init --client claude-desktop

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

json
{ "mcpServers": { "cra-agent": {    "command": "cra-agent-mcp",    "env": {      "CRA_NETWORK": "arc",      "CRA_KEY_FILE": "/path/to/agent.key",      "CRA_POLICY": "daily=5,per_seller=0.5,per_payment=0.05"    }} } }

CRA_KEY_FILE points at a file holding the private key, chmod 600. Never put a key in a prompt.

Tools

ToolWhat it does
arc_searchFinds what can be bought on Arc from a few words ("bitcoin price", "web search"): CRA AGENT's own data, the CRA market, and the endpoints Circle's x402 catalogue lists as payable on Arc (Exa, Goldsky, BlockRun and others). Each result: the method and the URL with example parameters, where each parameter goes (query, path or JSON body), the price, the seller, who listed it, and whether your policy allows paying it now. Free.
arc_quoteReads the price of a URL and says whether the policy would allow it. Pays nothing. For a POST, pass the body the payment will carry: some sellers check it before they name a price.
arc_payPays for the URL and returns the response with a receipt. With lightning: true it pays in bitcoin over Lightning when the seller's 402 offers it (x402 exact on lnbtc), from the wallet in CRA_NWC_PAY_FILE, under the same limits in dollars. Limits are checked on what the 402 asks at pay time, before anything is signed. maxUsdc adds a ceiling for that one call: pass the price arc_search listed, and a seller who raised it since is refused even inside your limits.
arc_balanceWallet and Circle Gateway balances.
arc_depositMoves wallet USDC into the Gateway balance. Needed once before the first payment.
arc_ledgerEvery attempt: quoted, rejected, signed, settled, failed.
arc_proofMatches settled payments to the on-chain transfer that carried them.
arc_verify_receiptChecks a signed receipt from another agent: who signed it, and whether the payment fitted the limits it states.
arc_policyShows the limits in force.
arc_job_*ERC-8183 escrow jobs. Testnet only until the contract is deployed on Arc mainnet.

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:

bash
cra-agent fund 5 --from base                                    # from this agent's own wallet on Base, same key and addresscra-agent fund 5 --from solana --solana-key-file ~/sol.json     # from a Solana wallet: our hex seed or solana-keygen's JSONcra-agent fund 5 --from base --dry-run                          # everything checked, nothing signed

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

bash
cra-agent find bitcoin price    # what is for sale on Arc; needs no key (in a browser: cra-agent.tech/bazaar)cra-agent balancecra-agent quote https://api.cra-agent.tech/v1/paid/rpc/healthcra-agent quote https://api.exa.ai/search --body '{"query":"x402 on Arc"}'           # the price of a POST, with its bodycra-agent fund 5 --from base   # USDC from Base to this agent on Arc, into Gatewaycra-agent deposit 1cra-agent withdraw 1            # Gateway balance back to the wallet; how a seller collectscra-agent pay   https://api.cra-agent.tech/v1/paid/rpc/healthcra-agent pay   https://api.exa.ai/search 0.007 --body '{"query":"x402 on Arc"}'   # a POST, refused above the listed pricecra-agent think "What is x402, in two sentences?" --budget 0.10              # an agent that pays for its own thinkingcra-agent proofcra-agent verify receipt.json      # needs no key and no networkcra-agent pq-key ~/.cra-agent/pq.key           # a post-quantum key for receipts; prints only its public halfcra-agent verify receipt.json --require-pq --on-arc   # the second signature too, and Arc's own verdict on it

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

VariableMeaning
CRA_NETWORKarc (mainnet) or arcTestnet. Default arcTestnet.
CRA_KEY_FILE / CRA_PRIVATE_KEYThe agent's key. Prefer the file.
CRA_POLICYdaily=5,per_seller=0.5,per_payment=0.05,rate=120/60s,allow=a.com|b.com,deny=c.com
CRA_RPC_URLOptional, one or several separated by commas, in priority order. Tried before the public Arc endpoints.
CRA_RPC_STRICT1 to never fall back to a public endpoint.
CRA_BASE_RPC_URL / SOLANA_RPC_URLOptional, for fund: the Base and Solana endpoints. Public ones by default.
DATABASE_URLOptional Postgres for the ledger. Without it the ledger lives in memory.
CRA_PQ_KEY_FILEOptional, the file cra-agent pq-key made. Every receipt is then signed a second time with SLH-DSA-SHA2-128s, the post-quantum scheme Arc verifies on chain. It covers the receipt, not the payment, and adds about a second to each one.

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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

6
  1. v0.0.11最新Sep 23, 2026
  2. v0.0.9Sep 23, 2026
  3. v0.0.6Sep 22, 2026
  4. v0.0.4Sep 21, 2026
  5. v0.0.3Sep 20, 2026
  6. v0.0.2Sep 19, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分