Pokemon市场MCP服务器

一个为Pokemon市场设计的TypeScript MCP服务器,支持Shopify商店产品管理、购物车操作、Unicity支付和卡片回购功能。

  • by joshuajbouw
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 joshuajbouw/pokemonmarket-mcp

使用说明

口袋妖怪市场MCP服务器

用于口袋妖怪市场的TypeScript MCP(模型上下文协议)服务器,如[Runic Vault] (https://runic-vault.ae)-人工智能通过真正的Unicity代币支付辅助电子商务。

为Unicity Labs打造,作为对话式商务的演示。

概述

此服务器连接到真实的Runic Vault Shopify商店,并启用:

  • 真实产品 来自Shopify Storefront API(带图片)
  • 购物车 本地管理
  • 真正的Unicity支付 通过Nostr协议
  • 回购/购买清单 -以70%的零售价将卡片卖回商店

工具

工具 说明
search_products 搜索带有图片的产品
get_product 带图片的完整产品详细信息
check_inventory 检查变体库存状态
create_cart 创建新购物车
add_to_cart 将商品添加到购物车
get_cart 查看购物车内容
remove_from_cart 从购物车中删除商品
checkout_with_unicity 启动Unicity支付
confirm_payment 等待并确认付款
get_buyback_offer 检查商店是否正在购买卡(零售额的70%)
submit_to_buylist 提交销售申请以获得店铺批准
check_buylist_status 检查购买清单提交状态

先决条件

  • Node.js 18+
  • Shopify Storefront API代币用于runic-vault.ae
  • Unicity测试网凭据(名称标签、硬币ID)

安装

npm install
cp .env.example .env
# Edit .env with your credentials

配置

# Shopify (required)
SHOPIFY_STORE_DOMAIN=runic-vault.ae
SHOPIFY_STOREFRONT_TOKEN=your_token

# Unicity (required)
MCP_NAMETAG=runic-vault
PAYMENT_COIN_ID=your_coin_id

# Unicity (optional)
NOSTR_RELAY_URL=wss://nostr-relay.testnet.unicity.network
AGGREGATOR_URL=https://goggregator-test.unicity.network
PAYMENT_TIMEOUT_SECONDS=120
DATA_DIR=./data

用法

发展

npm run dev    # Hot reload
npm run build  # Compile
npm start      # Production

克劳德桌面版

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "runic-vault": {
      "command": "node",
      "args": ["/path/to/dist/index.js"],
      "env": {
        "SHOPIFY_STORE_DOMAIN": "runic-vault.ae",
        "SHOPIFY_STOREFRONT_TOKEN": "your_token",
        "MCP_NAMETAG": "runic-vault",
        "PAYMENT_COIN_ID": "your_coin_id"
      }
    }
  }
}

付款流程

1. User: "I'd like to checkout with Unicity"
   → Provides their Unicity ID (e.g., @alice)

2. checkout_with_unicity(cartId, unicityId)
   → Returns: amount in tokens, payment address, event ID

3. User sends tokens via Unicity wallet

4. User: "Confirm my payment"

5. confirm_payment(cartId)
   → Waits for payment (up to 120s)
   → Returns: success or timeout

回购/购买清单

当库存较低时,客户可以以70%的零售价将卡卖回Runic Vault。

1. User: "Do you buy Pokemon cards?"

2. get_buyback_offer(productHandle or variantId)
   → If inventory < 20: Returns offer at 70% of retail
   → If inventory >= 20: "Not currently purchasing"

3. User: "I'd like to sell my card"

4. submit_to_buylist(variantId, sellerUnicityId, quantity)
   → Creates pending request
   → Returns: request ID, offer amount

5. check_buylist_status(requestId)
   → Returns: pending | approved | rejected

项目结构

src/
├── index.ts          # Entry point
├── server.ts         # MCP server
├── config.ts         # Configuration
├── types.ts          # Shared types
├── shopify/          # Shopify API client
├── store/            # Local cart & buy list management
├── unicity/          # Payment integration
│   ├── identity.ts   # Key management
│   ├── nostr.ts      # Payment requests
│   └── payment-tracker.ts
└── tools/            # MCP tools
data/
├── identity.json     # Server identity (auto-generated)
└── tokens/           # Payment receipts

许可证

麻省理工学院