Hexo Blog MCP Server
Enables AI clients to manage Hexo blogs by providing tools for article CRUD operations, local previewing, and GitHub Pages deployment. It also supports site configuration access and automated Git backups to streamline the entire blogging workflow.
README
🚀 Hexo Blog MCP Server
一个基于 Model Context Protocol 的 Hexo 博客管理服务器,让 AI 客户端(Claude Desktop、Cursor 等)能够直接管理你的 Hexo 博客。
✨ 功能特性
- 📝 文章管理 — 列出、搜索、读取、创建、编辑、删除博客文章
- 👀 本地预览 — 一键启动/停止 Hexo 本地预览服务器
- 🌐 一键发布 — 构建并部署到 GitHub Pages
- 💾 源码备份 — 自动 Git 提交并推送到
hexo-source分支 - 🔒 安全防护 — 路径沙盒、分支锁定、命令超时保护
📦 安装
# 克隆或进入项目目录
cd /Users/lizexi/Documents/AI/aiMcp/hexo-mcp-server
# 安装依赖
npm install
# 构建
npm run build
⚙️ MCP 客户端配置
在你的 AI 客户端中添加以下 MCP 配置:
Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"hexo-blog": {
"command": "node",
"args": ["/Users/lizexi/Documents/AI/aiMcp/hexo-mcp-server/dist/index.js"],
"env": {
"BLOG_ROOT": "/Users/lizexi/Documents/code/leejersey.github.io"
}
}
}
}
Cursor
在 Cursor Settings → MCP 中添加相同配置。
🛠️ 可用的 Tools
文章管理
| 工具 | 参数 | 功能 |
|---|---|---|
list_posts |
keyword? |
列出所有文章,支持按关键词过滤标题和标签 |
search_posts |
query |
按关键词全文搜索文章(标题+正文) |
read_post |
filename |
读取指定文章的完整内容(含 Front-matter) |
create_post |
title, content?, tags? |
创建新文章并自动生成 Front-matter |
update_post |
filename, content, title?, tags? |
修改文章内容或元数据 |
delete_post |
filename |
删除指定文章 |
博客操作
| 工具 | 功能 |
|---|---|
preview_blog |
执行 hexo clean && hexo g && hexo s,启动本地预览(localhost:4000) |
stop_preview |
停止正在运行的预览服务器 |
deploy_blog |
执行 hexo clean && hexo g && hexo d,发布到 GitHub Pages |
Git 操作
| 工具 | 参数 | 功能 |
|---|---|---|
backup_source |
message? |
Git add → commit → push 到 hexo-source 分支 |
quick_publish |
message? |
一键完成 deploy + backup 组合操作 |
git_status |
— | 查看当前工作区的 Git 状态 |
📚 可用的 Resources
| URI | 描述 |
|---|---|
blog://config/site |
站点配置 _config.yml 的内容 |
blog://config/theme |
Apollo 主题配置 _config.apollo.yml 的内容 |
blog://posts/summary |
所有文章的元数据汇总(标题、日期、标签、字数) |
🏗️ 项目结构
src/
├── index.ts # MCP 服务器入口
├── config.ts # 路径与常量配置
├── tools/
│ ├── post-tools.ts # 文章管理工具(6个)
│ ├── hexo-tools.ts # 构建/预览/部署工具(3个)
│ └── git-tools.ts # Git 操作工具(3个)
├── resources/
│ └── blog-resources.ts # 博客数据资源(3个)
└── utils/
├── post-manager.ts # 文章文件操作核心逻辑
├── hexo-runner.ts # shell/hexo 命令封装
└── git-runner.ts # git 命令封装
🔧 技术栈
- TypeScript + Node.js 18+
- @modelcontextprotocol/sdk — MCP 官方 SDK(stdio 传输)
- zod — 工具参数验证
- gray-matter — Hexo 文章 Front-matter 解析
📄 License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。