Ghost CMS MCP Server

平台与服务

by hithereiamaliff

为你的 Ghost 实例提供丰富的 MCP 工具,可管理文章、用户、会员、等级、优惠和电子报;非 Ghost.org 官方版本,基于 MFYDev 的 ghost-mcp 分叉。

什么是 Ghost CMS MCP Server

为你的 Ghost 实例提供丰富的 MCP 工具,可管理文章、用户、会员、等级、优惠和电子报;非 Ghost.org 官方版本,基于 MFYDev 的 ghost-mcp 分叉。

核心功能 (44 个工具)

posts_browse

Browse and list posts with filtering and pagination

posts_read

Read a specific post by ID or slug

posts_add

Create a new post with title, content, tags, and publishing options

posts_edit

Edit an existing post

posts_delete

Delete a post by ID

members_browse

Browse and list members with filtering and pagination

members_read

Read a specific member by ID or email

members_add

Add a new member with email and subscription details

members_edit

Edit an existing member

members_delete

Delete a member by ID

users_browse

Browse and list staff users

users_read

Read a specific user by ID or slug

users_edit

Edit a staff user

users_delete

Delete a staff user

tags_browse

Browse and list tags

tags_read

Read a specific tag by ID or slug

tags_add

Create a new tag

tags_edit

Edit an existing tag

tags_delete

Delete a tag by ID

tiers_browse

Browse and list membership tiers

tiers_read

Read a specific tier by ID

tiers_add

Create a new membership tier

tiers_edit

Edit an existing tier

tiers_delete

Delete a tier by ID

offers_browse

Browse and list promotional offers

offers_read

Read a specific offer by ID

offers_add

Create a new promotional offer

offers_edit

Edit an existing offer

offers_delete

Delete an offer by ID

newsletters_browse

Browse and list newsletters

newsletters_read

Read a specific newsletter by ID

newsletters_add

Create a new newsletter

newsletters_edit

Edit an existing newsletter

newsletters_delete

Delete a newsletter by ID

invites_browse

Browse and list staff invites

invites_add

Send a new staff invite

invites_delete

Delete/revoke an invite

roles_browse

Browse and list available roles

roles_read

Read a specific role by ID

webhooks_add

Create a new webhook

webhooks_edit

Edit an existing webhook

webhooks_delete

Delete a webhook by ID

admin_site_ping

Ping the Ghost Admin API to check connectivity

config_echo

Echo the current Ghost configuration (masked)

README

Ghost MCP Server

smithery badge

This is a fork of MFYDev/ghost-mcp, now maintained and improved by @hithereiamaliff.

This Model Context Protocol (MCP) server provides a powerful and flexible way to manage your Ghost CMS instance using Large Language Model (LLM) interfaces. It offers comprehensive and secure access to your blog's administrative functions, allowing you to automate and streamline your content management workflows.

Features

  • Robust API Integration: Utilizes direct, authenticated axios calls for all Admin API operations, ensuring a stable and reliable connection that is not dependent on external libraries.
  • Comprehensive Entity Access: Manages posts, users, members, tiers, offers, and newsletters.
  • Enhanced Error Handling: Provides detailed status codes and response bodies.
  • Modern Transport: Exclusively uses the Streamable HTTP transport, with all deprecated STDIO logic removed.
  • Diagnostic Tools: Includes tools for troubleshooting API connectivity and configuration.
  • Multi-Tenant Support: Uses mcp-key-service so public/shared deployments never expose raw Ghost credentials in MCP URLs.
  • Firebase Analytics: Cloud-based analytics storage with Firebase Realtime Database and local file backup.
  • VPS Deployment Ready: Docker, Nginx, and GitHub Actions auto-deployment support.

Installation & Usage

This MCP server is available through two deployment methods:

Method 1: NPM Package (Recommended for MCP Clients)

Install directly from npm:

bash
npm install -g mcp-ghostcms

Or use with npx (no installation required):

bash
npx mcp-ghostcms

Using with Claude Desktop

To use with MCP clients like Claude Desktop, add the following to your claude_desktop_config.json:

json
{
  "mcpServers": {
      "mcp-ghostcms": {
        "command": "npx",
        "args": ["-y", "mcp-ghostcms"],
        "env": {
            "GHOST_API_URL": "https://yourghostbloginstance.com",
            "GHOST_ADMIN_API_KEY": "your_admin_api_key",
            "GHOST_API_VERSION": "v6.0"
        }
      }
    }
}

Method 2: Smithery Cloud Platform

Deploy and run on Smithery's cloud platform:

smithery badge

Or for local development with Smithery:

bash
git clone <this-repo>
cd ghost-mcp
npm install
npm run dev

This will start the server on port 8080 and open the Smithery Playground in your browser.

Method 3: Self-Hosted VPS with MCP Key Service

For public/shared deployments, this MCP server can be self-hosted on a VPS and resolves Ghost credentials through mcp-key-service. Users register their Ghost site URL and admin key once, receive a usr_XXXXXXXX key, and only that user key appears in the MCP URL.

MCP URL Format

code
https://your-domain.com/ghostcms/mcp/usr_YOUR_USER_KEY

Alternative query-param form:

code
https://your-domain.com/ghostcms/mcp?api_key=usr_YOUR_USER_KEY

Example Usage with Claude Desktop

Add to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "ghost-myblog": {
      "type": "streamable-http",
      "url": "https://mcp.yourdomain.com/ghostcms/mcp/usr_YOUR_USER_KEY"
    }
  }
}

Live Demo

A public instance is available at:

code
https://mcp.techmavie.digital/ghostcms/mcp/usr_YOUR_USER_KEY

Note: Register your Ghost credentials at mcpkeys.techmavie.digital to obtain a usr_ key first.

Configuration

This MCP server requires the following configuration:

  • GHOST_API_URL: Your Ghost site URL (domain only, no path), e.g., https://yourghostbloginstance.com
  • GHOST_ADMIN_API_KEY: Your Ghost Admin API key in id:secret format (from Ghost Admin → Settings → Integrations).
  • GHOST_API_VERSION: Ghost API version (v5.0 for Ghost 5.x, v6.0 for Ghost 6.x).
  • GHOST_CONTENT_API_KEY (optional): Your Ghost Content API key for read-only operations.

For hosted HTTP mode, configure KEY_SERVICE_URL and KEY_SERVICE_TOKEN on the server, and set MCP_API_KEY if you want to protect the analytics endpoints with an X-API-Key header.

Available Resources

The following Ghost CMS resources are available through this MCP server:

  • Posts: Articles and content published on your Ghost site.
  • Members: Registered users and subscribers of your site.
  • Newsletters: Email newsletters managed and sent via Ghost.
  • Offers: Promotional offers and discounts for members.
  • Invites: Invitations for new users or staff to join your Ghost site.
  • Roles: User roles and permissions within the Ghost admin.
  • Tags: Organizational tags for posts and content.
  • Tiers: Subscription tiers and plans for members.
  • Users: Admin users and staff accounts.
  • Webhooks: Automated event notifications to external services.

Available Tools

This MCP server provides a wide array of tools to manage your Ghost CMS. These tools are exposed via the Model Context Protocol and allow for a full range of CRUD (Create, Read, Update, Delete) operations on your blog's resources. Below is an overview of the available toolset:

Posts

  • Browse Posts: List posts with optional filters, pagination, and ordering.
  • Read Post: Retrieve a post by ID or slug.
  • Add Post: Create a new post with title, content, and status.
  • Edit Post: Update an existing post by ID.
  • Delete Post: Remove a post by ID.

Members

  • Browse Members: List members with filters and pagination.
  • Read Member: Retrieve a member by ID or email.
  • Add Member: Create a new member.
  • Edit Member: Update member details.
  • Delete Member: Remove a member.

Newsletters

  • Browse Newsletters: List newsletters.
  • Read Newsletter: Retrieve a newsletter by ID.
  • Add Newsletter: Create a new newsletter.
  • Edit Newsletter: Update newsletter details.
  • Delete Newsletter: Remove a newsletter.

Offers

  • Browse Offers: List offers.
  • Read Offer: Retrieve an offer by ID.
  • Add Offer: Create a new offer.
  • Edit Offer: Update offer details.
  • Delete Offer: Remove an offer.

Invites

  • Browse Invites: List invites.
  • Add Invite: Create a new invite.
  • Delete Invite: Remove an invite.

Roles

  • Browse Roles: List roles.
  • Read Role: Retrieve a role by ID.

Tags

  • Browse Tags: List tags.
  • Read Tag: Retrieve a tag by ID or slug.
  • Add Tag: Create a new tag.
  • Edit Tag: Update tag details.
  • Delete Tag: Remove a tag.

Tiers

  • Browse Tiers: List tiers.
  • Read Tier: Retrieve a tier by ID.
  • Add Tier: Create a new tier.
  • Edit Tier: Update tier details.
  • Delete Tier: Remove a tier.

Users

  • Browse Users: List users.
  • Read User: Retrieve a user by ID or slug.
  • Edit User: Update user details.
  • Delete User: Remove a user.

Webhooks

  • Browse Webhooks: List webhooks.
  • Add Webhook: Create a new webhook.
  • Delete Webhook: Remove a webhook.

Each tool is accessible via the MCP protocol and can be invoked from compatible clients. For detailed parameter schemas and usage, see the source code in src/tools/.

Error Handling & Diagnostics

This fork includes enhanced error handling that provides detailed information about API failures:

  • HTTP status codes are captured and reported
  • Full response bodies are included in error messages
  • Runtime configuration is logged at startup
  • Diagnostic tools are available to troubleshoot connectivity issues:
    • admin_site_ping: Tests if the Ghost Admin API endpoint is reachable
    • config_echo: Shows the current Ghost API configuration (with masked key)

These improvements make it much easier to diagnose common issues like:

  • Incorrect API URL format
  • Missing or malformed Admin API keys
  • API version mismatches
  • Network/proxy configuration problems

Development

Setup

  1. Clone the repository
  2. Install dependencies: npm install
  3. Create a .env file with your Ghost configuration:
    code
    GHOST_API_URL=https://yourghostbloginstance.com
    GHOST_ADMIN_API_KEY=your_admin_api_key
    GHOST_API_VERSION=v6.0
    
  4. Build the project: npm run build
  5. Start the dev server: npm run dev

Troubleshooting

If you encounter authentication or "Resource not found" errors:

  1. Verify your Ghost Admin API key is in the correct id:secret format.
  2. Ensure your GHOST_API_URL is the correct domain for your Ghost instance.
  3. Use the admin_site_ping tool to verify that the Admin API endpoint is reachable.
  4. Check the server logs for the actual configuration being used.

MCP Streamable HTTP Requirements

This server implements the MCP Streamable HTTP transport with proper session management and Accept header handling. The server automatically injects text/event-stream into Accept headers and creates isolated transport instances per request to prevent session conflicts.

Testing the endpoint with proper MCP initialization:

bash
# Test MCP initialization (proper way to test)
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' \
  "https://mcp.techmavie.digital/ghostcms/mcp/usr_YOUR_USER_KEY"

# Expected response (SSE format):
# event: message
# data: {"result":{"protocolVersion":"2024-11-05","capabilities":{...},"serverInfo":{...}},"jsonrpc":"2.0","id":1}

Note: Simple GET/POST requests without MCP initialization will return protocol errors like "Bad Request: Server not initialized" - this is expected behavior. The endpoint requires proper MCP protocol handshake.

For MCP Clients (Claude Desktop, Claude iOS, Claude Code):

  • MCP clients automatically handle the initialization protocol and session management
  • Ensure your MCP URL is correctly formatted in your client configuration
  • For Claude iOS, use the Connectors feature with the full MCP URL using your usr_ key
  • For Claude Code, add the server to your MCP settings with type streamable-http

Session Management:

  • The server creates a new transport instance for each HTTP request (stateless pattern)
  • Each client connection gets a unique session ID automatically
  • Multiple clients can connect simultaneously without session conflicts
  • Sessions are automatically cleaned up after responses are sent

Common Errors and Solutions:

ErrorCauseSolution
"Not Acceptable: Client must accept text/event-stream"Old server versionUpdate to latest version - this is fixed
"Bad Request: Server not initialized"Testing without MCP protocolUse proper MCP initialization (see example above)
"Mcp-Session-Id header is required"Old server version with session conflictsUpdate to latest version - this is fixed
"Server already initialized"Old server version reusing transportsUpdate to latest version - this is fixed

VPS Deployment

This MCP server includes full support for self-hosted VPS deployment with Docker, Nginx, and GitHub Actions auto-deployment.

Architecture

code
┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Claude/MCP     │────▶│  Nginx Proxy    │────▶│  Docker         │
│  Client         │     │  /ghostcms/     │     │  Container      │
└─────────────────┘     └─────────────────┘     └─────────────────┘
                                                        │
                                                        ▼
                                                ┌─────────────────┐
                                                │  Ghost CMS      │
                                                │  Admin API      │
                                                └─────────────────┘

Deployment Files

The repository includes:

  • Dockerfile - Container configuration with Node.js 20-alpine
  • docker-compose.yml - Docker orchestration with volumes for analytics and Firebase credentials
  • deploy/nginx-mcp.conf - Nginx reverse proxy configuration
  • .github/workflows/deploy-vps.yml - GitHub Actions auto-deployment workflow

Quick Deploy

bash
# On your VPS
cd /opt/mcp-servers
git clone https://github.com/hithereiamaliff/mcp-ghostcms.git ghostcms
cd ghostcms

# Build and start
docker compose up -d --build

# Check logs
docker compose logs -f

Endpoints

EndpointDescription
/healthHealth check
/mcp/:userKeyMCP endpoint (hosted key-service)
/analyticsAnalytics JSON data
/analytics/dashboardVisual analytics dashboard
/analytics/toolsTool usage statistics

Firebase Analytics

This MCP server uses Firebase Realtime Database for cloud-based analytics storage with local file backup as fallback.

Features

  • Dual Storage: Firebase (primary) + local file (backup)
  • Persistent: Data survives container rebuilds and deployments
  • Real-time: Updates every 60 seconds
  • Dashboard: Visual analytics at /analytics/dashboard

Data Tracked

  • Total requests and tool calls
  • Requests by method (GET, POST, etc.)
  • Requests by endpoint
  • Tool usage statistics
  • Client IPs and user agents
  • Hourly request trends
  • Recent tool call activity

Firebase Setup

  1. Create a Firebase project at Firebase Console
  2. Enable Realtime Database
  3. Generate service account credentials (Project Settings → Service Accounts)
  4. Copy credentials to your VPS:
bash
# On VPS
mkdir -p /opt/mcp-servers/ghostcms/.credentials
# Copy firebase-service-account.json to this directory

# Create Docker volume
docker volume create ghostcms_firebase-credentials

# Copy to volume with correct permissions
docker run --rm \
  -v ghostcms_firebase-credentials:/credentials \
  -v /opt/mcp-servers/ghostcms/.credentials:/source:ro \
  alpine sh -c "cp /source/firebase-service-account.json /credentials/ && chown -R 1001:1001 /credentials/"

# Restart container
docker compose down
docker compose up -d

Firebase Data Structure

code
mcp-analytics/
  └── mcp-ghostcms/
      ├── serverStartTime
      ├── totalRequests
      ├── totalToolCalls
      ├── requestsByMethod
      ├── requestsByEndpoint
      ├── toolCalls
      ├── recentToolCalls
      ├── clientsByIp
      ├── clientsByUserAgent
      ├── hourlyRequests
      └── lastUpdated

For detailed Firebase setup instructions, see FIREBASE_SETUP.md.

Contributing

  1. Fork repository
  2. Create feature branch
  3. Commit changes
  4. Create pull request

License

MIT

常见问题

Ghost CMS MCP Server 是什么?

为你的 Ghost 实例提供丰富的 MCP 工具,可管理文章、用户、会员、等级、优惠和电子报;非 Ghost.org 官方版本,基于 MFYDev 的 ghost-mcp 分叉。

Ghost CMS MCP Server 提供哪些工具?

提供 44 个工具,包括 posts_browse、posts_read、posts_add

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描109.6k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描109.6k

接口设计评审

by alirezarezvani

Universal
热门

审查 REST API 设计是否符合行业规范,自动检查命名、HTTP 方法、状态码与文档覆盖,识别破坏性变更并给出设计评分,适合评审接口方案和版本迭代前把关。

做API和架构方案时,它能帮你提前揪出接口设计问题并对齐最佳实践,评审视角系统,团队协作更省心。

平台与服务
未扫描9.0k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
82.9k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.3k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
34.5k

评论