Skip to main content
Glama

blogger-mcp

基于 Google Blogger API v3 的自定义 MCP 服务器。它为 Claude Code / Claude Desktop 等 MCP 主机提供了查询/编写/修改/删除 Blogger 博客文章的工具。

主要功能 (MCP Tools)

工具

说明

list_blogs

已认证用户的博客列表

get_blog_by_url

博客 URL → 查询 Blog ID

list_posts

博客文章列表(支持 status 过滤)

get_post

查询特定文章

create_post

编写新文章(通过 isDraft=true 暂存)

update_post

修改文章(标题/内容/标签)

delete_post

永久删除文章

publish_post

发布暂存的文章

revert_post

将已发布的文章撤回为暂存状态

架构

Claude Code ──stdio──► blogger-mcp (Node)
                          │
                          ├─ src/index.ts     : MCP server (tools 등록/디스패치)
                          ├─ src/auth.ts      : OAuth 2.0 토큰 로드/저장/갱신
                          └─ src/auth-cli.ts  : 최초 1회 대화형 인증용 CLI
                          │
                          ▼
                  Google Blogger API v3
  • 认证: OAuth 2.0 (桌面应用)。首次通过 npm run auth 启动本地回调服务器获取令牌,并保存至 ~/.config/blogger-mcp/token.json。后续通过 refresh token 自动更新。

  • Scopes: https://www.googleapis.com/auth/blogger

  • 传输: stdio (由 MCP 主机作为子进程启动)

快速开始

1. 安装与构建

git clone https://github.com/mech12/blogger-mcp.git
cd blogger-mcp
npm install
npm run build

2. 准备 OAuth 客户端

Google Cloud Console 中启用 Blogger API v3,创建桌面应用类型的 OAuth 客户端,并下载 client_secret.json

mkdir -p ~/.config/blogger-mcp
cp /path/to/client_secret.json ~/.config/blogger-mcp/client_secret.json

详细的 Google Cloud 设置请参考下方的 Blogger API v3 认证发放

3. 首次认证

npm run auth

在浏览器中打开显示的 URL 并授权后,将生成 ~/.config/blogger-mcp/token.json

4. 注册到 Claude Code

claude mcp add blogger --scope user -- node /absolute/path/to/blogger-mcp/dist/index.js

或者直接在 ~/.claude.json 中配置:

{
  "mcpServers": {
    "blogger": {
      "command": "node",
      "args": ["/absolute/path/to/blogger-mcp/dist/index.js"]
    }
  }
}

环境变量

变量

默认值

说明

BLOGGER_MCP_CRED_DIR

~/.config/blogger-mcp

凭据目录

BLOGGER_MCP_CLIENT_SECRET

$CRED_DIR/client_secret.json

OAuth 客户端 JSON 路径

Blogger API v3 认证发放 (摘要)

  1. 创建 Google Cloud 项目https://console.cloud.google.com/

  2. API 库中启用 Blogger API v3

  3. 配置 OAuth 同意屏幕

    • 用户类型: 外部 (External)

    • 添加范围: https://www.googleapis.com/auth/blogger

    • 将您的 Google 账号添加为测试用户

  4. 凭据 → OAuth 客户端 ID

    • 应用类型: 桌面应用

    • 创建后下载 JSON → ~/.config/blogger-mcp/client_secret.json

  5. 确认 Blog ID

    • 通过 Blogger 管理后台 URL 中的 blogID=... 数字或使用 get_blog_by_url 工具查询

项目特定的详细指南由宿主项目的 docs/vibe/mcp/blogger-mcp.md 管理。

实现计划 (Design Notes)

  • 技术栈: TypeScript + Node 18+, @modelcontextprotocol/sdk, googleapis, google-auth-library

  • 令牌存储位置: ~/.config/blogger-mcp/。受 .gitignore 保护。

  • 错误策略: 工具调用失败由 MCP 自动包装错误。缺少认证时提示 No stored token. Run npm run auth first.

  • 扩展路线图:

    • Markdown → HTML 转换工具 (基于 marked)

    • 图片上传 (Blogger 需要绕过 Picasa/Google Photos → 后续选项)

    • 文章定时发布 (设置 published 字段)

开发

npm run dev       # tsc --watch
npm run build     # dist/ 생성
npm start         # dist/index.js 실행 (MCP stdio 서버)
npm run auth      # OAuth 최초 인증

许可证

MIT

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - A tier

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mech12/blogger-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server