DBK Platform MCP Server
HomAroma is the reference tenant. This server exposes shared MCP capabilities; a tool call must use the active tenant's data and configuration.
MCP server สำหรับเชื่อม AI tools เข้ากับ backend ของ HomAroma ผ่าน stdio transport
Run
bun install
bun run --cwd apps/mcp-server dev
หรือรันตรงจาก package:
cd apps/mcp-server
bun run dev
Environment
รองรับตัวแปรต่อไปนี้:
MCP_BACKEND_URLสำหรับกำหนด backend target ตรง ๆMCP_BACKEND_URL_LOCALค่าเริ่มต้นสำหรับ localMCP_BACKEND_URL_PRODUCTIONค่าเริ่มต้นสำหรับ productionMCP_ADMIN_USERNAMEMCP_ADMIN_PASSWORD
ถ้าไม่ตั้งค่า MCP_BACKEND_URL server จะเริ่มที่ local backend และสลับเป็น production ได้ด้วย tool set_target_environment
Available tools
update_brand_nameเปลี่ยนชื่อแบรนด์กลางที่ใช้ใน header/footer ของapps/spaและapps/websiteupdate_store_settings_translationอัปเดตข้อความแปลของ store settingsupdate_footer_contentอัปเดตคำอธิบายแบรนด์และ social links เท่านั้นget_footer_brand/update_footer_brandอ่านและแก้ Footer Brand block โดยตรง (brand name, logo, คำอธิบายแยกภาษา, social links) พร้อมdryRunและexpectedVersion
Footer Menu LLM Workflow
Footer Explore and Footer Support are flat item menus, not Mega Menu payload trees. Supported menu names are:
footer-explore
footer-support
Use this workflow for every Footer menu edit:
- Call
get_footer_menuwith the target language. - Keep the returned
version. - Call one item-level write tool with
dryRun: trueandexpectedVersion. - Review the compact preview.
- Apply the same operation with
dryRun: falseand the same version. - Call
get_footer_menuagain to verify and obtain the next version.
If an allowed Footer menu does not exist yet, get_footer_menu returns exists: false, version: null, and an empty item list. Previewing the first add returns willCreateMenu: true; applying that add creates the menu as active and inserts the first item atomically.
Available item-level tools:
add_footer_menu_itemupdate_footer_menu_itemdelete_footer_menu_itemreorder_footer_menu_itemsupdate_footer_menu_item_translation
Every reorder request must include every current item ID exactly once. A MENU_VERSION_CONFLICT response means Admin or another agent changed the menu after it was read; fetch it again before retrying.
Do not pass exploreLinks, collectionLinks, or supportLinks to legacy update_footer_content. Full menu-array replacement is rejected because it can delete item IDs and translations. Website Collections are populated from Categories rather than a footer-collections menu.
Mega Menu LLM Workflow
Header Mega Menu uses the main menu payload tree. The website renders this structure:
Root -> Column -> Link -> Child Link
Supported localized text keys are:
th, en, ja, zh, vi, ko, lo, it
LLM agents should use this workflow for every menu edit:
capture_menu_snapshotformainget_mega_menu_treevalidate_mega_menu_tree- Plan operations from diagnostics and current
nodeIdvalues bulk_menu_operationswithdryRun: true- Review
preview.diff,preview.before,preview.after,issues, andwarnings - Apply only after approval
- Run
validate_mega_menu_treeagain - Use
restore_menu_snapshotif the applied result is wrong
Do not add a Link directly under root. Add a Column under Root first, then add Links under that Column.
Dry-run responses are expected to include path-based diffs such as:
{
"path": "payload[0].columns[0].links[0].label.it",
"before": null,
"after": "Candele"
}
validate_mega_menu_tree reports:
- missing locale keys, especially
loandit - unsupported translation keys
- duplicate or missing
nodeId - invalid URL shape
- placeholder text
- empty columns
- featured card issues
- desktop render limits such as hidden columns or links
Category Management LLM Workflow
Product categories are managed by backend /categories APIs through MCP. Supported localized text keys are:
th, en, ja, zh, vi, ko, lo, it
LLM agents should use this workflow for category edits:
list_categorieswithlang: "all"to discover category IDs and current translationscreate_category,update_category,update_category_media,update_category_translations, ordelete_categorywithdryRun: true- Review the preview and product counts
- Apply only after the intended change is clear
- Run
list_categoriesagain to verify
Category media uses semantic roles: thumbnail, hero_desktop, hero_mobile,
card_portrait, and social_share. update_category_media replaces the complete
media set, so omitted roles are removed. update_category_image remains available
only as a legacy thumbnail compatibility tool.
Backend category support currently covers:
- base
name imageUrl- localized names
- product-count guarded soft delete (
deletedAt)
Backend category support does not currently cover:
- slug
- nested parent/child hierarchy
- sort order
- active/inactive state
- restore/undelete workflow
Scripts
bun run devbun run startbun run check