使用说明
Ghost MCP服务器
通过FastMCP框架将Ghost CMS与Claude AI集成的服务器。
需求
- Python 3.11+
- 紫外线 -需要运行此服务器
设置
- 克隆存储库
- 创建虚拟环境(可选但推荐):
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate - 使用uv安装依赖项(依赖项在pyproject.toml中定义):
uv pip install . - 通过复制设置环境变量
.env.example向.env:cp .env.example .env - 配置您的
.env文件与您的Ghost API凭据:GHOST_API_KEY=your_ghost_api_key_here GHOST_API_URL=https://your-ghost-blog.com/ghost/api/admin/posts GHOST_API_VERSION=v5.116.1
Claude桌面配置
要将此服务器与Claude Desktop一起使用,您需要在Claude的MCP设置中对其进行配置:
- 打开克劳德桌面
- 前往“设置”>“开发人员”>“MCP服务器”
- 添加一个新的MCP服务器配置,类似于:
{
"mcpServers": {
"ghost-mcp": {
"command": "/path/to/your/uv",
"args": [
"--directory",
"/path/to/your/ghost-mcp",
"run",
"mcp_server.py"
]
}
}
}
替换 /path/to/your/uv 带有uv可执行文件的实际路径,以及 /path/to/your/ghost-mcp 带有此项目目录的绝对路径。
用法
配置后,您可以使用 ghost_post Claude提供的工具,可以直接在Ghost CMS中创建博客文章:
Create a blog post with title "My First Post" and content "Hello, world!"
该工具支持以下参数:
- title:博客文章的标题
- content:帖子的Markdown内容
- author_id:作者的id(默认值:“1”)
- tags:标记名称列表
- 状态:帖子状态(草稿,已发布)
- feature_image:帖子封面图片的URL
- code_language:代码块的默认语言