feat: complete search REST route, restore disk sync, and extraFields support across API/MCP

This commit is contained in:
asepharyana
2026-08-21 11:03:04 +07:00
parent 989ee9c464
commit a67a8c6469
11 changed files with 319 additions and 34 deletions
+6 -2
View File
@@ -213,9 +213,10 @@ export function createMcpServer(authSecret?: string): McpServer {
status: z.enum(["published", "draft"]).optional(),
author: z.string().optional(),
tags: z.array(z.string()).optional(),
extraFields: z.record(z.string(), z.unknown()).optional().describe("Dynamic custom metadata key-value pairs"),
}),
},
async ({ slug, title, section, body, type, status, author, tags }) => {
async ({ slug, title, section, body, type, status, author, tags, extraFields }) => {
requireMcpAuth(authSecret);
const doc = await createDocument({
slug,
@@ -226,6 +227,7 @@ export function createMcpServer(authSecret?: string): McpServer {
status,
author,
tags,
extraFields,
});
return {
content: [{ type: "text", text: JSON.stringify({ ok: true, slug: doc.slug }) }],
@@ -246,9 +248,10 @@ export function createMcpServer(authSecret?: string): McpServer {
status: z.enum(["published", "draft"]).optional(),
tags: z.array(z.string()).optional(),
author: z.string().optional(),
extraFields: z.record(z.string(), z.unknown()).optional().describe("Dynamic custom metadata key-value pairs"),
}),
},
async ({ slug, title, body, type, status, tags, author }) => {
async ({ slug, title, body, type, status, tags, author, extraFields }) => {
requireMcpAuth(authSecret);
const doc = await updateDocument(slug, {
title,
@@ -257,6 +260,7 @@ export function createMcpServer(authSecret?: string): McpServer {
status,
tags,
author,
extraFields,
});
return {
content: [{ type: "text", text: JSON.stringify({ ok: true, slug: doc.slug }) }],