Skip to content
Back to search

mcd-wrapped

SkillWorks with Claude CodeGitHub

麦当劳 MCP 工具箱:探测全部 35 个 tool 的真实返回、生成个人年度消费年报、生成麦当劳数据全景报告、精算积分抽奖期望值,并可选方言语音播报。当用户说"麦当劳 MCP 有哪些能力""麦当劳年度报告""麦麦数据""麦当劳全景""抽奖值不值""今年在麦当劳花了多少钱""M-CODE WRAPPED"时使用本技能。

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lvzuojing--mcd-wrapped/badge.svg)](/listings/lvzuojing--mcd-wrapped)

HTML

<a href="/listings/lvzuojing--mcd-wrapped"><img src="/api/listings/lvzuojing--mcd-wrapped/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 97 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: mcd-wrapped
  3. description: 麦当劳 MCP 工具箱:探测全部 35 个 tool 的真实返回、生成个人年度消费年报、生成麦当劳数据全景报告、精算积分抽奖期望值,并可选方言语音播报。当用户说"麦当劳 MCP 有哪些能力""麦当劳年度报告""麦麦数据""麦当劳全景""抽奖值不值""今年在麦当劳花了多少钱""M-CODE WRAPPED"时使用本技能。
  4. agent_created: true
  5. ---
  6. # M-CODE WRAPPED
  7. 麦当劳数据全景报告 + 个人年度消费年报 + 方言语音播报。
  8. ## 何时使用
  9. - 想搞清楚麦当劳 MCP 的 35 个 tool 各自返回什么、需要什么参数
  10. - 要一份可分享/可发朋友圈的麦当劳年报或全景报告
  11. - 想看自己在麦当劳一年的消费记录
  12. - 想知道积分抽奖到底值不值得抽
  13. - 想让 AI 用粤语/方言把报告念出来
  14. ## 前置条件
  15. - 麦当劳 MCP Token:在 open.mcd.cn 用手机号激活后复制 Token
  16. - 无 Token 时也能用演示数据出样张
  17. ## 工作流程
  18. ### 探测 MCP 能力(调试优先)
  19. ```bash
  20. export MCD_MCP_TOKEN=<用户的token>
  21. python3 scripts/explore.py # -> out/mcp-explorer.md + data/tool_inventory.json
  22. ```
  23. 自动串联参数:从 `order-list` 取 `storeCode` / `orderId`,从 `mall-points-products`
  24. 取 `spuId`,喂给需要参数的 tool。
  25. `draw-lottery`、`create-order`、`cancel-order`、`mall-create-order`、`auto-bind-coupons`、
  26. `party-order-create`、`delivery-create-address` 属于写操作,**一律不调用**。
  27. ### 抽奖 EV 精算
  28. ```bash
  29. python3 scripts/lottery_ev.py # 10 连抽 × 10000 轮
  30. python3 scripts/lottery_ev.py --draws 50 --trials 50000
  31. ```
  32. 输出必须说明:官方未公布中奖概率,结果为等概率假设下的模拟。
  33. ### 公共全景报告(不需要消费记录)
  34. ```bash
  35. export MCD_MCP_TOKEN=<用户的token>
  36. python3 scripts/public_data.py # 采集公共数据 -> data/public_data.json
  37. python3 scripts/build_panorama.py # -> out/mcd-wrapped.html
  38. ```
  39. ### 个人年度消费年报
  40. ```bash
  41. export MCD_MCP_TOKEN=<用户的token>
  42. python3 scripts/collect.py # 采集个人数据 -> data/report_data.json
  43. python3 scripts/build_report.py # -> out/mcd-wrapped.html
  44. ```
  45. ### 演示模式(无 Token)
  46. ```bash
  47. python3 scripts/demo_data.py
  48. python3 scripts/build_report.py
  49. ```
  50. ### 方言播报(可选)
  51. ```bash
  52. python3 scripts/speak.py --dialect cantonese
  53. python3 scripts/speak.py --dialect voxcpm --ref /path/to/dialect.wav
  54. python3 scripts/speak.py --dry-run
  55. ```
  56. 后端按 VoxCPM2 → macOS 内置中文嗓音顺序自动回退。
  57. ## 输出口径
  58. 只陈述事实,不做健康评价。禁止出现"垃圾食品""不健康""罪恶""发胖"等表述,
  59. 能量数字一律标注为估算参考值。完整红线见 `references/compliance.md`。
  60. ## 资源
  61. - `scripts/mcp_client.py` — MCP Streamable HTTP 客户端
  62. - `scripts/public_data.py` — 公共数据采集与解析
  63. - `scripts/build_panorama.py` — 全景报告渲染
  64. - `scripts/collect.py` — 个人数据采集与字段归一化
  65. - `scripts/demo_data.py` — 确定性演示数据
  66. - `scripts/build_report.py` — 个人年报渲染
  67. - `scripts/speak.py` — 方言语音播报
  68. - `assets/panorama_template.html` — 全景报告模板
  69. - `assets/report_template.html` — 个人年报模板
  70. - `references/mcp_tools.md` — MCP tool 清单与踩坑记录
  71. - `references/compliance.md` — 合规红线
README.md · README · 172 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # M-CODE WRAPPED
  2. **麦当劳 MCP 工具箱:从调试接口到出报告,一条龙。**
  3. 基于 [麦当劳 MCP](https://github.com/M-China/mcd-mcp-server) 开放能力,四个模块覆盖开发者到消费者的完整链路:
  4. | 模块 | 一句话 | 入口 |
  5. |---|---|---|
  6. | **MCP 能力探测器** | 一键探测全部 35 个 tool 的真实返回,自动串联参数 | `scripts/explore.py` |
  7. | **个人年度消费年报** | 订单、消费、积分、奖品、高频单品,一页看完 | `scripts/collect.py` |
  8. | **麦当劳数据全景报告** | 158 个餐品营养、营销日历、抽奖池、商城、优惠券 | `scripts/public_data.py` |
  9. | **抽奖 EV 精算器** | 蒙特卡洛模拟,算清抽奖到底值不值 | `scripts/lottery_ev.py` |
  10. 并可选粤语/方言语音播报,把报告念出来。
  11. > 麦当劳 1024 程序员节创意开发大赛参赛作品 · 非麦当劳官方产品
  12. ## 如果你正在对接麦当劳 MCP,先看这个
  13. 官方文档不太全,实测踩了 3 个坑,都在[探测器报告](out/mcp-explorer.md)里:
  14. 1. 返回体**不是 JSON**,是 Markdown,真 JSON 藏在 `## Original Response` 之后
  15. 2. `list-nutrition-foods` 的 data 是**逗号分隔文本表格**,不是 JSON
  16. 3. 无数据时返回**中文文案**(如 `暂无可用优惠券`),不是空数组
  17. 服务端实际暴露 **35 个** tool(文档写的是 33 个),探测器已跑通 **27 个**,
  18. 7 个写操作默认不调用。不想看报告也行,直接跑:
  19. ```bash
  20. export MCD_MCP_TOKEN=你的token
  21. python3 scripts/explore.py # 零第三方依赖,输出 out/mcp-explorer.md
  22. ```
  23. ![个人年报预览](out/preview.png)
  24. > 上图由真实 MCP 数据生成。样张来自授权测试账户,接入你自己的 Token 后会替换为你的真实数据。
  25. ## 为什么不是"又一个点餐助手"
  26. 大赛里绝大多数作品在做同一件事:怎么更便宜地下单。这个项目换个方向——
  27. **先帮开发者搞清楚 MCP 到底返回了什么,再把数据做成值得点星的报告。**
  28. | | 点餐助手 | M-CODE WRAPPED |
  29. |---|---|---|
  30. | 视角 | 省钱、下单 | 调试 + 数据可视化 + 决策 |
  31. | 是否需要消费记录 | 需要 | 公共全景不需要,个人年报需要 |
  32. | 产物 | 一个订单 | 探测报告 + 年报 + 全景 + 精算 |
  33. | 对开发者友好度 | 一般 | **探测器专门解决这个痛点** |
  34. ## 模块一:MCP 能力探测器
  35. 官方文档列了 tool 名字,但没说清楚实际返回什么。实测下来坑不少:
  36. - 返回的是 **Markdown 文本**,真 JSON 藏在 `## Original Response` 之后
  37. - 营养数据是**逗号分隔文本表格**,不是 JSON
  38. - 无数据时返回**中文文案**(如 `暂无可用优惠券`),不是空数组
  39. 探测器一键跑完所有只读工具,记录真实形态:
  40. ```bash
  41. export MCD_MCP_TOKEN=你的token
  42. python3 scripts/explore.py
  43. ```
  44. **自动串联参数**:从 `order-list` 取 `storeCode` 喂给 `query-meals`,取 `orderId` 喂给 `query-order`,
  45. 取 `spuId` 喂给 `mall-product-detail`——需要参数的工具也能跑起来。
  46. 本次实测:**35 个 tool,27 个成功调用,7 个写操作跳过,1 个缺参数**。
  47. 完整报告见 [out/mcp-explorer.md](out/mcp-explorer.md)。
  48. **安全红线**:`draw-lottery`、`create-order`、`cancel-order`、`mall-create-order`、
  49. `auto-bind-coupons`、`party-order-create`、`delivery-create-address` 一律**不调用**,
  50. 只在报告里展示参数定义。
  51. ## 模块二:个人年度消费年报
  52. ```bash
  53. export MCD_MCP_TOKEN=你的token
  54. python3 scripts/collect.py
  55. python3 scripts/build_report.py # -> out/mcd-wrapped.html
  56. ```
  57. 包含:年度下单数、消费总额、客单价、深夜订单占比、最常去门店、连续打卡、
  58. 高频单品 Top 6、月度趋势、周几偏好、下单高峰、累计能量、可用积分、奖品数。
  59. ## 模块三:麦当劳数据全景报告
  60. ```bash
  61. python3 scripts/public_data.py
  62. python3 scripts/build_panorama.py # -> out/panorama.html
  63. ```
  64. 不需要消费记录,只用公共数据:158 个餐品营养档案、热量 TOP10 / 低卡 TOP10 / 分布直方图、
  65. 当月营销日历、积分抽奖池、麦麦省可领券、积分商城商品。
  66. ## 模块四:抽奖 EV 精算器
  67. ```bash
  68. python3 scripts/lottery_ev.py # 默认 10 连抽 × 10000 轮
  69. python3 scripts/lottery_ev.py --draws 50 --trials 50000
  70. python3 scripts/lottery_ev.py --base-price 45 # 调整折扣券基准价
  71. ```
  72. 真实奖池 + 真实单次消耗(24 积分),蒙特卡洛模拟。
  73. 券面额按奖品名智能匹配基准价(麦旋风按 ¥9、三件套按 ¥40)。
  74. > 麦当劳**未公布**中奖概率,所有结果基于等概率假设,脚本从不调用 `draw-lottery`。
  75. > 完整报告见 [out/lottery-ev.md](out/lottery-ev.md)。
  76. ## 方言播报
  77. ```bash
  78. python3 scripts/speak.py --dialect cantonese # 粤语
  79. python3 scripts/speak.py --dialect taiwanese # 闽南语调
  80. python3 scripts/speak.py --dialect mandarin # 普通话
  81. python3 scripts/speak.py --dry-run # 只看播报稿
  82. ```
  83. 后端按 **VoxCPM2 → macOS 内置中文嗓音** 自动回退:
  84. ```bash
  85. export VOXCPM_API_URL=http://127.0.0.1:7860 # 本地 VoxCPM2 Gradio 服务
  86. export VOXCPM_REF_AUDIO=/path/to/四川话参考音频.wav
  87. python3 scripts/speak.py --dialect voxcpm
  88. ```
  89. ## 目录结构
  90. ```
  91. mcd-wrapped/
  92. ├── SKILL.md Skill 定义,供 Agent 驱动全流程
  93. ├── MCP_INTEGRATION.md 使用的 MCP tool、调用流程与踩坑记录
  94. ├── CONTEST_DECLARATION.md 参赛声明(官方原文,未修改)
  95. ├── workbuddy.md 使用 WorkBuddy 开发时的上下文
  96. ├── mcp-config.example.json 脱敏配置,仅环境变量占位符
  97. ├── scripts/
  98. │ ├── mcp_client.py MCP Streamable HTTP 客户端
  99. │ ├── explore.py ★ 35 个 tool 能力探测器
  100. │ ├── collect.py 个人数据采集 + 字段归一化
  101. │ ├── build_report.py 个人年报渲染
  102. │ ├── public_data.py 公共数据采集与解析
  103. │ ├── build_panorama.py 全景报告渲染
  104. │ ├── lottery_ev.py ★ 抽奖期望值精算
  105. │ ├── demo_data.py 演示数据(dry-run)
  106. │ └── speak.py 方言语音播报
  107. ├── references/
  108. │ ├── mcp_tools.md tool 清单与字段归一化说明
  109. │ └── compliance.md 输出内容合规红线
  110. ├── assets/
  111. │ ├── panorama_template.html 全景报告模板
  112. │ └── report_template.html 个人年报模板
  113. └── out/
  114. ├── mcd-wrapped.html 个人年报
  115. ├── panorama.html 全景报告
  116. ├── mcp-explorer.md 能力探测报告
  117. ├── lottery-ev.md 抽奖精算报告
  118. └── preview.png README 预览图
  119. ```
  120. ## 合规说明
  121. - 项目**只读**官方数据,不创建、不取消、不支付任何订单
  122. - 写操作工具(`draw-lottery` / `create-order` / `mall-create-order` 等)**从不调用**
  123. - 配置文件仅使用环境变量占位符,不含任何凭证
  124. - 能量数值按公开营养信息估算,仅供参考,不构成健康或营养建议
  125. - 抽奖期望值官方未公布概率,按等概率假设做披露性说明,不构成参与建议
  126. - 报告只陈述事实,不做健康评价
  127. - 完整红线见 `references/compliance.md`
  128. ## License
  129. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.