Ghost MCP Server

by MFYDev
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides secure and comprehensive access to Ghost CMS blogs, enabling management of posts, users, members, tiers, offers, and newsletters through LLM interfaces

Ghost MCP 服务器

一个模型上下文协议 (MCP) 服务器,用于通过类似 Claude 的 LLM 接口与 Ghost CMS 进行交互。该服务器提供安全、全面的 Ghost 博客访问,利用 JWT 身份验证和丰富的 MCP 工具来管理帖子、用户、会员、等级、优惠和新闻通讯。

特征

  • Ghost Admin API 请求的安全 JWT 身份验证
  • 全面的实体访问,包括帖子、用户、会员、等级、优惠和新闻通讯
  • 具有模糊和精确匹配选项的高级搜索功能
  • Ghost 实体的详细且易于阅读的输出
  • 使用自定义GhostError异常进行强大的错误处理
  • 通过 MCP 上下文集成日志支持,以增强故障排除

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Ghost MCP Server:

npx -y @smithery/cli install @MFYDev/ghost-mcp --client claude

手动安装

# Clone repository git clone git@github.com/mfydev/ghost-mcp.git cd ghost-mcp # Create virtual environment and install uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e .

要求

  • Python ≥ 3.12
  • 使用管理 API 访问运行 Ghost 实例(建议使用 v5.x+)
  • Node.js(用于使用 MCP Inspector 进行测试)

用法

环境变量

GHOST_API_URL=https://yourblog.com # Your Ghost Admin API URL GHOST_STAFF_API_KEY=your_staff_api_key # Your Ghost Staff API key

与 MCP 客户端一起使用

要将其与 MCP 客户端(例如 Claude Desktop)一起使用,请将以下内容添加到您的claude_desktop_config.json中:

{ "mcpServers": { "ghost": { "command": "/Users/username/.local/bin/uv", "args": [ "--directory", "/path/to/ghost-mcp", "run", "src/main.py" ], "env": { "GHOST_API_URL": "your_ghost_api_url", "GHOST_STAFF_API_KEY": "your_staff_api_key" } } } }

使用 MCP Inspector 进行测试

GHOST_API_URL=your_ghost_api_url GHOST_STAFF_API_KEY=your_staff_api_key npx @modelcontextprotocol/inspector uv --directory /path/to/ghost-mcp run src/main.py

可用工具

Ghost MCP 现在提供了一个统一的工具,可以访问所有 Ghost CMS 功能:

主要工具

  • ghost :访问所有 Ghost CMS 功能的中央工具

使用幽灵工具

ghost 工具接受两个主要参数:

  1. action :要执行的具体 Ghost 操作
  2. params :指定操作的参数字典

使用示例:

# List posts ghost(action="list_posts", params={"format": "text", "page": 1, "limit": 15}) # Search posts by title ghost(action="search_posts_by_title", params={"query": "Welcome", "exact": False}) # Create a post ghost(action="create_post", params={ "post_data": { "title": "New Post via MCP", "status": "draft", "lexical": "{\"root\":{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"Hello World\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"paragraph\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}" } })

可用操作

幽灵工具支持与以前相同的所有操作,但现在通过统一的界面:

帖子操作

  • list_posts :分页列出博客文章
  • search_posts_by_title :按标题搜索帖子
  • read_post :检索特定帖子的完整内容
  • create_post :创建新帖子
  • update_post :更新特定帖子
  • delete_post :删除特定帖子
  • batchly_update_posts :在单个请求中更新多个帖子

标签 动作

  • browse_tags :列出所有标签
  • read_tag :检索特定标签信息
  • create_tag :创建新标签
  • update_tag :更新现有标签
  • delete_tag :删除特定标签

用户操作

  • list_roles :列出所有可用角色
  • create_invite :创建新用户邀请
  • list_users :列出所有用户
  • read_user :获取特定用户的详细信息
  • delete_user :删除特定用户

会员行动

  • list_members :列出成员
  • read_member :检索特定成员信息
  • create_member :创建新成员
  • update_member :更新现有成员

层级行动

  • list_tiers :列出所有会员等级
  • read_tier :检索特定层级信息
  • create_tier :创建一个新的层
  • update_tier :更新现有层

优惠活动

  • list_offers :列出促销优惠
  • read_offer :获取具体优惠信息
  • create_offer :创建新的优惠
  • update_offer :更新现有优惠

时事通讯行动

  • list_newsletters :列出所有新闻通讯
  • read_newsletter :检索特定的新闻通讯信息
  • create_newsletter :创建新的新闻通讯
  • update_newsletter :更新现有的新闻通讯

Webhook 操作

  • create_webhook :创建一个新的 webhook
  • update_webhook :更新现有的 webhook
  • delete_webhook :删除特定的 webhook

可用资源

所有资源都遵循 URI 模式: [type]://[id]

  • user://{user_id} :用户个人资料和角色
  • member://{member_id} :会员详细信息和订阅
  • tier://{tier_id} :层级配置
  • offer://{offer_id} :优惠详情
  • newsletter://{newsletter_id} :新闻通讯设置
  • post://{post_id} :帖子内容和元数据
  • blog://info :一般博客信息

错误处理

Ghost MCP 服务器使用自定义GhostError异常来处理 API 通信错误和处理问题。这确保了错误消息清晰易懂,有助于故障排除。

贡献

  1. Fork 存储库
  2. 创建功能分支
  3. 提交更改
  4. 创建拉取请求

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

通过 LLM 接口实现与 Ghost CMS 的交互,通过 JWT 身份验证提供安全访问,以管理帖子、用户和新闻通讯,并提供详细的输出和错误处理。

  1. Features
    1. Installation
      1. Installing via Smithery
      2. Manual Installation
    2. Requirements
      1. Usage
        1. Environment Variables
        2. Usage with MCP Clients
        3. Testing with MCP Inspector
      2. Available Tools
        1. Main Tool
        2. Using the Ghost Tool
        3. Available Actions
      3. Available Resources
        1. Error Handling
          1. Contributing
            1. License

              Appeared in Searches

              ID: vor63xn7ky