本報告書は、タイ・プランブリーの水産加工事業者 GYOTAK が構築した、AI エージェントが直接魚を検索・注文・決済できるインフラの実装記録である。Model Context Protocol (MCP) サーバーを Cloudflare Workers 上に構築し、x402 プロトコルによるマイクロペイメント決済を統合した。さらに、決済ウォレットアドレスによる B2B 顧客自動識別と顧客別 tier 価格適用を実現している。
AIエージェントが GYOTAK の在庫を検索し、Base USDC で $0.001〜$0.005 のマイクロペイメントを支払い、VIP 顧客は決済ウォレットで自動認証されて顧客別価格で発注できる。
2025年以降、AI エージェント同士が直接通信・取引する Agent-to-Agent (A2A) 時代が到来した。Google の A2A プロトコル、Anthropic の MCP、Coinbase の x402 が相次いで発表され、AI エージェントが人間の介在なしに情報取得・意思決定・決済を行うインフラが整備されつつある。
GYOTAK は、この変化に対応するため「AIエージェントが直接アクセスできる魚市場」の構築を決定した。これは単なる API 公開ではなく、AIが理解できるメタデータ付きのツール群 + 自動マイクロペイメント + 顧客認証を統合した、世界初の水産物 MCP サーバーである。
MCP サーバー構築に先立ち、GYOTAK は AEO (AI Engine Optimization) / GEO (Generative Engine Optimization) を実施した。Google AI Overview、ChatGPT、Perplexity 等のジェネレーティブ AI が GYOTAK の情報を正確に引用できるよう、構造化データ(Schema.org JSON-LD)、Catch Report ブログ(GPS・写真ハッシュ付き)、多言語コンテンツ(JP/EN/TH)を整備した。
Cloudflare Workers 上の Hono フレームワークで MCP サーバーを実装。HTTP トランスポート + JSON-RPC 2.0 プロトコルに準拠。
POST https://line-harness.gyotak.workers.dev/mcp
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": { "name": "get_catalog", "arguments": {} }
}
| Tool | Price | Description |
|---|---|---|
get_catalog | $0.001 | 在庫一覧 + トレーサビリティ情報 |
search_fish | $0.001 | 魚名検索(日本語・タイ語・英語) |
get_catch_reports | $0.002 | 漁獲記録(GPS・鮮度tier別) |
get_contact_info | Free | 購入方法・連絡先 |
place_order | $0.005 | B2B発注(VIP認証必須) |
get_order_history | $0.002 | 注文履歴(VIP認証必須) |
GET https://line-harness.gyotak.workers.dev/.well-known/mcp.json
MCP サーバーは Smithery.ai に登録済み。AI エージェントが Smithery 経由で GYOTAK を発見・接続できる。
MCP サーバーの稼働は Internet Archive の Wayback Machine で第三者検証可能な形で記録されている。
x402 は、Coinbase が策定した HTTP ネイティブの自動決済プロトコルである。HTTP 402 (Payment Required) ステータスコードを活用し、AI エージェントがリソースアクセス時に自動で決済を行う。
x402-hono パッケージ(viem + Solana SDK、16MB超)は Cloudflare Workers のバンドルサイズ制限に抵触するため、プロトコル仕様に準拠したカスタム実装を行った。外部依存パッケージゼロ、fetch API のみの軽量実装(117行)。
| Network | Base mainnet |
|---|---|
| Asset | USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| PayTo | 0xdE04bEfD9F250FDC865fA448f206d1E83814C221 |
| Facilitator | https://x402.org/facilitator |
| Scheme | exact |
| Implementation | 117 lines, zero dependencies |
// apps/worker/src/lib/x402.ts (117 lines, zero dependencies)
const FACILITATOR_URL = 'https://x402.org/facilitator';
export const TOOL_PRICES: Record<string, number> = {
get_catalog: 1000, // $0.001
search_fish: 1000, // $0.001
get_catch_reports: 2000, // $0.002
place_order: 5000, // $0.005 (VIP only)
get_order_history: 2000, // $0.002 (VIP only)
};
export function buildPaymentRequirements(
toolName: string, resource: string
): PaymentRequirements {
return {
scheme: 'exact',
network: 'base',
maxAmountRequired: (TOOL_PRICES[toolName] || 0).toString(),
payTo: '0xdE04bEfD9F250FDC865fA448f206d1E83814C221',
asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
maxTimeoutSeconds: 300,
// ...
};
}
x402 の決済ウォレットアドレスを活用し、顧客の追加作業ゼロで B2B 顧客を自動識別するシステムを構築した。
// apps/worker/src/services/gyotak-inventory.ts
export async function getB2BCustomerByWallet(
token: string, b2bSheetId: string, walletAddress: string,
): Promise<(B2BCustomer & { lineUserId: string }) | null> {
const url = `...B2B Customers!A2:Z`;
const wallet = walletAddress.toLowerCase();
for (const row of rows) {
const agentWallet = (row[25] || '').trim().toLowerCase(); // Z列
if (agentWallet && agentWallet === wallet) {
return {
companyName: row[1],
tier1Rate: parseFloat(row[16]) || 0.95,
tier2Rate: parseFloat(row[17]) || 0.90,
// ...
};
}
}
return null;
}
$ curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://line-harness.gyotak.workers.dev/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"get_catalog","arguments":{}}}'
402
$ curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://line-harness.gyotak.workers.dev/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
"params":{"name":"get_contact_info","arguments":{}}}'
200
{
"jsonrpc": "2.0",
"id": 1,
"error": { "code": -32000, "message": "Payment required" },
"accepts": [{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "1000",
"payTo": "0xdE04bEfD9F250FDC865fA448f206d1E83814C221",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"maxTimeoutSeconds": 300
}],
"x402Version": 1
}
| Phase | Description | Status |
|---|---|---|
| Phase 1 | MCP サーバー + x402 決済 (Base USDC) | Complete |
| Phase 2 | VIP AIエージェント認証 (agentWallet) | Complete |
| Phase 3 | Cardano x402 対応 (Masumi Network) | Planned |
| Phase 4 | Midnight ZKP トレーサビリティ連携 | Planned |
| Phase 5 | マルチチェーン (ADA / USDCx / USDA / USDM / DJED) | Planned |
| Layer | Technology |
|---|---|
| Runtime | Cloudflare Workers (Hono) |
| Database | Cloudflare D1 (SQLite) |
| KV Store | Cloudflare KV |
| MCP Protocol | JSON-RPC 2.0 / HTTP Transport / 2024-11-05 |
| x402 Protocol | Custom lightweight (zero deps, 117 lines) |
| Payment Network | Base mainnet (USDC) |
| Facilitator | Coinbase CDP (x402.org) |
| B2B Data | Google Sheets API (B2B Customers) |
| Traceability | GPS + SHA-256 photo hash + Catch Reports |
| Blockchain | Midnight (Cardano partner chain) ZKP — planned |
This report documents the implementation of an infrastructure enabling AI agents to directly search, order, and pay for fish products. GYOTAK, a seafood processor in Pranburi, Thailand, built a Model Context Protocol (MCP) server on Cloudflare Workers, integrated x402 protocol micropayments, and implemented automatic B2B customer identification via payment wallet addresses with per-customer tier pricing.
AI agents can search GYOTAK's inventory, pay $0.001–$0.005 in Base USDC micropayments, and VIP customers are auto-authenticated by their payment wallet to receive tier-specific pricing and place orders.
Since 2025, the Agent-to-Agent (A2A) era has arrived. Google's A2A protocol, Anthropic's MCP, and Coinbase's x402 were announced in rapid succession, establishing infrastructure for AI agents to retrieve information, make decisions, and execute payments without human intervention.
GYOTAK decided to build "a fish market directly accessible by AI agents" — the world's first seafood MCP server integrating AI-readable tool metadata, automatic micropayments, and customer authentication.
Prior to MCP server construction, GYOTAK implemented AEO (AI Engine Optimization) / GEO (Generative Engine Optimization). Structured data (Schema.org JSON-LD), Catch Report blog posts (with GPS and photo hashes), and multilingual content (JP/EN/TH) were prepared so that generative AI systems could accurately cite GYOTAK information.
The MCP server is implemented on Cloudflare Workers using the Hono framework, conforming to HTTP transport + JSON-RPC 2.0.
POST https://line-harness.gyotak.workers.dev/mcp
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": { "name": "get_catalog", "arguments": {} }
}
| Tool | Price | Description |
|---|---|---|
get_catalog | $0.001 | Full inventory + traceability |
search_fish | $0.001 | Fish name search (JP/TH/EN) |
get_catch_reports | $0.002 | Catch records (GPS, tier) |
get_contact_info | Free | Purchase methods & contact |
place_order | $0.005 | B2B order (VIP auth required) |
get_order_history | $0.002 | Order history (VIP auth required) |
GET https://line-harness.gyotak.workers.dev/.well-known/mcp.json
The MCP server is registered on Smithery.ai. AI agents can discover and connect to GYOTAK via Smithery.
x402 is an HTTP-native automatic payment protocol by Coinbase. It leverages HTTP 402 (Payment Required) status codes, enabling AI agents to automatically pay when accessing resources.
The x402-hono package (viem + Solana SDK, 16MB+) exceeds Cloudflare Workers bundle size limits. A custom implementation conforming to the protocol specification was built — zero external dependencies, fetch API only, 117 lines.
| Network | Base mainnet |
|---|---|
| Asset | USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| PayTo | 0xdE04bEfD9F250FDC865fA448f206d1E83814C221 |
| Facilitator | https://x402.org/facilitator |
| Scheme | exact |
| Implementation | 117 lines, zero dependencies |
// apps/worker/src/lib/x402.ts (117 lines, zero dependencies)
const FACILITATOR_URL = 'https://x402.org/facilitator';
export const TOOL_PRICES: Record<string, number> = {
get_catalog: 1000, // $0.001
search_fish: 1000, // $0.001
get_catch_reports: 2000, // $0.002
place_order: 5000, // $0.005 (VIP only)
get_order_history: 2000, // $0.002 (VIP only)
};
export function buildPaymentRequirements(
toolName: string, resource: string
): PaymentRequirements {
return {
scheme: 'exact',
network: 'base',
maxAmountRequired: (TOOL_PRICES[toolName] || 0).toString(),
payTo: '0xdE04bEfD9F250FDC865fA448f206d1E83814C221',
asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
maxTimeoutSeconds: 300,
// ...
};
}
A system leveraging x402 payment wallet addresses to automatically identify B2B customers with zero additional effort from the customer.
// apps/worker/src/services/gyotak-inventory.ts
export async function getB2BCustomerByWallet(
token: string, b2bSheetId: string, walletAddress: string,
): Promise<(B2BCustomer & { lineUserId: string }) | null> {
const wallet = walletAddress.toLowerCase();
for (const row of rows) {
const agentWallet = (row[25] || '').trim().toLowerCase(); // Z column
if (agentWallet && agentWallet === wallet) {
return {
companyName: row[1],
tier1Rate: parseFloat(row[16]) || 0.95,
tier2Rate: parseFloat(row[17]) || 0.90, ...
};
}
}
return null;
}
$ curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://line-harness.gyotak.workers.dev/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"get_catalog","arguments":{}}}'
402
$ curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://line-harness.gyotak.workers.dev/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
"params":{"name":"get_contact_info","arguments":{}}}'
200
{
"jsonrpc": "2.0",
"id": 1,
"error": { "code": -32000, "message": "Payment required" },
"accepts": [{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "1000",
"payTo": "0xdE04bEfD9F250FDC865fA448f206d1E83814C221",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"maxTimeoutSeconds": 300
}],
"x402Version": 1
}
| Phase | Description | Status |
|---|---|---|
| Phase 1 | MCP Server + x402 Payment (Base USDC) | Complete |
| Phase 2 | VIP AI Agent Authentication (agentWallet) | Complete |
| Phase 3 | Cardano x402 Support (Masumi Network) | Planned |
| Phase 4 | Midnight ZKP Traceability Integration | Planned |
| Phase 5 | Multi-chain (ADA / USDCx / USDA / USDM / DJED) | Planned |
| Layer | Technology |
|---|---|
| Runtime | Cloudflare Workers (Hono) |
| Database | Cloudflare D1 (SQLite) |
| KV Store | Cloudflare KV |
| MCP Protocol | JSON-RPC 2.0 / HTTP Transport / 2024-11-05 |
| x402 Protocol | Custom lightweight (zero deps, 117 lines) |
| Payment Network | Base mainnet (USDC) |
| Facilitator | Coinbase CDP (x402.org) |
| B2B Data | Google Sheets API (B2B Customers) |
| Traceability | GPS + SHA-256 photo hash + Catch Reports |
| Blockchain | Midnight (Cardano partner chain) ZKP — planned |
รายงานฉบับนี้บันทึกการสร้างโครงสร้างพื้นฐานที่ช่วยให้ AI Agent สามารถค้นหา สั่งซื้อ และชำระเงินสำหรับผลิตภัณฑ์ปลาได้โดยตรง GYOTAK ผู้แปรรูปอาหารทะเลในปราณบุรี ประเทศไทย ได้สร้าง MCP Server บน Cloudflare Workers รวมการชำระเงินขนาดเล็กผ่านโปรโตคอล x402 และระบบระบุลูกค้า B2B อัตโนมัติผ่านที่อยู่กระเป๋าเงินพร้อมราคาตามระดับลูกค้า
AI Agent สามารถค้นหาสินค้าคงคลังของ GYOTAK ชำระเงิน $0.001–$0.005 ด้วย Base USDC และลูกค้า VIP จะได้รับการยืนยันตัวตนอัตโนมัติด้วยกระเป๋าเงินเพื่อรับราคาเฉพาะลูกค้า
ตั้งแต่ปี 2025 ยุค Agent-to-Agent (A2A) ได้มาถึง โปรโตคอล A2A ของ Google, MCP ของ Anthropic และ x402 ของ Coinbase ถูกประกาศอย่างต่อเนื่อง สร้างโครงสร้างพื้นฐานสำหรับ AI Agent ในการดึงข้อมูล ตัดสินใจ และชำระเงินโดยไม่ต้องมีคนเข้ามาเกี่ยวข้อง
ก่อนสร้าง MCP Server GYOTAK ได้ดำเนินการ AEO / GEO เตรียมข้อมูลโครงสร้าง (Schema.org JSON-LD) บล็อก Catch Report (พร้อม GPS และแฮชรูปภาพ) และเนื้อหาหลายภาษา (JP/EN/TH)
MCP Server สร้างบน Cloudflare Workers โดยใช้เฟรมเวิร์ก Hono ตามมาตรฐาน HTTP Transport + JSON-RPC 2.0
| เครื่องมือ | ราคา | คำอธิบาย |
|---|---|---|
get_catalog | $0.001 | สินค้าคงคลัง + การตรวจสอบย้อนกลับ |
search_fish | $0.001 | ค้นหาชื่อปลา (ญี่ปุ่น ไทย อังกฤษ) |
get_catch_reports | $0.002 | บันทึกการจับ (GPS, ระดับความสด) |
get_contact_info | ฟรี | ข้อมูลการซื้อและติดต่อ |
place_order | $0.005 | สั่งซื้อ B2B (ต้องยืนยัน VIP) |
get_order_history | $0.002 | ประวัติการสั่งซื้อ (ต้องยืนยัน VIP) |
ลงทะเบียนบน Smithery.ai แล้ว
x402 เป็นโปรโตคอลการชำระเงินอัตโนมัติแบบ HTTP-native โดย Coinbase ใช้ HTTP 402 (Payment Required) ช่วยให้ AI Agent ชำระเงินอัตโนมัติ
สร้างการใช้งานแบบกำหนดเอง ไม่มี dependency ภายนอก ใช้เฉพาะ fetch API (117 บรรทัด)
| Network | Base mainnet |
|---|---|
| Asset | USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| PayTo | 0xdE04bEfD9F250FDC865fA448f206d1E83814C221 |
| Facilitator | https://x402.org/facilitator |
ใช้ที่อยู่กระเป๋าเงิน x402 เพื่อระบุลูกค้า B2B โดยอัตโนมัติ ลูกค้าไม่ต้องดำเนินการเพิ่มเติมใดๆ
เครื่องมือเสียเงิน (ไม่ชำระ) → 402 | เครื่องมือฟรี → 200
| เฟส | คำอธิบาย | สถานะ |
|---|---|---|
| Phase 1 | MCP Server + x402 (Base USDC) | เสร็จ |
| Phase 2 | VIP AI Agent Authentication | เสร็จ |
| Phase 3 | Cardano x402 (Masumi Network) | วางแผน |
| Phase 4 | Midnight ZKP Traceability | วางแผน |
| Phase 5 | Multi-chain (ADA / USDCx / USDA / USDM / DJED) | วางแผน |
| ระดับ | เทคโนโลยี |
|---|---|
| Runtime | Cloudflare Workers (Hono) |
| Database | Cloudflare D1 (SQLite) |
| MCP | JSON-RPC 2.0 / HTTP Transport |
| x402 | Custom lightweight (117 lines) |
| Payment | Base mainnet (USDC) |
| Facilitator | Coinbase CDP (x402.org) |
| Blockchain | Midnight (Cardano) ZKP — วางแผน |