克劳德代码的Wix MCP技能
A. 克劳德代码 帮助AI代理高效导航的技能 Wix MCP 文档工具,最大限度地减少令牌使用和不必要的API调用。
问题
当代理通过MCP需要Wix API信息时,默认的工作流程是昂贵的:
| 工具调用 | 响应大小 |
|---|---|
WixREADME() | ~1950个代币 |
BrowseWixRESTDocsMenu() (无URL) | 约26845个代币 |
BrowseWixRESTDocsMenu() (域URL) | 约23610个代币 |
SearchWixRESTDocumentation() | 约750个代币 |
一个 BrowseWixRESTDocsMenu 无深度URL转储的调用 107K+个字符 结合上下文。其中大部分与查询无关。
解决方案
该技能对13个域中的所有37个Wix MCP配方进行预索引,并以最低的令牌成本将代理路由到正确的文档:
- 内联路由 --域到配方映射位于SKILL.md本身中(无需读取额外文件)
- 即时食谱 --6个单一配方域具有内联URL,可立即
ReadFullDocsArticle读取0个文件 - 文章分类 --多配方域捆绑相关文章进行并行阅读,消除了顺序发现调用
- 快速事实缓存 -常见的API事实(包名称、字段映射、版本检测)通过0个MCP调用回答问题
- 并行执行模式 --推测搜索、集群读取和多域模式匹配或超过原始MCP并行性
- 后备搜索词 --每个配方文件都包含针对recipe_MISS路径的优化搜索词,因此
domain-routing.md很少需要
测量结果(A/B测试:目录V3兼容性问题)
| 代理 | MCP调用 | 总令牌 | 持续时间 | 方法 |
|---|---|---|---|---|
| 原始MCP(无技能) | 12 | 64505 | 84s | 顺序发现,3x浏览菜单 |
| 技能v2 | 3 | 39754 | 50s | 快速事实+并行集群读取 |
| 度量 | 改进 |
|---|---|
| MCP呼叫 | -75% (12 → 3) |
| 代币总数 | -38% (64K → 40K) |
| 挂钟时间 | -40% (84s → 50s) |
| 浏览器菜单调用 | -100% (3 → 0) |
场景对比
| 场景 | 无技能 | 有技能 | 增量 |
|---|---|---|---|
| 即时食谱(博客、媒体等) | ~3950个代币 | ~3400个代币 | -14% |
| 事实缓存命中率(V3问题) | ~3950个令牌 | ~2100个令牌 | -47% |
| 配方命中+集群并行 | ~14000+令牌 | ~8100令牌 | -42% |
| BrowseMenu已避免 | ~30795个标记 | ~2150个标记 | -93% |
安装
快速安装
# Clone the repo
git clone https://github.com/QuentinEnhancementStudio/wix-mcp-skill.git /tmp/wix-mcp-skill
# Run the install script
/tmp/wix-mcp-skill/install.sh手动安装
# 1. Copy the skill
mkdir -p ~/.claude/skills/wix-mcp
cp -r skill/ ~/.claude/skills/wix-mcp/
# 2. Copy the update command
mkdir -p ~/.claude/commands
cp commands/update-wix-recipes.md ~/.claude/commands/
# 3. Make log script executable
chmod +x ~/.claude/skills/wix-mcp/scripts/log.sh验证安装
打开克劳德代码并键入 /wix-mcp --如果它显示为技能选项,则安装成功。
用法
技能 自动触发器 当Claude检测到Wix API文档查询时。您还可以使用以下命令手动调用它 /wix-mcp.
保持食谱更新
跑 /update-wix-recipes 在克劳德代码中,从Wix MCP刷新配方索引。在以下情况下执行此操作:
- 日志显示频繁
README_FALLBACK事件 - Wix宣布新的API或功能
监控有效性
该技能将每个决定记录到 ~/.claude/skills/wix-mcp/logs/wix-mcp.log:
# Summary of event types
awk -F'|' '{gsub(/^ +| +$/, "", $2); print $2}' \
~/.claude/skills/wix-mcp/logs/wix-mcp.log | sort | uniq -c | sort -rn
# Estimate net token savings
awk -F'|' '{
gsub(/^ +| +$/, "", $2)
if ($2 == "RECIPE_HIT") saved -= 287
if ($2 == "RECIPE_MISS") saved += 22860
if ($2 == "BROWSE_AVOIDED") saved += 22860
if ($2 == "README_FALLBACK") saved -= 1662
if ($2 == "FACT_CACHE_HIT") saved += 3950
} END { printf "Estimated net tokens saved: %d\n", saved }' \
~/.claude/skills/wix-mcp/logs/wix-mcp.log文件结构
skill/ # -> ~/.claude/skills/wix-mcp/
├── SKILL.md # Core skill (inline routing + decision flow + parallel patterns)
├── domain-routing.md # Deep menu URLs reference (rarely needed)
├── decision-tree.md # Full tool selection flowchart with parallel patterns
├── README.md # Internal benchmarks + maintenance guide
├── recipes/ # Per-domain recipe indexes (article cluster format)
│ ├── bookings.md # 9 recipes (2 with Related cross-links)
│ ├── stores.md # 6 recipes (4 with Related, 1 with Quick facts)
│ ├── cms.md # 5 recipes (1 with Related)
│ ├── payments.md # 3 recipes (1 with Related)
│ ├── sites.md # 3 recipes
│ ├── platform.md # 3 recipes
│ ├── contacts.md # 2 recipes
│ ├── blog.md # 1 recipe (instant — URL inline in SKILL.md)
│ ├── pricing-plans.md # 1 recipe (instant — URL inline in SKILL.md)
│ ├── restaurants.md # 1 recipe (instant — URL inline in SKILL.md)
│ ├── events.md # 1 recipe (instant — URL inline in SKILL.md)
│ ├── media.md # 1 recipe (instant — URL inline in SKILL.md)
│ └── rich-content.md # 1 recipe (instant — URL inline in SKILL.md)
├── scripts/
│ └── log.sh # Decision logger
└── logs/ # Created on first use
commands/ # -> ~/.claude/commands/
└── update-wix-recipes.md # /update-wix-recipes command先决条件
许可证
麻省理工学院
