Ghost博客MCP服务器

为Ghost博客平台提供模型上下文协议(MCP)服务器实现,支持服务器发送事件(SSE)传输,用于管理博客文章、页面和标签。

  • by oculairmedia
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 oculairmedia/plane-projectmanagement_mcp

使用说明

带SSE传输的Ghost MCP服务器

此存储库包含Ghost博客平台的模型上下文协议(MCP)服务器实现,支持服务器发送事件(SSE)传输。

特性

  • 支持SSE和stdio传输
  • 通过MCP工具提供对Ghost Admin API功能的访问
  • 管理Ghost博客文章、页面和标签
  • 默认情况下,Docker中的非root用户是安全的
  • 环境变量配置
  • 健康检查端点

快速开始

环境设置

  1. 复制示例环境文件:

    cp .env.example .env
    
  2. 编辑 .env 文件与您的Ghost API凭据:

    GHOST_URL=https://your-ghost-blog.com
    GHOST_KEY_ID=your_ghost_key_id_here
    GHOST_KEY_SECRET=your_ghost_key_secret_here
    PORT=3064
    NODE_ENV=production
    

使用Docker Compose

运行服务器最简单的方法是使用Docker Compose:

docker-compose up -d

如果需要,这将构建映像,并在分离模式下启动服务器。

直接使用Docker

你也可以直接构建和运行Docker镜像:

# Build the image
docker build -t oculair/ghost-mcp:1.0.0 .

# Run the container
docker run -p 3064:3064 --env-file .env --rm -it oculair/ghost-mcp:1.0.0

多架构构建

要为多种架构(amd64和arm64)构建:

  1. 启用Docker Buildx:

    docker buildx create --use --name multiarch-builder
    docker buildx inspect --bootstrap
    
  2. 构建并推进:

    docker buildx build --platform linux/amd64,linux/arm64 \
      -t oculair/ghost-mcp:1.0.0 \
      --push .
    
  3. 验证多架构映像:

    docker manifest inspect oculair/ghost-mcp:1.0.0
    

发展

项目结构

.
├── everything/
│   ├── src/
│   │   ├── core/       # Core server implementation
│   │   ├── tools/      # MCP tool implementations
│   │   ├── transports/ # Transport implementations (SSE, stdio)
│   │   └── index.js    # Main entry point
│   └── package.json    # Node.js dependencies
├── .env.example        # Example environment variables
├── .gitignore          # Git ignore file
├── compose.yaml        # Docker Compose configuration
├── Dockerfile          # Docker build configuration
└── README.md           # This file

可用工具

服务器提供以下MCP工具:

  • 帖子: create_ghost_post, list_ghost_posts, update_ghost_post, delete_ghost_post
  • 页面: create_ghost_page, list_ghost_pages, update_ghost_page, delete_ghost_page
  • 标签: create_ghost_tag, update_ghost_tag

有关每个工具及其参数的详细信息,请参阅 everything/README.md 文件。

调试

要调试容器,您可以使用交互式shell运行它:

docker run -p 3064:3064 --env-file .env --rm -it --entrypoint bash oculair/ghost-mcp:1.0.0

使用Claude Desktop

添加到您的 claude_desktop_config.json:

{
  "mcpServers": {
    "ghost": {
      "url": "http://localhost:3064/sse",
      "disabled": false,
      "alwaysAllow": []
    }
  }
}```