DIEM Agent Workers

io.github.coastmancoastman由 GitHub 帳號 coastmancoastman 發布v0.6.1更新於 Oct 24, 2026

Discover privacy-first, bounded Venice-powered micro-work calls with exact x402 USDC prices.

發布方自己的服務:Advisor Deadlines

已驗證Streamable HTTP可網頁執行金融AI 與機器學習

概覽

AI 產生的概覽

一個遠端 MCP 商店服務,可免費列出、報價並準備由 Venice 驅動的付費微任務呼叫(擷取、分類、摘要、語音、圖像、音訊),實際執行需由具備 x402 支付能力的用戶端完成。

可以做什麼
免費列出有界微任務 worker 的 schema、限制、端點與精確 USDC 價格。為單一 worker 回傳免費的精確價格 x402 USDC 報價。驗證 worker 選擇並回傳可直接執行的精確 HTTP 請求結構。實際任務(文字擷取、分類、摘要、文字轉語音、圖像生成、音訊轉錄)不由本伺服器執行,需由助理以自帶 x402 能力的用戶端或 Coinbase Bazaar MCP 伺服器執行。
適用情境
當助理需要了解有哪些付費微任務、比較固定 USDC 價格,或在付款前組出格式正確的 x402 請求時使用。它只是探索與準備層,不負責執行。
執行需求
遠端 Streamable HTTP 端點;未宣告本機執行環境、帳號、API 金鑰或請求標頭。執行已準備的呼叫需要具備 x402 能力且持有 Base 上 USDC 的用戶端,或 CDP Bazaar MCP 伺服器。
安裝前請注意
已準備的呼叫依每次嘗試固定價格在 Base 主網以 USDC 付費,執行即產生真實支出。伺服器聲明從不接收錢包私鑰,也不接受私鑰;請勿在對話中提供金鑰,並使用專用的低餘額錢包。符合 schema 的 AI 輸出並不代表內容正確,README 也說明不要用於高風險決策。

安裝

在 SourceWeft 中

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

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.coastmancoastman%2Fdiem-agent-workers/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "diem-agent-workers": {
      "type": "http",
      "url": "https://diem-agent-workers.vercel.app/mcp"
    }
  }
}

README

DIEM Agent Workers

Privacy-first, machine-discoverable micro-work powered by private Venice inference and paid in USDC through x402.

This repository is a fail-closed, agent-first Base mainnet storefront. It exposes six bounded workers over plain HTTP + x402, publishes them to the CDP Bazaar, and adds A2A 1.0, MCP, OpenAPI, llms.txt, and portable-skill discovery surfaces.

Public beta: diem-agent-workers.vercel.app

WorkerBounded outcomeBeta price
extract_text_to_jsonCaller-schema-valid extraction$0.020 USDC
classify_textExactly one caller-supplied label$0.010 USDC
summarize_textStructured abstract and key points$0.020 USDC
text_to_speechUp to 1,000 characters as MP3$0.010 USDC
generate_draft_imageOne safe-mode 1024px WebP$0.020 USDC
transcribe_audioUp to 60 seconds of verified PCM WAV$0.015 USDC

These are fixed prices per successful authorization attempt, not estimates. The public deployment is a low-cap Base mainnet beta: an atomic 0.25 DIEM software budget limits daily inference starts, while the Venice API key retains a separate 1.69 DIEM provider backstop.

Privacy by design

  • Prompts, outputs, payer addresses, transaction hashes, IP addresses, user agents, and request identifiers are excluded from durable metrics.
  • Request and provider bodies are not intentionally logged or persisted.
  • Public reliability statistics are lifetime aggregates only; there are no timestamps or time buckets that could reveal activity patterns.
  • Workers use private Venice models, with web search, scraping, and model tool use disabled.
  • Delivery protection stores only HMAC fingerprints and bounded state needed to redeem an interrupted delivery.

The optional USDC-to-DIEM treasury remains disabled in production and is not part of the storefront runtime. No wallet signer or private key is deployed to Vercel.

What is implemented

  • Three Venice structured-output text workers with post-response JSON Schema validation
  • Bounded Venice speech, image, and transcription workers
  • Native Venice API-key compute ceiling of 1.69 DIEM per EPOCH (daily, resetting at 00:00 UTC)
  • Atomic Upstash-backed software ceiling of 0.25 DIEM of conservatively reserved work per UTC day
  • An environment-backed storefront kill switch checked before payment
  • Input validation before payment, including exact PCM WAV duration checks
  • Pre-payment Venice epoch-access, model-online, private-model, and capability checks
  • Free machine-readable catalog and per-worker fixed-price quotes
  • OpenAPI 3.1, llms.txt, A2A 1.0 Agent Card, JSON-RPC SendMessage, and Streamable HTTP MCP discovery
  • x402 exact-price USDC payment gating through the CDP Facilitator
  • Rich per-worker x402 Bazaar schemas, service name, topical tags, and service icon
  • Official MCP Registry metadata for the public Streamable HTTP server
  • Privacy-preserving runtime telemetry plus durable lifetime aggregate reliability, settlement, revenue, latency-bucket, and DIEM counters
  • Durable, idempotent paid-delivery credits backed by atomic Upstash Redis state
  • Published machine-readable terms linked from every response and discovery surface
  • Payments sent directly to a dedicated treasury address
  • Quote-only and live USDC-to-DIEM treasury modes
  • Hard-coded Base USDC, Venice DIEM, chain ID, and 0x AllowanceHolder
  • Exact approvals, per-swap limits, slippage cap, ETH gas reserve, process lock, and owner-only audit log
  • Installable agent skill and local/stdio MCP adapter

The service is not affiliated with or endorsed by Venice.ai.

Local start

Requirements: Node.js 22+ and pnpm.

bash
cp .env.example .envpnpm installpnpm testpnpm dev

Add a server-side Venice key to .env:

dotenv
VENICE_API_KEY=...VENICE_TEXT_MODEL=venice-uncensored-1-2VENICE_IMAGE_MODEL=venice-sd35VENICE_TTS_MODEL=tts-kokoroVENICE_ASR_MODEL=openai/whisper-large-v3VENICE_DIEM_EPOCH_CAP=1.69

VENICE_DIEM_EPOCH_CAP publishes the cap in service discovery and must match the native EPOCH consumption limit configured on the Venice API key. Venice enforces the hard stop. Before issuing a 402, the service also checks current epoch access and the exact configured model's online/private/capability state; it never estimates DIEM billing from token counts.

The development server binds to 127.0.0.1:8402.

bash
curl http://127.0.0.1:8402/healthcurl http://127.0.0.1:8402/v1/catalogcurl -X POST http://127.0.0.1:8402/v1/quote/classify_text

With PAYMENTS_MODE=off, the worker is callable without payment for local testing:

bash
curl -X POST http://127.0.0.1:8402/v1/jobs/extract-json \  -H 'Content-Type: application/json' \  -d '{    "source": "The Acme Trail Mug is drinkware and costs $18.50.",    "schema": {      "type": "object",      "properties": {        "name": {"type": ["string", "null"]},        "category": {"type": ["string", "null"]},        "price_usd": {"type": ["number", "null"]}      },      "required": ["name", "category", "price_usd"],      "additionalProperties": false    }  }'

Production refuses to start unless PAYMENTS_MODE=production, durable delivery credits are enforced, the global compute budget is enforced, and aggregate-only metrics are enabled. The checked-in and local defaults remain PAYMENTS_MODE=off, STOREFRONT_ENABLED=false, AGGREGATE_METRICS_MODE=off, and TREASURY_MODE=disabled.

Add x402 payments

Import a downloaded CDP Secret API Key without printing its values:

bash
pnpm credentials:import-cdp /absolute/path/to/cdp_api_key.json

The command tightens both the downloaded key file and .env to owner-only permissions. It refuses to overwrite configured credentials and does not enable payments.

Start on Base Sepolia:

dotenv
PAYMENTS_MODE=developmentTREASURY_ADDRESS=0xYourDedicatedEvmAddressCDP_API_KEY_ID=...CDP_API_KEY_SECRET=...

The server uses the address form of the CDP configuration, so payments settle directly to TREASURY_ADDRESS; CDP does not provision or control that wallet. An unpaid request to the worker should return HTTP 402 and a PAYMENT-REQUIRED header.

Paid-delivery protection

Mainnet is fail-closed unless durable delivery credits are enforced. Provision an Upstash Redis database through the Vercel Marketplace, then configure:

dotenv
DELIVERY_CREDITS_MODE=enforcedDELIVERY_CREDIT_HMAC_SECRET=<at-least-32-random-bytes>DELIVERY_CREDIT_TTL_SECONDS=86400DELIVERY_CREDIT_LEASE_SECONDS=180UPSTASH_REDIS_REST_URL=...UPSTASH_REDIS_REST_TOKEN=...

Agents should generate one unpredictable Idempotency-Key per logical job and reuse it only with the identical request and payment authorization. Signed paid attempts without the header fail before settlement. The Redis record contains only HMAC fingerprints, worker ID, state, lease, and expiry—never request bodies, provider responses, payer addresses, payment headers, or transaction hashes.

Normal successful delivery consumes the key. If the process is interrupted after settlement but before delivery completes, the same authorization, key, worker, and request may redeem one retry without another settlement. Conflicting reuse is rejected, and storage outages return 503 before settlement.

Mainnet compute budget and kill switch

Production also requires an atomic global compute budget:

dotenv
COMPUTE_BUDGET_MODE=enforcedCOMPUTE_BUDGET_DIEM_PER_DAY=0.25AGGREGATE_METRICS_MODE=enabledSTOREFRONT_ENABLED=true

The service reserves a conservative amount equal to the job's USDC price after x402 verification but before Venice inference. Delivery retries reserve again because they can consume provider capacity even when the buyer is not charged again. A Redis outage or exhausted budget aborts new payment settlement and blocks inference. Set STOREFRONT_ENABLED=false and redeploy to disable all paid work before payment.

Run the guarded local Base Sepolia settlement test with:

bash
pnpm test:sepolia

This is an actual testnet transaction: it creates an ephemeral in-memory buyer, requests faucet USDC, validates the exact quote before signing, pays one worker call, and reconciles the treasury's test-USDC increase. It refuses to run unless the saved PAYMENTS_MODE is off and TREASURY_MODE is disabled. Local HTTP tests are not published to Bazaar; a public HTTPS deployment is required.

Mainnet launch checklist:

  1. Use a dedicated, low-balance treasury wallet—not a personal wallet.
  2. Verify the address and Base network.
  3. Deploy behind public HTTPS.
  4. Validate the x402 endpoint with the CDP validation API.
  5. Publish and review TERMS.md; every API response links to /terms.
  6. Enable durable delivery credits and the 0.25 DIEM atomic software budget.
  7. Set PAYMENTS_MODE=production, keep TREASURY_MODE=disabled, and deploy.
  8. Complete one real low-value payment so Bazaar can index the Base mainnet resource.

The mainnet acceptance harness uses a distinct cents-only buyer kept in macOS Keychain, verifies every payment requirement before signing, and refuses a combined storefront authorization above $0.095 USDC. Select individual workers with MAINNET_X402_TEST_WORKERS or use pnpm test:mainnet:all; multi-worker runs require the exact acknowledgement PAY_UP_TO_0_095_USDC_WITH_DISTINCT_BUYER_ON_BASE. Its output deliberately omits wallet addresses, transaction hashes, request bodies, and provider responses.

Reinvest USDC into DIEM

The treasury is a deterministic one-shot runner, not a prompt-driven wallet agent.

Create a new dedicated wallet on macOS with:

bash
pnpm wallet:create

The command stores the private key in macOS Keychain and writes only the public address and Keychain labels to .env. It refuses to replace an existing wallet and requires payments and treasury execution to be disabled.

For seed-phrase recovery, create a dedicated wallet in a trusted wallet app, keep its seed phrase offline, export only its treasury account private key, and import that key through a hidden local prompt:

bash
pnpm wallet:import

Never enter the seed phrase into the project. The import command displays the derived public address for confirmation, stores the account key in macOS Keychain, and replaces the previous disabled treasury configuration only after Keychain readback succeeds.

Verify ownership and read Base balances without revealing the key:

bash
pnpm wallet:verify

See docs/WALLET_ACCESS.md for the macOS-authenticated recovery and wallet-import path. Never send a private key through chat; if you already control a wallet, share only its public 0x address.

Quote-only mode reads balances and requests an indicative 0x price, but never signs:

dotenv
TREASURY_MODE=quoteTREASURY_ADDRESS=0xYourDedicatedEvmAddressBASE_RPC_URL=https://your-base-rpc.exampleZEROX_API_KEY=...TREASURY_MIN_SWAP_USDC=5TREASURY_MAX_SWAP_USDC=25TREASURY_USDC_HOLDBACK=0TREASURY_MAX_SLIPPAGE_BPS=100TREASURY_MIN_ETH_RESERVE=0.0005
bash
pnpm treasury:run

Live mode additionally requires the matching dedicated key from macOS Keychain (or a production secret manager) and an exact acknowledgement:

dotenv
TREASURY_MODE=liveTREASURY_LIVE_ACK=BUY_DIEM_ONLY_ON_BASE

Use a production secret manager rather than a plaintext .env when deployed. The live runner:

  • Refuses a key that does not match TREASURY_ADDRESS
  • Refuses the wrong token pair, chain, allowance target, native value, or excess gas
  • Approves only the intended USDC amount
  • Refreshes the firm quote after approval
  • Records the signed transaction hash before broadcast and reconciles it after a restart
  • Verifies that USDC decreased by no more than the authorized amount and DIEM increased
  • Writes 0600 JSONL audit records under data/

The runner does not sell DIEM, withdraw USDC, bridge assets, select arbitrary tokens, or stake DIEM.

Machine discovery

  • GET /v1/catalog — capabilities, schemas, constraints, price
  • GET /v1/stats — lifetime aggregate reliability and settlement counters with no caller identities or time series
  • GET /.well-known/agent-catalog.json — crawler-friendly catalog alias
  • GET /openapi.json — OpenAPI 3.1 contract
  • GET /llms.txt — concise agent-readable index
  • GET /.well-known/agent-card.json — A2A 1.0 Agent Card
  • POST /a2a — A2A 1.0 JSON-RPC SendMessage adapter at a fixed $0.020 USDC price
  • POST /mcp — stateless Streamable HTTP MCP server with free catalog, quote, and call-preparation tools
  • skills/extract-text-to-json/ — portable agent skill
  • GET /icon.svg — stable service icon used by x402 Bazaar metadata
  • x402 Bazaar metadata — schemas, service name, five topical tags, and icon automatically attached when payments are enabled

The MCP adapter intentionally does not accept wallet keys. Agents execute prepared calls with their own x402-capable client or use Coinbase's Bazaar MCP server, which can discover indexed x402 resources.

The remote MCP server is described by server.json under the io.github.coastmancoastman/diem-agent-workers namespace for publication to the official MCP Registry.

Private storefront telemetry

Production emits one-line JSON events to the server runtime log. The schema is an explicit allowlist: route category, HTTP status, latency, worker, coarse error class, model, exact settled price, and estimated DIEM cost/margin. Cost estimates use Venice's public model-pricing catalog and do not query account balances or billing history.

Telemetry never includes prompts, outputs, prompt length, token counts, raw URLs, request IDs, IP addresses, user agents, headers, payer identities, transaction hashes, provider request IDs, or credentials. Telemetry failure never blocks a worker response.

Create a local aggregate report from a saved JSONL file:

bash
pnpm telemetry:report /absolute/path/to/runtime-logs.jsonl

Or report recent production logs from the linked Vercel project:

bash
vercel logs --environment production --since 24h --no-branch --json --limit 1000 \  | pnpm telemetry:report

The report contains request and payment counts, settled USDC revenue, estimated DIEM cost and gross margin, latency percentiles, and coarse failure counts. It cannot reconstruct individual customer content or identity.

Because serverless runtime logs are not a durable business ledger, production also writes atomic lifetime aggregate counters to the same Upstash database used for safety state. GET /v1/stats publishes completed/failed runs, coarse failure classes, fixed latency buckets, settlements, revenue, and DIEM estimates by worker. The counter key contains no dates or timestamps, and the write API accepts no free-form customer or request fields.

Security and legal notes

Use of the service is governed by TERMS.md, also published at /terms. Read SECURITY.md and docs/END_USER_TERMS_CHECKLIST.md before accepting third-party work. AI output matching a schema is not proof that its contents are correct. Do not use this worker for high-stakes decisions.

Verification

The current production acceptance evidence, including all six Base Sepolia settlement transactions, is recorded in docs/BASE_SEPOLIA_ACCEPTANCE.md.

bash
pnpm checkpnpm testpnpm buildpnpm generate:openapiALLOW_VENICE_EVAL=1 VENICE_EVAL_MODELS=venice-uncensored-1-2 pnpm eval:text

The live evaluation is opt-in because it consumes Venice capacity. It prints aggregate accuracy and latency only; it does not persist prompts or provider responses.

來源:README.md,提交 fbeb642

工具

3

list_diem_workers

List DIEM Agent Workers

List bounded x402-paid workers, exact USDC prices, schemas, limits, and endpoints. This tool is free.

無需輸入參數。

quote_diem_worker

Quote a DIEM Agent Worker

Return a free exact-price x402 USDC quote for one worker.

輸入參數worker必填

prepare_diem_worker_call

Prepare a DIEM Worker Call

Validate worker selection and return the exact HTTP request shape. Execute it with an x402-capable client or through the CDP Bazaar MCP server; this server never receives wallet private keys.

輸入參數input必填worker必填

版本歷史

1
  1. v0.6.1最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Workers 整合