This commit is contained in:
Your Name committed 2026-06-18 21:59:16 -04:00
1 parent feeda6dc60
commit 927f03a8b7
12 files changed
+95 -10

No files matched your search

+6
View File
@@ -28,6 +28,12 @@ bun run dev
ถ้าไม่ตั้งค่า `MCP_BACKEND_URL` server จะเริ่มที่ local backend และสลับเป็น production ได้ด้วย tool `set_target_environment`
## Available tools
- `update_brand_name` เปลี่ยนชื่อแบรนด์กลางที่ใช้ใน header/footer ของ `apps/spa` และ `apps/website`
- `update_store_settings_translation` อัปเดตข้อความแปลของ store settings
- `update_footer_content` อัปเดตเนื้อหา footer และลิงก์ที่เกี่ยวข้อง
## Scripts
- `bun run dev`
+42
View File
@@ -477,6 +477,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
required: ["lang"]
}
},
{
name: "update_brand_name",
description: "Update the brand name used across website and SPA headers, footers, and brand displays.",
inputSchema: {
type: "object",
properties: {
brandName: { type: "string", description: "Brand display name to store in system settings" }
},
required: ["brandName"]
}
},
{
name: "update_article_translation",
description: "Add or update translations for a specific article.",
@@ -890,6 +901,37 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
const res = await api.patch(`/settings/translations`, payload);
return { content: [{ type: "text", text: JSON.stringify(res.data, null, 2) }] };
}
case "update_brand_name": {
const { brandName } = params as any;
const currentSettingsRes = await api.get("/settings");
const currentSettings = currentSettingsRes.data || {};
const mergedSettings = { ...currentSettings, brandName };
for (const key in mergedSettings) {
if (mergedSettings[key] === null) {
delete mergedSettings[key];
}
}
const res = await api.put("/settings", mergedSettings);
return {
content: [
{
type: "text",
text: JSON.stringify(
{
success: true,
tool: "update_brand_name",
brandName: res.data?.brandName ?? brandName,
settings: res.data
},
null,
2
)
}
]
};
}
case "update_article_translation": {
const { id, lang, title, content } = params as any;
const payload: any = {};