Skip to main content
Glama
leejersey

Hexo Blog MCP Server

by leejersey

delete_post

Remove a specific blog post from a Hexo blog by providing its filename. This action permanently deletes the post and cannot be reversed.

Instructions

删除指定的博客文章(不可撤销)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes要删除的文章文件名

Implementation Reference

  • The actual implementation of the delete operation, which resolves the file path and unlinks it from the filesystem.
    export async function deletePost(filename: string): Promise<void> {
        const fullPath = postPath(filename);
        await fs.unlink(fullPath);
    }
  • The MCP tool registration for "delete_post", which wraps the deletePost function and handles MCP tool communication.
    // 删除文章
    server.tool(
        "delete_post",
        "删除指定的博客文章(不可撤销)",
        { filename: z.string().describe("要删除的文章文件名") },
        async ({ filename }) => {
            try {
                await deletePost(filename);
                return {
                    content: [
                        { type: "text" as const, text: `🗑️ 文章 "${filename}" 已删除。建议执行 backup_source 备份更改。` },
                    ],
                };
            } catch (e: any) {
                return { content: [{ type: "text" as const, text: `错误: ${e.message}` }], isError: true };
            }
        }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leejersey/hexo-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server