Skip to main content
Glama
leejersey

Hexo Blog MCP Server

by leejersey

quick_publish

Publish Hexo blog posts to GitHub Pages and automatically back up source code with Git commits in a single operation.

Instructions

一键完成博客发布和源码备份(deploy + backup 组合操作)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNo可选的 Git 提交信息

Implementation Reference

  • The 'quick_publish' tool is defined using server.tool, with its handler function implementing the deployment and backup logic.
    server.tool(
        "quick_publish",
        "一键完成博客发布和源码备份(deploy + backup 组合操作)",
        {
            message: z.string().optional().describe("可选的 Git 提交信息"),
        },
        async ({ message }) => {
            try {
                // 1. 部署
                await hexoCommand("clean");
                await hexoCommand("generate");
                await hexoCommand("deploy");
    
                // 2. 备份
                const backupResult = await backupSource(
                    message || "Publish & backup"
                );
    
                return {
                    content: [
                        {
                            type: "text" as const,
                            text: `🎉 一键发布完成!\n\n✅ 博客已发布: https://leejersey.github.io\n✅ ${backupResult}\n\n⚠️ GitHub Pages 需要 1~3 分钟刷新缓存。`,
                        },
                    ],
                };
            } 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