mcp-cha-cha
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-cha-cha What can you recommend for a caffeine-free drink?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
侘茶點餐系統 MCP Server
以台南侘茶飲料店真實菜單為基礎的教學用 MCP Server,透過 stdio 傳輸與 LLM Client(如 Claude Desktop)溝通,完整涵蓋 MCP 三大核心概念:Tools、Resources、Prompts,並以 get_menu Tool 示範 MCP Apps 的互動式 UI 擴充。
特色
86 款飲品、11 大分類、8 種加料,資料庫首次啟動自動 seed
6 個 Tools、5 個 Resources、2 個 Prompts,一站式體驗 MCP 全功能
get_menu內建互動式菜單 UI(MCP Apps),在支援的 Host 中會直接渲染 iframeSQLite(WAL 模式)本機持久化,免額外部署資料庫
Related MCP server: licha-order-mcp
技術棧
TypeScript(ESM,
NodeNextmodule resolution)@modelcontextprotocol/sdkv1.x — MCP Server SDK@modelcontextprotocol/ext-apps— MCP Apps 擴充(互動式 UI)better-sqlite3— SQLite 嵌入式資料庫zodv4 — Tool 參數 schema 驗證vite+vite-plugin-singlefile— UI 打包為單一 HTMLvitest+@vitest/coverage-v8— 測試與覆蓋率pnpm套件管理
環境需求
Node.js 22(見
.node-version)pnpm
快速開始
# 安裝依賴
pnpm install
# 開發模式(tsx 直接執行,會自動建立並 seed data/cha-cha.db)
pnpm run dev
# 打包(先打包 UI 再編譯 TypeScript)
pnpm run build
# 執行編譯後的版本
pnpm run start首次執行 pnpm run dev 或 pnpm run start 時,會自動在專案根目錄建立 data/cha-cha.db 並寫入完整菜單資料,無需手動初始化。
常用指令
指令 | 說明 |
| 安裝依賴 |
| 先打包 UI(Vite)再 |
| 僅打包 UI( |
|
|
| 執行編譯後的 |
|
|
| 執行單一測試檔 |
| 依測試名稱片段過濾 |
| 產生覆蓋率報告 |
接入 Client
Claude Desktop:見
docs/claude-desktop-guide.mdMCP Inspector(除錯用):見
docs/inspector-guide.md
# 快速用 Inspector 測試
pnpm build
npx @modelcontextprotocol/inspector node dist/index.js架構
進入點 src/index.ts 建立 McpServer 後,分別呼叫三個 register 函式注入功能:
src/
├── index.ts 進入點:建立 McpServer、註冊 Tools/Resources/Prompts、連接 stdio
├── db.ts SQLite 初始化、菜單 seed、共用查詢 helper
├── types.ts 共用型別(MenuItem、Topping、Order)與常數(甜度、冰量選項)
├── helpers.ts 菜單格式化函式
├── tools/ 6 個 Tool:查詢與操作
├── resources/ 5 個 Resource:Client 端可主動讀取的資料
└── prompts/ 2 個 Prompt:預定義提示模板資料庫檔案存放於 data/cha-cha.db(不納入版控)。
MCP Apps UI
get_menu Tool 使用 registerAppTool 加掛互動式菜單 UI,支援 MCP Apps 的 Host(如 Claude Desktop)會自動渲染 iframe。UI 原始碼在 ui/,透過 Vite 打包為 dist/ui/menu-app.html 單一檔案。
提供的功能
Tools
Tool | 說明 |
| 查詢菜單(分類、飲品、加料、甜度冰量選項),支援 MCP Apps 的 Host 會渲染互動式菜單 UI |
| 查詢訂單,可依 ID 精確查找,或依訂購人、領取狀態、日期篩選 |
| 建立訂單 |
| 標記訂單為已領取 |
| 取消尚未領取的訂單 |
| 依心情、咖啡因、預算、杯數推薦飲品 |
Resources
Resource | URI | 說明 |
|
| 所有菜單分類列表 |
|
| 指定分類的飲品清單(含價格與屬性) |
|
| 所有訂單列表 |
|
| 單筆訂單詳情 |
|
| 未領取訂單清單 |
Prompts
Prompt | 參數 | 說明 |
|
| 帶入完整菜單,推薦 3 杯飲品並說明理由 |
| 無 | 彙整目前所有訂單:每人明細、飲品統計、總金額、未領取提醒 |
業務規則
sugar_fixed = 1的飲品忽略使用者甜度參數,強制設為「固定甜度」單杯總價 = 飲品價格 + Σ(加料價格);加料有免費項目(小珍珠、波霸、混珠,price = 0)
顧客常用口語簡稱點餐(如「波霸奶綠」其實是「茉香奶綠」加「波霸」加料),呼叫
create_order前建議先用get_menu確認正確品名Tool 錯誤統一回傳
{ content: [{ type: 'text', text }], isError: true }
測試
測試檔案放在 tests/ 目錄,使用 vitest。Tool handler 邏輯抽為獨立可匯出函式(如 handleGetOrders),與 registerXxx 註冊函式分離,方便直接測試 handler 而不需啟動 MCP Server。
覆蓋率設定於 vitest.config.ts,目前 coverage.include 限定在 src/tools/get-orders.ts,新增其他模組測試時需同步調整。
pnpm test規格文件
spec/spec.md— 完整技術規格書(SSOT:資料庫 schema、MCP 功能設計、菜單資料)spec/change/— 變更請求(CR-001 ~ CR-004)及對應任務清單
授權
ISC
Available Tools
6 toolscancel_orderA
取消訂單(僅限尚未領取的訂單)
Inputs: order_id (required).
create_orderA
建立一筆侘茶飲料訂單。注意:顧客常用口語簡稱點餐(如「波霸奶綠」其實是「茉香奶綠」加「波霸」加料),請先用 get_menu 查詢菜單確認正確品名,再將飲品與加料分開填入。
Inputs: item_name (required), person_name (required), ice, note, +3 more.
get_ordersA
查詢訂單。可依訂單 ID 精確查找單筆訂單,或依訂購人、領取狀態、日期等條件篩選。無參數時回傳全部訂單。
Inputs: date, order_id, picked_up, person_name.
pickup_orderB
標記訂單為已領取
Inputs: order_id (required).
recommend_drinksA
根據偏好推薦侘茶飲品
Inputs: mood, count, max_price, caffeine_free.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct action: menu browsing, recommendations, order creation, order query, pickup, and cancellation. There is no meaningful overlap; get_menu and recommend_drinks serve different selection purposes.
Most tool names follow a clear lower_snake_case verb_noun pattern (create_order, get_menu, cancel_order). pickup_order is a slight deviation since 'pickup' is used as a verb-like noun, but it remains readable and consistent in style.
Six tools is well-scoped for a focused beverage-ordering server. Each tool covers a necessary part of the workflow without redundancy.
The core ordering lifecycle is covered: menu lookup, recommendation, create, query, cancel, and pickup. A minor gap is the lack of an order update/modify tool for changing items before pickup.
Related MCP Connectors
Run your restaurant from an AI client: orders, menu, reports, refunds, payouts and staff.
Restaurant menus, allergens, opening hours, table reservations, waitlists and orders for AI agents.
Find local shops, read live menus and free times, and order or book on the user's behalf.
Manage your NanoCart store from any AI agent: products, orders, coupons, subscribers, reports.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables coffee shop order management via MCP, including menu lookup, order creation, and status tracking.-
- FlicenseAqualityBmaintenanceOfficial AI ordering for Licha Tea (李茶的茶, LEECHA). Installing it enables real ordering: find stores, browse menus, and place orders. Payment is completed by the customer in the Licha Tea WeChat mini program. In-store dine-in or pickup only.4-
- AlicenseAqualityDmaintenanceMCP server for tea enthusiasts to get daily tea recommendations, manage tea inventory, and fine-tune brewing parameters based on taste feedback.111BSD 3-Clause
- FlicenseNot gradedqualityDmaintenanceEnables natural language interaction with a coffee shop's inventory and order system, allowing users to check menu items, place orders, and track order status via MCP tools.-