Ghost MCP Server for interacting with Ghost CMS API
npm install @densh/ghost-mcp-serverA Model Context Protocol (MCP) server that integrates with the Ghost Admin API. This server enables programmatic access to Ghost CMS features including post management, page management, member management, and more.
- Post Management (create, read, update, delete, search)
- Page Management (create, read, update, delete)
- Tag Management
- Author Management
- Member Management (create, read, update, delete, search)
- Image Upload (Base64 and URL-based)
- Node.js (v18 or higher recommended)
- Ghost CMS instance
- Ghost Admin API key
Install the package using npm:
``bash`
npm install @densh/ghost-mcp-server
1. Create a new custom integration in your Ghost Admin dashboard under Settings > Integrations.
2. Set the following environment variables:
`bashmacOS/Linux
export GHOST_API_URL="https://your-ghost-blog.com"
export GHOST_ADMIN_API_KEY="your_admin_api_key"
Alternatively, you can create a
.env file:`env
GHOST_API_URL=https://your-ghost-blog.com
GHOST_ADMIN_API_KEY=your_admin_api_key
`Usage
After installation, start the server with:
`bash
npx @densh/ghost-mcp-server
`Available Tools
$3
Retrieves a list of blog posts.Input:
`json
{
"limit": "number", // Optional: Number of posts to retrieve (1-100, default: 10)
"page": "number" // Optional: Page number (default: 1)
}
`$3
Retrieves a specific post by ID.Input:
`json
{
"id": "string" // Required: Post ID
}
`$3
Searches for posts.Input:
`json
{
"query": "string", // Required: Search query
"limit": "number" // Optional: Number of posts to retrieve (1-100, default: 10)
}
`$3
Creates a new post.Input:
`json
{
"title": "string", // Required: Post title
"html": "string", // Optional: HTML content
"lexical": "string", // Optional: Lexical content
"status": "string", // Optional: Post status (published/draft/scheduled)
"visibility": "string" // Optional: Visibility level (public/members/paid/tiers)
}
`$3
Updates an existing post.Input:
`json
{
"id": "string", // Required: Post ID
"title": "string", // Optional: Post title
"html": "string", // Optional: HTML content
"lexical": "string", // Optional: Lexical content
"status": "string" // Optional: Post status
}
`$3
Deletes a post.Input:
`json
{
"id": "string" // Required: Post ID
}
`$3
Retrieves a list of pages.Input:
`json
{
"limit": "number", // Optional: Number of pages to retrieve (1-100, default: 10)
"page": "number", // Optional: Page number (default: 1)
"order": "string", // Optional: Sort order
"formats": ["string"], // Optional: Content formats (html/mobiledoc/lexical)
"include": ["string"] // Optional: Related data to include (authors/tags)
}
`$3
Retrieves a list of members.Input:
`json
{
"limit": "number", // Optional: Number of members to retrieve (1-100, default: 10)
"page": "number", // Optional: Page number (default: 1)
"order": "string", // Optional: Sort order
"include": ["string"] // Optional: Related data to include (labels/newsletters)
}
`$3
Searches for members.Input:
`json
{
"query": "string", // Required: Search query
"limit": "number", // Optional: Number of members to retrieve (1-100, default: 10)
"include": ["string"] // Optional: Related data to include (labels/newsletters)
}
`$3
Uploads an image from Base64 data.Input:
`json
{
"file": "string", // Required: Base64 encoded image data
"purpose": "string" // Optional: Image purpose (image/profile_image/icon)
}
`$3
Downloads an image from a URL and uploads it to Ghost. Returns the permanent Ghost URL.Input:
`json
{
"url": "string", // Required: Source URL of the image to download
"filename": "string", // Optional: Desired filename (without extension)
"purpose": "string", // Optional: Image purpose (image/profile_image/icon, default: image)
"ref": "string" // Optional: Reference identifier for tracking
}
`Output (success):
`json
{
"success": true,
"ghost_url": "https://your-ghost-blog.com/content/images/2025/12/image.png",
"filename": "image.png",
"size_bytes": 245678,
"mime_type": "image/png"
}
`Output (failure):
`json
{
"success": false,
"error": "Failed to download: 403 Forbidden"
}
`Supported formats: PNG, JPEG, GIF, WebP, SVG. Maximum file size: 128MB.
$3
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
`bash
npm run inspect
``The Inspector will provide a URL to access debugging tools in your browser.
MIT License