GH

Ghost MCP Server for Ghost CMS Integration

Integrate Ghost CMS with LLMs using an MCP server to enable seamless Model Context Protocol interactions and streamline content automation.

Quick Install
npx -y @MFYDev/ghost-mcp

Overview

This MCP (Model Context Protocol) server provides a bridge between Ghost CMS and LLM-based tooling by exposing Ghost content and actions as MCP-compatible tools. It lets language models (or agents built on top of them) discover, read, and manipulate Ghost content in a standard way, so you can build content automation, summarization, search, and editorial assistants that interact with a Ghost site.

The server translates MCP tool calls into Ghost Admin API operations, handling authentication, pagination, and basic filtering. Running the MCP server alongside or in front of your Ghost installation enables seamless Model Context Protocol interactions without embedding Ghost credentials in client-side code, and gives developers a predictable set of tools to integrate with LLMs.

Features

  • MCP-compatible tool discovery and invocation interface
  • Read access to posts, pages, tags, and site metadata
  • Create, update, and draft management for posts and pages
  • Search and listing with pagination and filtering
  • Configurable authentication using Ghost Admin API key
  • Simple REST endpoints for tool manifests and invocation
  • Example manifest and request/response shapes for quick integration
  • Basic security recommendations (API key usage, CORS, TLS)

Installation / Configuration

Prerequisites:

  • Node.js (16+ recommended)
  • Access to your Ghost Admin API key (Admin API key or custom integration key)

Clone and install:

git clone https://github.com/MFYDev/ghost-mcp.git
cd ghost-mcp
npm install

Create a .env file (example):

# URL of your Ghost site, e.g. https://blog.example.com
GHOST_API_URL=https://your-ghost-site.com

# Ghost Admin API key (format: <id>:<secret>)
GHOST_ADMIN_API_KEY=YOUR_ADMIN_API_KEY

# Server port for the MCP server
PORT=4000

# Optional: restrict access to specific hostnames for the MCP manifest
MCP_HOST=http://localhost:4000

Start the server (development):

npm run dev

Start in production:

npm start

The server will expose endpoints (defaults shown):

  • Tool manifest: GET /mcp/manifest
  • Invoke tool: POST /mcp/invoke
  • Health: GET /health

Adjust environment variables or CLI flags to change host/port. Run behind a reverse proxy (Nginx) and enable TLS for production.

Available Tools

The server exposes a set of MCP tools representing common Ghost operations. Each tool includes a name, description, input schema, and example output. Typical tools:

  • getSiteInfo
    • Description: Returns basic site metadata (title, description, url).
    • Use: Context enrichment for LLMs.
  • listPosts
    • Description: List posts with pagination, filter by status/tag, include tags/authors.
    • Input fields: page, limit, status, tag
  • getPost
    • Description: Fetch a single post by ID or slug (includes HTML/content).
    • Input fields: id | slug
  • createDraft
    • Description: Create a new draft post.
    • Input fields: title, html, tags, status=draft
  • updatePost
    • Description: Update fields of a post (title, html, status).
    • Input fields: id, title?, html?, tags?, status?
  • search
    • Description: Search posts by query string across title and content.
    • Input fields: q, limit, page

Example manifest (partial):

{
  "name": "ghost-mcp",
  "tools": [
    {
      "name": "getPost",
      "description": "Fetch a post by ID or slug",
      "input_schema": {"type": "object", "properties": {"id": {"type": "string"}, "slug": {"type": "string"}}}
    },
    {
      "name": "listPosts",
      "description": "List posts with pagination and filters",
      "input_schema": {"type": "object", "properties": {"page": {"type": "integer"}, "limit": {"type": "integer"}, "status": {"type": "string"}}}
    }
  ]
}

API Reference (Quick)

EndpointMethodPurpose
/mcp/manifestGETReturn MCP manifest with available tools
/mcp/invokePOSTInvoke a tool. Body: { tool: string, input: object }
/healthGETBasic health check

Example invoke request (curl):

curl -X POST http://localhost:4000/mcp/invoke \
  -H "Content-Type: application/json" \
  -d '{"tool":"getPost","input":{"slug":"welcome"}}'

Use Cases

  • Content drafting assistant: An LLM agent uses createDraft to propose new post drafts from brief prompts, then updatePost after editorial review.
  • Automated summaries: Periodic jobs call listPosts and getPost to summarize recent articles and produce newsletter snippets via an LLM.
  • SEO optimization workflow: Use search + getPost to find posts matching keywords, then updatePost to apply AI-suggested title/meta improvements.
  • Migration and sync: Agents read Ghost content via getPost/listPosts and transform it into other CMS formats or feed it into downstream indexing/search services.
  • Editorial QA: An LLM checks posts for style, profanity, or readability by fetching content and returning suggested edits, applied via updatePost.

Security and Operational Notes

  • Keep your Ghost Admin API key secret; the MCP server requires this to interact with Ghost. Do not expose it to clients.
  • Run the server behind TLS and restrict access to trusted clients. Consider token-based access or network-level restrictions for the MCP endpoints.
  • Enable rate limiting and logging for auditing LLM-driven changes.
  • Validate and sanitize inputs on server side before calling Ghost Admin API to avoid accidental content loss.
  • Test in a staging Ghost instance before enabling write operations in production.

Resources

  • Ghost Admin API docs: https://ghost.org/docs/admin-api/
  • MCP (Model Context Protocol) overview and best practices (refer to your LLM provider’s MCP guidance)
  • Example integrations and sample manifests are included in the repository under /examples

This MCP server provides a lightweight, predictable interface for integrating Ghost with LLMs, enabling automation workflows while keeping Ghost credentials server-side and controlled.

Tags:ai-ml