ghost-mcp
by: MFYDev
A Model Context Protocol (MCP) server for interacting with Ghost CMS through LLM interfaces like Claude. Allow you to control your Ghost blog by simply asking Claude etc.
📌Overview
Purpose: Provide a secure and comprehensive server interface for interacting with Ghost CMS through LLMs like Claude.
Overview: The Ghost MCP Server utilizes the Model Context Protocol to enable users to efficiently manage their Ghost blog's posts, users, members, tiers, offers, and newsletters with advanced functionalities and secure communication via JWT authentication.
Key Features:
-
Secure JWT Authentication: Ensures secure and authorized access to the Ghost Admin API, enhancing system integrity.
-
Comprehensive Entity Access: Offers detailed access to all critical Ghost CMS components, including posts, users, and newsletters, facilitating extensive content management.
-
Advanced Search Functionality: Supports both fuzzy and exact matching for enhanced search capabilities, allowing users to find content more easily.
-
Detailed Output: Provides human-readable responses for API calls, enhancing the usability and interpretability of data.
-
Error Handling and Logging: Equipped with robust error handling through custom exceptions and integrated logging support for improved troubleshooting and system monitoring.
Ghost MCP Server
A Model Context Protocol (MCP) server for interacting with Ghost CMS through LLM interfaces. This server provides secure access to your Ghost blog, leveraging JWT authentication and a comprehensive set of MCP tools for managing posts, users, members, tiers, offers, and newsletters.
Features
- Secure JWT Authentication for Ghost Admin API requests
- Comprehensive Entity Access including posts, users, members, tiers, offers, and newsletters
- Advanced Search Functionality with both fuzzy and exact matching
- Detailed Output for Ghost entities
- Robust Error Handling using custom
GhostError
exceptions - Integrated Logging Support for enhanced troubleshooting
Installation
Installing via Smithery
To install Ghost MCP Server automatically via Smithery:
npx -y @smithery/cli install @MFYDev/ghost-mcp --client claude
Manual Installation
# 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 .
Requirements
- Python ≥ 3.12
- Running Ghost instance with Admin API access (v5.x+ recommended)
Usage
Environment Variables
GHOST_API_URL=https://yourblog.com # Your Ghost Admin API URL
GHOST_STAFF_API_KEY=your_staff_api_key # Your Ghost Staff API key
Usage with MCP Clients
To use with MCP clients, for instance, Claude Desktop:
{
"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"
}
}
}
}
Testing with 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
Available Tools
Main Tool
ghost
: Central tool for accessing all Ghost CMS functionality
Using the Ghost Tool
The ghost tool accepts two main parameters:
action
: The specific Ghost operation to performparams
: A dictionary of parameters for the specified action
Example usage:
# 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}}"
}
})
Available Actions
Posts Actions
list_posts
search_posts_by_title
read_post
create_post
update_post
delete_post
batchly_update_posts
Tags Actions
browse_tags
read_tag
create_tag
update_tag
delete_tag
Users Actions
list_roles
create_invite
list_users
read_user
delete_user
Members Actions
list_members
read_member
create_member
update_member
Tiers Actions
list_tiers
read_tier
create_tier
update_tier
Offers Actions
list_offers
read_offer
create_offer
update_offer
Newsletters Actions
list_newsletters
read_newsletter
create_newsletter
update_newsletter
Webhooks Actions
create_webhook
update_webhook
delete_webhook
Available Resources
All resources follow the URI pattern: [type]://[id]
user://{user_id}
member://{member_id}
tier://{tier_id}
offer://{offer_id}
newsletter://{newsletter_id}
post://{post_id}
blog://info
Error Handling
Ghost MCP Server employs a custom GhostError
exception to handle API communication errors and processing issues.
Contributing
- Fork the repository
- Create a feature branch
- Commit changes
- Create a pull request
License
MIT