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 分