Skip to main content
Glama

postiz-mcp

用于任何兼容 MCP 客户端的规范 Postiz 客户端。全面覆盖 Postiz 公共 API(集成、帖子、上传、分析、视频),具备环境变量控制的写入功能、需确认的删除操作以及内置的速率限制防护。

既可作为 stdio MCP 服务器发布,也可作为同一包中的原生 OpenClaw 插件使用。

为什么使用它

如果您自托管了 Postiz,并希望 Claude / Codex / OpenClaw / Hermes / 任何 MCP 客户端与其交互,此工具为您提供了一个类型化、经过测试的单一用途工具界面,无需在每个工作流中手动编写 HTTP 调用。

Related MCP server: Postoria MCP Server

连接前的警告

  • Postiz 的写入操作具有公开的副作用。 执行 postiz_create_post 并设置 type: "now"(或近期排程)会发布到真实的社交账号上。一旦发布,虽然可以在 Postiz 中删除帖子,但平台端的帖子依然存在——Postiz 无法撤回它。

  • Postiz 公共 API 默认限制为每小时 30 次请求。 此服务器会在本地跟踪限制,并在预算耗尽时拒绝发送请求。如果您的 Postiz 实例配置了更高的限制,请通过 POSTIZ_RATE_LIMIT_PER_HOUR 进行覆盖。

  • 写入和删除操作默认关闭。 读取功能始终可用。要启用写入,必须显式设置 POSTIZ_ENABLE_WRITE=true。要启用删除,必须额外设置 POSTIZ_ENABLE_DELETE=true 并在工具调用中传递 confirm: true。

工具

读取(始终开启)

  • postiz_list_integrations — 列出已连接的频道

  • postiz_check_integration — 验证 API 密钥

  • postiz_find_next_slot — 查找频道的下一个空闲发布时段

  • postiz_list_posts — 获取指定日期范围内的帖子

  • postiz_get_missing_content — 为缺少 releaseId 的 Postiz 帖子恢复平台内容

  • postiz_list_notifications — Postiz UI 通知

  • postiz_get_platform_analytics — 粉丝数 / 展示量 / 互动率

  • postiz_get_post_analytics — 点赞 / 评论 / 分享

  • postiz_list_voices — AI 视频语音目录

  • postiz_get_provider_settings_schema — 构建时打包的各提供商 settings 架构(X、LinkedIn、Reddit 等)

写入(需要 POSTIZ_ENABLE_WRITE=true)

  • postiz_create_post — 排程 / 立即发布 / 草稿

  • postiz_connect_integration — 为新频道生成 OAuth URL

  • postiz_update_post_status — 切换 草稿 ↔ 队列

  • postiz_update_post_release_id — 将 Postiz 帖子重新关联到其平台端发布 ID

  • postiz_upload_file — 从本地文件或 base64 进行多部分上传

  • postiz_upload_from_url — 服务器端获取

  • postiz_generate_video — AI 视频生成

删除(需要 POSTIZ_ENABLE_WRITE=true + POSTIZ_ENABLE_DELETE=true + confirm: true)

  • postiz_delete_post — 级联删除整个组

  • postiz_delete_post_group — 删除跨平台发布组中的所有帖子

  • postiz_delete_integration — 断开频道连接 + 删除其所有已排程的帖子

安装

npm install -g postiz-mcp

或从源码安装:

git clone https://github.com/solomonneas/postiz-mcp.git
cd postiz-mcp
npm install
npm run build

配置

在您的 MCP 客户端配置中设置以下环境变量:

变量

必需

默认值

描述

POSTIZ_URL

是

—

基础 URL,例如 http://localhost:5000 或 https://postiz.example.com

POSTIZ_API_KEY

是

—

从 Postiz 设置 → 公共 API 获取的 API 密钥

POSTIZ_ENABLE_WRITE

否

false

设置为 true 以启用创建 / 更新 / 上传 / 连接 / 生成视频工具

POSTIZ_ENABLE_DELETE

否

false

设置为 true(需同时开启写入)以启用删除工具

POSTIZ_REQUEST_TIMEOUT_MS

否

30000

HTTP 超时时间 (ms)

POSTIZ_RATE_LIMIT_PER_HOUR

否

30

本地防护上限。服务器在存在响应头时仍会信任响应头。

POSTIZ_CF_ACCESS_CLIENT_ID

否

—

Cloudflare Access 服务令牌客户端 ID(仅在 Postiz 位于 CF Access 后方时需要)

POSTIZ_CF_ACCESS_CLIENT_SECRET

否

—

Cloudflare Access 服务令牌密钥

获取 API 密钥

  1. 以管理员身份登录 Postiz

  2. 设置 → 公共 API → 生成 API 密钥

  3. 复制该值(根据您的 Postiz 版本,以 pos_ 开头或为原始 UUID)

Claude Desktop

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) 或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "postiz": {
      "command": "postiz-mcp",
      "env": {
        "POSTIZ_URL": "http://localhost:5000",
        "POSTIZ_API_KEY": "your-api-key-here",
        "POSTIZ_ENABLE_WRITE": "true",
        "POSTIZ_ENABLE_DELETE": "false"
      }
    }
  }
}

Claude Code

claude mcp add postiz \
  --env POSTIZ_URL=http://localhost:5000 \
  --env POSTIZ_API_KEY=your-api-key-here \
  --env POSTIZ_ENABLE_WRITE=true \
  -- postiz-mcp

添加 --scope user 以使其在任何目录中可用,而不仅仅是当前项目。

OpenClaw

postiz-mcp 也是一个 OpenClaw 原生插件。从源码检出:

openclaw plugin add /absolute/path/to/postiz-mcp \
  --config '{
    "baseUrl": "http://localhost:5000",
    "apiKeyEnv": "POSTIZ_API_KEY",
    "enableWrite": true,
    "enableDelete": false
  }'

然后导出 API 密钥并重启网关:

export POSTIZ_API_KEY=your-api-key-here
systemctl --user restart openclaw-gateway
openclaw plugin list   # confirm "postiz" is enabled

您也可以在 OpenClaw 下将其作为常规 MCP 服务器运行:

openclaw mcp set postiz '{
  "command": "postiz-mcp",
  "env": {
    "POSTIZ_URL": "http://localhost:5000",
    "POSTIZ_API_KEY": "your-api-key-here",
    "POSTIZ_ENABLE_WRITE": "true"
  }
}'

Hermes Agent

Hermes Agent 从 ~/.hermes/config.yaml 中的 mcp_servers 读取 MCP 配置。添加条目:

mcp_servers:
  postiz:
    command: "postiz-mcp"
    env:
      POSTIZ_URL: "http://localhost:5000"
      POSTIZ_API_KEY: "your-api-key-here"
      POSTIZ_ENABLE_WRITE: "true"

或从源码检出:

mcp_servers:
  postiz:
    command: "node"
    args: ["/absolute/path/to/postiz-mcp/dist/mcp-server.js"]
    env:
      POSTIZ_URL: "http://localhost:5000"
      POSTIZ_API_KEY: "your-api-key-here"
      POSTIZ_ENABLE_WRITE: "true"

然后在 Hermes 会话中重新加载 MCP:

/reload-mcp

Codex CLI

Codex CLI 通过 codex mcp add 注册 MCP 服务器:

codex mcp add postiz \
  --env POSTIZ_URL=http://localhost:5000 \
  --env POSTIZ_API_KEY=your-api-key-here \
  --env POSTIZ_ENABLE_WRITE=true \
  -- postiz-mcp

或从源码检出:

codex mcp add postiz \
  --env POSTIZ_URL=http://localhost:5000 \
  --env POSTIZ_API_KEY=your-api-key-here \
  --env POSTIZ_ENABLE_WRITE=true \
  -- node /absolute/path/to/postiz-mcp/dist/mcp-server.js

Codex 将条目写入 ~/.codex/config.toml 中的 [mcp_servers.postiz]。使用以下命令验证:

codex mcp list

Postiz 位于 Cloudflare Access 后方

如果您的 Postiz 通过 Cloudflare Tunnel + Access 暴露(例如 https://postiz.example.com),请在 Cloudflare Zero Trust 仪表板中生成服务令牌并添加环境变量:

export POSTIZ_CF_ACCESS_CLIENT_ID=your-cf-id.access
export POSTIZ_CF_ACCESS_CLIENT_SECRET=your-cf-secret

MCP 服务器会在每次请求时将其作为 CF-Access-Client-Id / CF-Access-Client-Secret 转发。如果您忘记了它们,您将收到明确的 PostizCfAccessChallengeError,而不是令人困惑的 HTML 响应。

示例提示词

  • “列出我的 Postiz 上的集成。”

  • “为明天上午 9 点排程一条 Bluesky 帖子:'Just shipped postiz-mcp。'”

  • “LinkedIn 的下一个可用时段是什么?将这 4 条推文的线程排程到那个时间,并设置回复仅限已验证用户。”

  • “上周发布了什么?周二的 X 帖子表现如何?”

  • “向我展示 X 提供商的设置架构,以便我可以构建线程负载。”

提供商设置架构

postiz_get_provider_settings_schema 返回打包的各提供商 settings 参考(解析自 docs.postiz.com/public-api/providers/{slug}.md)。当您需要特定于提供商的字段(如 X 的 who_can_reply_post 或 LinkedIn 的 audience)时,请在 postiz_create_post 之前使用它。

这些架构由 GitHub Actions 工作流每月刷新一次,如果 Postiz 更新了任何提供商文档,它会自动打开一个 PR。手动刷新:

npm run refresh-schemas

开发

npm install
npm run typecheck
npm test
npm run build

许可证

MIT

Available Tools

20 tools
postiz_check_integrationA

Verify the configured Postiz API key is valid and reaches the configured baseUrl. Useful as a first call before any other tool — if this returns ok, every other tool can authenticate against the same instance.

Inputs: no named parameters.

postiz_connect_integrationA

Generate the OAuth authorization URL for connecting a new social channel. Returns a url the user must open in a browser to finish the flow — Postiz redirects back to its own callback. This tool does NOT run a callback server. Requires enableWrite.

Inputs: provider (required), refresh.

postiz_create_postA

Create, schedule, or immediately publish one or more posts via POST /api/posts. PUBLIC SIDE EFFECT: with type='now' or a near-term schedule, this lands on real social accounts. Use postiz_get_provider_settings_schema first to construct valid settings blocks. Requires enableWrite.

Inputs: type (required), date (required), posts (required), shortLink, +1 more.

postiz_delete_integrationA

Disconnect a connected social channel. Cascades — Postiz also deletes every scheduled post for that integration. Requires enableWrite + enableDelete + confirm=true. Returns ok:false / not_found on 404 (already disconnected).

Inputs: integrationId (required), confirm (required).

postiz_delete_postA

Delete a Postiz post by id. CASCADES — every post in the same group is removed. Already-published platform posts remain live. Requires enableWrite + enableDelete + confirm=true.

Inputs: postId (required), confirm (required).

postiz_delete_post_groupA

Delete every post in a group (cross-post unit) via DELETE /api/posts/group/{group}. Use when you want to retract a whole cross-post in one call. Requires enableWrite + enableDelete + confirm=true.

Inputs: group (required), confirm (required).

postiz_find_next_slotA

Return the next available posting time for a given integration. The slot respects the org's configured posting schedule, so this is the right answer to use as date in postiz_create_post when you don't have a specific time in mind.

Inputs: integrationId (required).

postiz_generate_videoA

Generate an AI video via POST /api/video/generate. COST IMPLICATION: video generation may bill against the configured Postiz video integration's credit pool. Requires enableWrite. Body shape is provider-specific — see Postiz video docs.

Inputs: body (required).

postiz_get_missing_contentA

Fetch recent platform-side content for a post whose Postiz releaseId is marked missing. Pair with postiz_update_post_release_id to reattach.

Inputs: postId (required).

postiz_get_platform_analyticsA

Get follower / impression / engagement analytics for a connected channel via GET /api/analytics/platform. Available metrics depend on what the platform exposes to Postiz.

Inputs: integrationId (required), date.

postiz_get_post_analyticsA

Get per-post engagement metrics (likes, comments, shares) via GET /api/analytics/post. Returns whatever the source platform exposes — different shape per provider.

Inputs: postId (required).

postiz_get_provider_settings_schemaA

Look up the settings block schema for a Postiz provider (X, LinkedIn, Reddit, etc.) — bundled at build time from docs.postiz.com. Returns a default-settings template, the provider's __type value, and (by default) the full markdown reference. Call this before postiz_create_post when you need provider-specific fields.

Inputs: provider (required), includeMarkdown.

postiz_list_integrationsA

List every connected social-media channel for the org behind the configured Postiz API key. Returns id, name, providerIdentifier (the value used as __type in post settings), profile, and disabled state. Use this BEFORE postiz_create_post to get the integration id you need to target.

Inputs: no named parameters.

postiz_list_notificationsA

List notifications, sorted most-recent first. Useful for surfacing posting failures, OAuth re-auth prompts, and new-feature notices Postiz shows in its UI.

Inputs: page.

postiz_list_postsA

List posts in a date range via GET /api/posts. Returns scheduled, queued, and published posts with their integration, content, state, and any platform release URL.

Inputs: startDate, endDate, display, customer.

postiz_list_voicesA

List available AI voices for video generation via GET /api/video/function?functionName=voices. Required input for postiz_generate_video — pick a voice id from the returned catalog.

Inputs: integrationId.

postiz_update_post_release_idA

Update the releaseId (and optionally releaseURL) of a Postiz post via PATCH /api/posts/{id}/release-id. Use to reconcile a Postiz post with the actual platform-side release after a missing-content event. Requires enableWrite.

Inputs: postId (required), releaseId (required), releaseURL.

postiz_update_post_statusA

Transition a Postiz post between DRAFT and QUEUE via PATCH /api/posts/{id}/status. Moving DRAFT→QUEUE re-enters the schedule using the post's existing publishDate. Requires enableWrite.

Inputs: postId (required), state (required).

postiz_upload_fileA

Upload a media file (image, video) to Postiz storage via POST /api/uploads/file. Returns { id, path } that you can pass into postiz_create_post value[].image[]. Requires enableWrite.

Inputs: filePath, base64, fileName, mimeType.

postiz_upload_from_urlA

Upload a media file from a public URL via POST /api/uploads/url. Postiz fetches the URL server-side, so this works for sources the MCP host can't reach. Returns { id, path } usable in postiz_create_post value[].image[]. Requires enableWrite.

Inputs: url (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool targets a unique action and resource type. For example, postiz_create_post, postiz_delete_post, and postiz_list_posts are clearly distinct. Even overlapping actions like postiz_delete_post and postiz_delete_post_group are differentiated by scope (single vs. group). Descriptions clarify boundaries effectively.

    Naming Consistency5/5

    All tools follow a consistent 'postiz_verb_noun' pattern with underscore separation. Verbs like check, connect, create, delete, find, generate, get, list, update, and upload are used uniformly. There is no mixing of camelCase or other conventions.

    Tool Count4/5

    With 20 tools, the set is slightly above the typical 'well-scoped' range (3-15) but still reasonable given the breadth of Postiz's functionality (post management, analytics, AI video, integrations, file uploads). Each tool serves a distinct purpose.

    Completeness4/5

    The tools cover the main lifecycle: integration management, post CRUD, analytics, file uploads, and AI video generation. Minor gaps include no direct 'get post by ID' (though list_posts can retrieve it) and no interaction management (comments, etc.), but core workflows are well-supported.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with the Postiz social media management platform through MCP tools. Supports creating and managing posts, retrieving integrations, and accessing account information through multiple transport protocols.
      2
      -
    • A
      license
      Not graded
      quality
      F
      maintenance
      MCP server for managing social media posts across multiple platforms using the Postiz API. Supports creating, updating, deleting posts, and generating videos.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables managing social media posts, accounts, and AI-powered content features from any MCP client, including scheduling, publishing, analysis, and AI caption generation.
      14
      68 npm
      MIT