SDK・ツール連携ガイド

各種AIエージェントやCI/CDツールとHuman Testerを連携する方法をまとめています。

NPMパッケージ

@human-tester/mcp-server

MCP対応AIエージェントから人間テスターサービスを利用するためのサーバー

# npx経由で自動インストール(推奨)
npx @human-tester/mcp-server

# グローバルインストール
npm install -g @human-tester/mcp-server

# プロジェクトにインストール
npm install @human-tester/mcp-server

Claude Code

Anthropicの公式CLIツール。MCP設定ファイルに追加するだけで連携可能。

設定

// .claude/mcp.json
{
  "mcpServers": {
    "human-tester": {
      "command": "npx",
      "args": ["-y", "@human-tester/mcp-server"],
      "env": {
        "HT_API_KEY": "ht_live_your_api_key"
      }
    }
  }
}

使い方

「このLPを5人のユーザーにUXテストしてもらって」
→ AIが自動的にcreate_testツールを呼び出し、テストを作成します

Cursor

AI搭載のコードエディタ。設定画面のMCPセクションから連携設定を追加。

設定

// .cursor/mcp.json
{
  "mcpServers": {
    "human-tester": {
      "command": "npx",
      "args": ["-y", "@human-tester/mcp-server"],
      "env": {
        "HT_API_KEY": "ht_live_your_api_key"
      }
    }
  }
}

使い方

Cursorのチャットで「前回のテスト結果を見せて」
→ get_test_resultsツールが呼び出され、結果がチャット上に表示されます

REST API (cURL / fetch)

任意のHTTPクライアントからREST API経由で直接呼び出し。CI/CDパイプラインへの組み込みにも最適。

設定

# テストを作成する
curl -X POST https://human-tester.jp/api/tests \
  -H "Authorization: Bearer ht_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "新機能のUX評価",
    "description": "新しい機能の使いやすさをテスト",
    "category": "ux_test",
    "target_url": "https://your-app.com",
    "target_testers": 5,
    "test_scenario": {
      "tasks": [
        {
          "instruction": "トップページの第一印象を教えてください",
          "evaluation_items": [
            { "label": "見やすさ", "type": "rating_5" },
            { "label": "改善点", "type": "free_text" }
          ]
        }
      ]
    }
  }'

使い方

# テスト結果を取得する
curl https://human-tester.jp/api/tests/{testId}/results \
  -H "Authorization: Bearer ht_live_your_api_key"

JavaScript / TypeScript

fetch APIを使ったプログラムからの直接呼び出し。

設定

const API_KEY = process.env.HT_API_KEY;
const BASE_URL = "https://human-tester.jp";

// テストを作成
const res = await fetch(`${BASE_URL}/api/tests`, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "新LP UXテスト",
    description: "LPの第一印象と使いやすさを評価",
    category: "ux_test",
    target_url: "https://example.com",
    target_testers: 5,
    test_scenario: {
      tasks: [{
        instruction: "トップページの第一印象を教えてください",
        evaluation_items: [
          { label: "見やすさ", type: "rating_5" },
          { label: "改善点", type: "free_text" }
        ]
      }]
    }
  }),
});

const data = await res.json();
console.log(data.test.id); // テストID

使い方

// 結果を取得
const results = await fetch(
  `${BASE_URL}/api/tests/${testId}/results`,
  { headers: { "Authorization": `Bearer ${API_KEY}` } }
).then(r => r.json());

console.log(results.summary.key_findings);

推奨ワークフロー

開発 → テスト → 改善サイクル

  1. AIエージェントで機能やUIを実装
  2. MCP経由でUXテストまたはバグハントを依頼
  3. テスト結果をAIエージェントに読み込ませる
  4. フィードバックに基づきAIエージェントが自動改善
  5. 必要に応じて再テストを実施

CI/CDパイプライン統合

  1. デプロイ後のWebhookでテストを自動作成(POST /api/tests)
  2. REST APIでテストステータスをポーリング(GET /api/tests/:id/status)
  3. 完了後に結果を取得(GET /api/tests/:id/results)
  4. 品質スコアが閾値を下回った場合にSlack/メールでアラート

リリース前チェックリスト

  1. UXテスト: 5人以上のユーザーによるUI評価(category: ux_test)
  2. ユーザビリティテスト: 主要フローの操作確認(category: usability_test)
  3. バグハント: 探索的テストでの不具合洗い出し(category: bug_hunt)
  4. A/Bテスト: デザイン案の比較評価(category: ab_test)

環境変数リファレンス

変数名説明必須
HT_API_KEYAPIキー(ht_live_ で始まる。ダッシュボードで発行)必須
HT_API_URLAPIのベースURL(デフォルト: https://human-tester.jp)任意

次のステップ