Hive A/B Test

io.github.srotzin由 GitHub 帳號 srotzin 發布v1.0.0更新於 Oct 28, 2026

A/B experiment runner for the A2A network with x402 micropayments on Base USDC.

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

概覽

AI 產生的概覽

遠端 MCP 服務,為代理指派固定的 A/B 實驗分組、記錄轉換,並回傳兩比例 Z 檢定結果,依次以 USDC 付費。

可以做什麼
  • 為代理指派實驗變體,分組由雜湊決定且維持固定
  • 為已指派的代理與實驗記錄轉換事件
  • 讀取彙總計數及兩比例 Z 檢定結果,含 p 值、相對提升與顯著性標記
  • 透過搭配的 REST 介面建立、更新與刪除實驗
適用情境
適合需要共用、具確定性的 A/B 分組與轉換統計服務,且自帶顯著性檢定的自主代理情境,無須自行實作實驗邏輯。
執行需求
需要遠端 streamable HTTP 端點,未宣告本機安裝或帳號。呼叫受 Base 鏈上 USDC 的 x402 微支付限制:首次未付費呼叫會回傳帶 nonce 的 402,需提交交易雜湊與付款方以換取短期存取權杖。自行部署需 Node.js 與 SQLite 路徑。
安裝前請注意
指派與轉換呼叫依次收費(每次 0.001 與 0.005 美元),需在 Base 鏈上支付 USDC,代理可能因此產生實際支出。服務會將實驗、指派與轉換紀錄存入 SQLite,代理識別碼會傳送至第三方主機。免費的結果工具為唯讀;REST 介面還可建立、更新與刪除實驗。

安裝

在 SourceWeft 中

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

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

交給代理程式安裝

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

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

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

其他 MCP 客戶端

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

{
  "mcpServers": {
    "hive-a-b-test": {
      "type": "http",
      "url": "https://hive-mcp-abtest.onrender.com/mcp"
    }
  }
}

README

hive-mcp-abtest

[srotzin/hive-mcp-abtest MCP server]

A/B experiment runner for the A2A network. An inbound-only MCP shim that gives autonomous agents a deterministic, sticky bucket assignment, a conversion-recording endpoint, and a two-proportion Z-test stat-sig calculator. Pricing is per call via x402 on Base USDC.

  • $0.001 per abtest_assign
  • $0.005 per abtest_record_conversion
  • abtest_results is free and read-only

The shim does not run experiments on behalf of the caller. It records assignments and conversions for experiments the caller registers, and returns aggregate counts and a Z-test on demand.

How bucket assignment works

Bucket is SHA-256(experiment_id + "|" + agent_did), with the first four bytes read as an unsigned 32-bit integer, modulo the sum of variant weights. The first call writes the result. Subsequent calls return the same row, so assignment is sticky for the lifetime of the SQLite store.

A variant list is [{ id, weight? }, ...]. Weight defaults to 1 per variant. Pass [{id:"control"},{id:"treatment",weight:3}] for a 25/75 split.

Stat-sig calculator

Two-proportion Z-test with pooled variance over the first two registered variants. Output includes z_score, two-sided p_value, relative_lift, and significant_95 / significant_99 boolean flags.

MCP

  • Transport: Streamable HTTP, JSON-RPC 2.0
  • Protocol: 2024-11-05
  • Endpoint: POST /mcp

Tools:

ToolTierPrice
abtest_assign3$0.001
abtest_record_conversion3$0.005
abtest_results0free

REST

MethodPathPurpose
GET/v1/abtestList experiments
POST/v1/abtestCreate or upsert experiment { id, name?, variants }
GET/v1/abtest/:idGet experiment
PUT/v1/abtest/:idUpdate experiment
DELETE/v1/abtest/:idDelete experiment
POST/v1/abtest/assign{ experiment_id, agent_did, variants? } — $0.001
POST/v1/abtest/convert{ experiment_id, agent_did, metric?, value? } — $0.005
GET/v1/abtest/results?experiment_id=...&metric=... — Z-test included
GET/v1/abtest/todayUTC-day assignment + conversion counts
GET/healthLiveness, version, and DB check

Storage

SQLite at /tmp/abtest.db with three tables: experiments, assignments, conversions. Override with DB_PATH.

Environment

VariableDefault
PORT3000
ENABLEtrue
WALLET_ADDRESS0x15184bf50b3d3f52b60434f8942b7d52f2eb436e
PRICE_ASSIGN_USDC0.001
PRICE_CONVERT_USDC0.005
DB_PATH/tmp/abtest.db
X402_ENABLEDtrue

Set X402_ENABLED=false to bypass payment gating in local development.

Quickstart

bash
npm installnpm start# in another shellcurl -s http://localhost:3000/healthcurl -s -X POST http://localhost:3000/v1/abtest \  -H 'content-type: application/json' \  -d '{"id":"prompt_v2","name":"prompt v2","variants":[{"id":"control"},{"id":"treatment","weight":3}]}'curl -s -X POST http://localhost:3000/v1/abtest/assign \  -H 'content-type: application/json' -H 'x-payment: {}' \  -d '{"experiment_id":"prompt_v2","agent_did":"did:hive:demo:1"}'

The first call without a paid x402 envelope returns a 402 body with a fresh nonce. Submit a tx hash and payer to /v1/x402/submit to mint a short-lived access token, then retry.

License

MIT. See LICENSE.

Author

Steve Rotzin · [email protected] · https://www.thehiveryiq.com

Hive Civilization Directory

Part of the Hive Civilization — agent-native financial infrastructure.

Brand: #C08D23

來源:README.md,提交 f3fb6ae

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

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

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