x
This commit is contained in:
1 parent
ac387185e0
commit
6a35dcf955
6 files changed
+437
-67
No files matched your search
+11
-12
@@ -21,6 +21,8 @@ export const api = axios.create({
|
||||
baseURL: BACKEND_URL,
|
||||
});
|
||||
|
||||
// MCP server state is process-local because this server runs over stdio.
|
||||
|
||||
api.interceptors.request.use(async (config) => {
|
||||
if (!authToken && config.url !== "/auth/login") {
|
||||
console.error("[MCP] No token found. Attempting auto-login...");
|
||||
@@ -143,7 +145,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
{
|
||||
name: "update_page_translation",
|
||||
description: "Add or update translations for a specific page.",
|
||||
description: "Add or update one page title translation for a specific page. Use list_dynamic_pages_metadata first to discover the numeric page ID.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
@@ -156,7 +158,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
{
|
||||
name: "update_page_translations",
|
||||
description: "Add or update multiple page title translations in one call. Use this when you want to set several languages at once instead of calling update_page_translation repeatedly.",
|
||||
description: "Add or update multiple page title translations in one call. Use list_dynamic_pages_metadata first to discover the numeric page ID.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
@@ -700,17 +702,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
{
|
||||
name: "list_dynamic_pages",
|
||||
description: "List all dynamic pages and layouts managed by the CMS",
|
||||
description: "List all dynamic pages and layouts managed by the CMS in a lightweight discovery format. Use get_dynamic_page_detail for full section payloads.",
|
||||
inputSchema: { type: "object", properties: {} }
|
||||
},
|
||||
{
|
||||
name: "list_dynamic_pages_metadata",
|
||||
description: "List all dynamic pages and layouts managed by the CMS (metadata only)",
|
||||
description: "List all dynamic pages and layouts managed by the CMS in the smallest discovery format (id, slug, title only).",
|
||||
inputSchema: { type: "object", properties: {} }
|
||||
},
|
||||
{
|
||||
name: "get_dynamic_page_detail",
|
||||
description: "Get full detail of a specific dynamic page by slug",
|
||||
description: "Get full detail of a specific dynamic page by slug. By default only active sections are returned; set includeInactive=true to include inactive sections.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
@@ -722,15 +724,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
{
|
||||
name: "create_dynamic_page",
|
||||
description: "Create or update a dynamic page or layout",
|
||||
description: "Create or update a dynamic page or layout. Use isPublished as the only publish field. If omitted on create, it defaults to false. If omitted on update, the existing publish state is preserved. The response includes publishBehavior to make this explicit. Page-level metadata is not supported by the current Page model.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
title: { type: "string", description: "Title of the page" },
|
||||
slug: { type: "string", description: "Unique slug identifier. Do not use reserved system slugs (e.g., shop, category, cart, checkout, account, article, etc.)." },
|
||||
isPublished: { type: "boolean", description: "Publish status" },
|
||||
status: { type: "string", description: "Publish status (e.g. 'published' or 'draft')" },
|
||||
metadata: { type: "object", description: "SEO metadata" },
|
||||
isPublished: { type: "boolean", description: "Publish status. Optional; defaults to false if omitted." },
|
||||
id: { type: "number", description: "Numeric page ID. Required if you are updating an existing page. Use list_dynamic_pages_metadata or get_dynamic_page_detail to find the ID first." }
|
||||
},
|
||||
required: ["title", "slug"]
|
||||
@@ -1160,8 +1160,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
slug: params.slug,
|
||||
};
|
||||
if (params.isPublished !== undefined) payload.isPublished = params.isPublished;
|
||||
if (params.status !== undefined) payload.status = params.status;
|
||||
if (params.metadata !== undefined) payload.metadata = params.metadata;
|
||||
if (params.id) {
|
||||
payload.id = params.id;
|
||||
}
|
||||
@@ -1173,7 +1171,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
pageId: res.data?.pageId ?? pageData?.id ?? null,
|
||||
slug: res.data?.slug ?? pageData?.slug ?? params.slug,
|
||||
title: res.data?.title ?? pageData?.title ?? params.title,
|
||||
isPublished: res.data?.isPublished ?? pageData?.isPublished ?? payload.isPublished ?? true,
|
||||
isPublished: res.data?.isPublished ?? pageData?.isPublished ?? payload.isPublished ?? false,
|
||||
publishBehavior: res.data?.publishBehavior ?? (payload.isPublished === undefined ? (params.id ? "preserve-existing" : "default-create-false") : "request"),
|
||||
diagnostic: res.data?.diagnostic ?? (params.id ? "Page updated successfully." : "Page created successfully."),
|
||||
page: pageData,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user