スキル一覧に戻る
Sunalamye

naki-mcp-proxy

by Sunalamye

雀魂麻將 AI 助手 - 純 Swift + Core ML 實現

1🍴 0📅 2026年1月1日
GitHubで見るManusで実行

SKILL.md


name: naki-mcp-proxy description: Token-efficient proxy for Naki's 47 MCP tools. Routes user intent to optimal MCP tool via agent isolation, saving 40-70% tokens. Use for any Naki game control, bot status, or UI operation. allowed-tools:

  • Task
  • Read
  • Bash

Naki MCP Proxy

Base directory: {baseDir}

Core Mission

Provide token-efficient access to Naki's 47 MCP tools through agent-based proxy pattern. Main context stays lightweight (~100-200 tokens) while tool schemas load only in agent context.

Architecture

User Intent → Skill Router → Agent (tool discovery + execution) → Result
     ↓              ↓                    ↓                          ↓
  ~50 tokens    ~50 tokens        ~500-1500 tokens (isolated)   Formatted output

Token Savings: 40-70% compared to direct MCP tool loading.

Execution Protocol

Step 1: Intent Classification

Classify user request into tool category:

CategoryKeywordsPrimary Tools
Bot 控制推薦、AI、自動打、觸發bot_status, bot_trigger
遊戲狀態手牌、遊戲、出牌、動作game_state, game_hand, game_action
高亮高亮、顏色、推薦顯示highlight_tile, show_recommendations
大廳匹配、段位、大廳lobby_start_match, lobby_status
表情表情、emojigame_emoji, game_emoji_list
UI點擊、JS、玩家名稱execute_js, click, ui_names_*
系統日誌、狀態、幫助get_logs, get_status, get_help

Step 2: Agent Dispatch

Launch agent with tool execution prompt:

Task tool with subagent_type="general-purpose":
prompt: |
  Execute Naki MCP tool for: [user intent]

  Available tools (port 8765):
  - [relevant tools based on category]

  Steps:
  1. Call mcp__naki__[tool_name] with appropriate parameters
  2. Parse and format response
  3. Return concise result

  If tool fails, try alternative or report error.

Step 3: Result Formatting

Return agent result to user with:

  • Key data points (hand tiles, recommendations, status)
  • Action taken confirmation
  • Error explanation if failed

Tool Quick Reference

Most Used Tools

IntentToolExample
查看 AI 推薦bot_status顯示手牌和推薦動作
觸發自動打牌bot_trigger執行 AI 推薦的動作
查看遊戲狀態game_state當前局面完整信息
執行遊戲動作game_action出牌、吃、碰、槓
高亮手牌highlight_tile指定牌高亮顯示
開始匹配lobby_start_match段位場匹配
執行 JSexecute_js遊戲內 JavaScript
查看日誌get_logsDebug 日誌記錄

Tool Categories (47 total)

CategoryCountSee Reference
系統類4{baseDir}/references/tool-catalog.md
Bot 控制7
遊戲狀態6
高亮控制6
表情4
大廳9
UI 控制11

Common Workflows

1. 自動段位場流程

1. lobby_status      → 確認在大廳
2. lobby_navigate    → 前往段位場 (page: 1)
3. lobby_start_match → 開始匹配 (match_mode: 5 = 銀半)
4. bot_status        → 等待並查看推薦

2. 手牌調試流程

1. game_state   → 獲取完整遊戲狀態
2. game_hand    → 查看手牌詳情
3. bot_status   → 查看 AI 分析
4. get_logs     → 檢查操作日誌

3. 高亮測試流程

1. highlight_status  → 查看當前狀態
2. highlight_tile    → 高亮指定牌 (tileIndex, color)
3. hide_highlight    → 清除所有高亮

Match Mode Reference

ID段位場
1, 2銅東, 銅半
4, 5銀東, 銀半
7, 8金東, 金半
10, 11玉東, 玉半
13, 14王座東, 王座半

Error Handling

ErrorCauseResolution
Tool not foundNaki 未啟動啟動 Naki app
Port 8765 unavailable埠被佔用lsof -i :8765 檢查
Game API unavailable遊戲未載入使用 detect 檢查
Bot not active未在遊戲中等待遊戲開始

Resource Index

ResourcePurposeLoad When
{baseDir}/references/tool-catalog.md完整 47 工具列表和參數需要查找工具參數
{baseDir}/references/usage-patterns.md進階使用模式複雜操作場景

Naki MCP Proxy v1.0 - Token-Efficient Game Control

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です