# @proars/ghost-mcp-server 中文文档

规范地址：https://npmcn.com/package/%40proars/ghost-mcp-server/

版本：2\.2\.1
npm 元数据更新时间：2026-11-02T03:41:00.246Z
中文译文更新时间：2026-11-02T05:59:00.454Z
软件包许可：MIT

本文由上游 README 机器翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40proars/ghost-mcp-server
原文对照：https://npmcn.com/package/%40proars/ghost-mcp-server/?lang=original
项目主页：https://github.com/proars/ghost-mcp-server#readme
源码仓库：https://github.com/proars/ghost-mcp-server

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：98.1 kB，10 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=20
- 运行依赖：2 个
- 首次发布：2026-11-01T23:43:18.818Z
- 最新版本发布：2026-11-02T03:41:00.096Z
- 已发布版本数：5（近 12 个月 5 个）

## 中文简介

MCP服务器的鬼CMS：管理帖子，页面，标签，SEO元数据，成员，新闻通讯和主题，通过鬼管理API从克劳德，光标和其他人工智能代理

## 安装

```sh
npm install @proars/ghost-mcp-server
```

也可以使用：`pnpm add @proars/ghost-mcp-server`、`yarn add @proars/ghost-mcp-server`、`bun add @proars/ghost-mcp-server`

## README

# Ghost MCP服务器：从Claude， Cursor和其他AI客户端管理Ghost CMS

[![CI](https://github.com/proars/ghost-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/proars/ghost-mcp-server/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/@proars/ghost-mcp-server)](https://www.npmjs.com/package/@proars/ghost-mcp-server) ![Node.js 20+](https://img.shields.io/badge/node-%3E%3D20-339933?logo=node.js&logoColor=white) ![Tools](https://img.shields.io/badge/tools-60-blue) ![Routes](https://img.shields.io/badge/Admin%20API%20routes-253-orange) ![License: MIT](https://img.shields.io/badge/license-MIT-green)

Ghost MCP Server是一个开源软件 [模型上下文协议](https://modelcontextprotocol.io/) 用于Ghost CMS的服务器，用TypeScript编写。它连接一个MCP客户端，如克劳德桌面，克劳德代码或光标到Ghost管理API通过工作室。有了它，人工智能助手可以创建和编辑帖子和页面，设置SEO元数据，管理标签，成员和新闻通讯，上传图像和主题，以及导出内容。

它使 **60的工具**： 55个专用API工具，3个SEO和标签快捷方式，一个路由搜索和一个通用请求工具。内置目录包括 **253个管理API路由** 从固定的Ghost源快照中获取。什么在你的网站上工作取决于你的凭据，你的Ghost版本和它的功能标志。中列出了路由和源 [GHOST\_API.list](https://npmcn.com/package/%40proars/ghost-mcp-server/GHOST_API.list).

![Demo: Claude Code creates a draft post in Ghost through the MCP server](https://raw.githubusercontent.com/proars/ghost-mcp-server/main/docs/demo.gif)

## 快速启动

你需要Node.js 20或更新版本，以及一个带有Admin API访问权限的Ghost站点。

1.  在Ghost Admin中打开 **设置→集成→添加自定义集成** 然后复制 **管理API密钥** （`id:secret`）. 不要使用Content API密钥。
2.  将服务器添加到您的客户机配置中。对于克劳德桌面或光标：

```json
{
  "mcpServers": {
    "ghost": {
      "command": "npx",
      "args": ["-y", "@proars/ghost-mcp-server"],
      "env": {
        "GHOST_API_URL": "https://your-blog.com",
        "GHOST_ADMIN_API_KEY": "64f1a2b3c4d5e6f7a8b9c0d1:3e5f7a9b1c2d4e6f8a0b2c4d6e8f0a1b3c5d7e9f1a2b4c6d8e0f2a3b5c7d9e1f"
      }
    }
  }
}
```

上面的键是一个实际格式的虚构示例：24个十六进制字符，一个冒号，然后是64个十六进制字符。用您自己的值替换这两个值。

运行服务器时使用 `npx`，通过设置 `env` 如图所示。一个 `.env` 文件只能从源签出（见下文）或路径中读取 `GHOST_MCP_ENV_FILE`.

3.  重新启动客户端，询问类似“列出我最近的文章及其SEO标题。”

`GHOST_API_URL` 是规范的管理域，包括任何站点子目录，没有 `/ghost/api/admin`． 对于本地站点，请使用如下地址 `http://localhost:2368`.

配置文件的位置：Claude Desktop在macOS上使用 `~/Library/Application Support/Claude/claude_desktop_config.json`． 游标使用 `~/.cursor/mcp.json` 或者 `.cursor/mcp.json` 在你的项目中。

**克劳德代码:**

```bash
claude mcp add ghost --scope user \
  -e GHOST_API_URL=https://your-blog.com \
  -e GHOST_ADMIN_API_KEY=64f1a2b3c4d5e6f7a8b9c0d1:3e5f7a9b1c2d4e6f8a0b2c4d6e8f0a1b3c5d7e9f1a2b4c6d8e0f2a3b5c7d9e1f \
  -- npx -y @proars/ghost-mcp-server
```

`--scope user` 使服务器在每个文件夹中可用。如果没有它，服务器将仅为运行该命令的文件夹注册。Claude Code启动和停止服务器本身，因此您不需要保持终端打开。

检查与 `claude mcp get ghost`，它应该报告 `Connected`，或打字 `/mcp` 在一个 `claude` 会话。要删除服务器，运行命令 `claude mcp remove ghost -s user`.

任何其他stdio MCP客户端都可以运行相同的命令， `npx -y @proars/ghost-mcp-server`，使用两个环境变量。

**更新:** `npx` 使用缓存，所以 `@latest` 可能不会在每次启动时根据注册表进行检查。要在命令运行时强制进行注册表更新检查，请使用 `npx --prefer-online -y @proars/ghost-mcp-server@latest`． 在JSON客户端配置中，设置 `args` :

```json
["--prefer-online", "-y", "@proars/ghost-mcp-server@latest"]
```

例如，要保持在一个版本上，就把它钉上 `@proars/ghost-mcp-server@2.2.0`． 看到 [更新日志](https://npmcn.com/package/%40proars/ghost-mcp-server/CHANGELOG.md) 查看每个版本中的变化。

不要跑 `npx` 从这个存储库的克隆中：NPM找到本地的 `package.json` 用同样的名字和失败 `ghost-mcp-server: command not found`． 从任何其他文件夹运行它。

## 从源代码安装

如果要更改代码或运行未发布的版本，请使用此选项。

```bash
git clone https://github.com/proars/ghost-mcp-server.git
cd ghost-mcp-server
npm install
npm run build
cp .env.example .env
```

填写 `GHOST_API_URL` 和 `GHOST_ADMIN_API_KEY` 在 `.env`，然后将客户端指向构建。保持 `--silent`npm的启动横幅将在stdout的MCP协议流中结束。

```json
{
  "mcpServers": {
    "ghost": {
      "command": "npm",
      "args": ["--silent", "--prefix", "/ABSOLUTE/PATH/ghost-mcp-server", "start"]
    }
  }
}
```

这个 `.env` 无论客户端从哪个目录启动服务器，都会读取项目根目录中的文件。已经设置的变量具有优先级，如果设置了两个必需的变量，则根本不读取文件。 `GHOST_MCP_ENV_FILE` 选择一个不同的env文件，然后 `GHOST_MCP_SKIP_DOTENV=1` 关闭文件加载。

## 服务器能做什么？

| 资源 | 工具 |
| --- | --: |
| 的帖子 | `get_posts`， `get_post`， `get_post_by_slug`， `create_post`， `update_post`， `delete_post`， `copy_post` |
| 页面 | `get_pages`， `get_page`， `get_page_by_slug`， `create_page`， `update_page`， `delete_page`， `copy_page` |
| 标签 | `get_tags`， `get_tag`， `get_tag_by_slug`， `create_tag`， `update_tag`， `delete_tag` |
| 层 | `get_tiers`， `get_tier`， `create_tier`， `update_tier` |
| 时事通讯 | `get_newsletters`， `get_newsletter`， `create_newsletter`， `update_newsletter` |
| 提供了 | `get_offers`， `get_offer`， `create_offer`， `update_offer` |
| 成员 | `get_members`， `get_member`， `create_member`， `update_member`， `delete_member` |
| 标签 | `get_labels`， `create_label`， `update_label`， `delete_label` |
| 工作人员 | `get_users`， `get_user`， `update_user`， `delete_user`， `get_roles`， `invite_user` |
| 图片和主题 | `upload_image`， `upload_theme`， `activate_theme` |
| 人则 | `create_webhook`， `update_webhook`， `delete_webhook` |
| 网站 | `get_site`， `get_settings` |
| 快捷键 | `update_post_seo`， `update_page_seo`， `update_post_tags` |
| 发现和泛型调用 | `ghost_list_endpoints`， `ghost_api_request` |

Ghost没有层级、通讯或优惠的删除端点，所以这些资源没有 `delete_*` 工具。

> **警告：此服务器公开所有支持的函数，包括破坏性函数。** `delete_post`， `delete_page`， `delete_tag`， `delete_member`， `delete_user`， `activate_theme`， `upload_theme` 和 `ghost_api_request` 可以永久删除或覆盖内容，订阅者和网站设置。删除的记录通常无法恢复。为服务器创建一个单独的集成密钥，在批量工作之前从Ghost Admin导出内容的备份，并为所有人打开手动审批 `update_*`， `delete_*` 以及客户端的通用调用。

### 我如何称呼这些工具？

-   **创建和更新：** 输入记录字段 `data` 打破记录 `id` 作为一个单独的论点。帖子和页面更新需要 `data.updated_at` 从一个新鲜的阅读。搜索引擎优化捷径(`update_post_seo`， `update_page_seo`)和标签快捷方式 `updated_at` 直接。
-   **列表:** 使用 `limit`， `page`， `filter`， `order`， `include` 和 `fields`． 默认情况下，帖子和页面返回时带有紧凑的字段和标签。单记录读取返回完整的记录。
-   **搜索引擎优化:** `update_post_seo` 和 `update_page_seo` 集 `meta_title`， `meta_description`， `og_title` 和 `og_description` 一个电话。通过 `id`，电流 `updated_at` 至少是其中一个领域。您遗漏的字段保持不变。
-   **标签:** 设置标记替换整个集合。将创建尚不存在的标记，空数组将删除所有标记。
-   **出版:** 呼叫 `update_post` 与 `data.status="published"`，或 `"scheduled"` 还有未来 `data.published_at`． 要通过电子邮件发送邮件，请添加 `newsletter` （一段）及（任选） `email_segment`.
-   **图片:** `upload_image` 需要 `file_path`，可选 `purpose` （`image`， `profile_image` 或者 `icon`), `ref`.

### 我如何到达没有专用工具的路线？

使用 `ghost_list_endpoints` 按 `group`， `method`， `access` 或者 `search`． 集 `without_dedicated_tool=true` 列出其他198条路由。每个条目显示访问要求、特性标志和上传字段。

调用任何路由 `ghost_api_request`． 它的 `path` 是相对于 `/ghost/api/admin`，包含真实id或鼻涕虫，没有查询字符串。

```text
ghost_api_request method=GET  path=/labels/slug/vip/
ghost_api_request method=POST path=/members/upload/ files={membersfile: "/Users/me/members.csv"}
ghost_api_request method=GET  path=/posts/export/   save_to="/Users/me/posts.csv"
```

发送JSON有效负载 `body`，使用Ghost所期望的结构。输入查询参数 `query`． 发送多部分文件 `files={formField: "/absolute/path"}`，带有可选文本 `fields`.

下载, `save_to` 必须在现有的可写文件夹中命名新文件。尾随分隔符将被拒绝，并且永远不会覆盖现有文件。当POST、PUT或DELETE返回一个文件时，设置 `save_to` 在第一次调用时，因为重复一个突变来获得它的响应可以重复它的效果。

## 它需要哪些Ghost权限？

| 类 | 路线 | 要求 |
| --- | --: | --- |
| `I` / `PUBLIC` | 125 | 集成键允许列表或公共访问。处理程序权限仍然适用。 |
| `U` | 116 | 具有所需角色或用户会话的人员用户访问令牌。 |
| `SESSION` | 3 | 用户cookie会话。集成密钥和人员令牌被阻止。 |
| `FLOW` | 9 | 登录、恢复和设置流程具有自己的身份验证。 |

要使用人员令牌，请将用户的Ghost Admin配置文件中的令牌放入 `GHOST_ADMIN_API_KEY`． 其权限遵循用户的角色。人员令牌无法调用 `DELETE /db/`， `PUT /users/owner/` 或者 `POST /authentication/reset/`.

服务器不实现cookie会话，登录或2FA。那些路线在目录中只允许发现。

请求发送 `Accept-Version: v5.0`． 目录是幽灵的快照 `main` 分支，因此它包含可能在您的安装中返回404的较新的或实验性路由。不包括公共Content API。

## 给AI客户端访问我的网站是安全的吗？

把它当作任何对你的博客有写权限的帐户，并保持一个人在循环中。

-   把钥匙放在客户所在的环境或房间里 `.env`，千万不要犯。打开破坏性工具的手动审批：all `update_*` 和 `delete_*` 工具, `activate_theme`， `upload_theme` 和 `ghost_api_request`.
-   如果突变在发送后失败，请在重试之前检查Ghost，因为它可能已经通过了。使用读取工具检查截断响应的结果。
-   重定向永远不会被遵循。配置规范的Admin URL，并且在突变接收到重定向后，在发送另一个请求之前检查结果。
-   本地文件路径必须是绝对的。隐藏路径组件被拒绝，无论是在写入时还是在符号链接解析后。上传需要常规文件，下载在请求之前保留，具有仅属于所有者的权限。
-   文件检查不是沙盒。它们不会保护具有可见名称的敏感文件，也不会阻止本地进程在调用期间重写目录。将网站内容视为不可信，并审查上传请求。
-   上传和下载在内存中进行缓冲。HTTP请求在120秒后超时，超过100,000个字符的工具响应将被截断。

## 开发

```bash
npm run typecheck   # tsc --noEmit
npm test            # regression tests with synthetic credentials and a local fake Ghost server
npm run catalog     # regenerate src/catalog.ts from GHOST_API.list
npm run build       # compile to dist/
npm start           # run the build over stdio (requires configuration)
```

路由列表存在 `GHOST_API.list`. `scripts/generate-catalog.mjs` 把它变成 `src/catalog.ts`，你不应该手工编辑。要更改路由，请编辑列表，执行命令 `npm run catalog`然后进行测试日志转到标准输出，因为标准输出是为MCP消息保留的。

GitHub Actions会在Node 20和Node 22上运行类型检查、构建和测试 `main` 每一个拉请求。

这些测试检查目录和工具一致性、请求构造、文件安全性、重定向、重试指导和配置隔离。它们不能证明与实时Ghost实例的兼容性。

## 常见问题解答

**它与自托管Ghost和Ghost（Pro）一起工作吗？** 是的，只要您可以访问管理API并拥有密钥。集 `GHOST_API_URL` 到API URL显示在您的自定义集成页面在鬼管理。这对Ghost（Pro）和自定义域名后面的网站最重要，因为服务器从不遵循重定向：重定向到另一个地址的地址将失败。

**它支持哪些客户端？** 任何可以启动工作室服务器的MCP客户端，包括Claude Desktop， Claude Code和Cursor。

**它能在没有管理员密钥的情况下读取我的公共内容吗？** 否。它只使用Admin API。不包括公共Content API。

**它能删除我的内容吗？** 是， `delete_post`， `delete_page` 类似的工具是永久性的。在您的客户端中需要手动批准它们。

## 许可证

[麻省理工学院](https://npmcn.com/package/%40proars/ghost-mcp-server/LICENSE).

## 常见问题

### @proars/ghost-mcp-server 是什么？

MCP服务器的鬼CMS：管理帖子，页面，标签，SEO元数据，成员，新闻通讯和主题，通过鬼管理API从克劳德，光标和其他人工智能代理

### 如何安装 @proars/ghost-mcp-server？

在项目目录运行 npm install @proars/ghost-mcp-server，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ghost-mcp-server，可以用 npx ghost-mcp-server 直接运行。

### @proars/ghost-mcp-server 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/proars\_\_ghost-mcp-server 是否存在。

### @proars/ghost-mcp-server 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @proars/ghost-mcp-server 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=20。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @proars/ghost-mcp-server 可以商用吗？

@proars/ghost-mcp-server 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @proars/ghost-mcp-server 还在维护吗？

最新版本 2\.2\.1 发布于 2026/11/02（1 天前）；至今共发布 5 个版本，其中过去 12 个月发布了 5 个；首次发布于 2026/11/02。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

