postiz-mcp

postiz-mcp

MCP server for managing social media posts across multiple platforms using the Postiz API. Supports creating, updating, deleting posts, and generating videos.

Category
访问服务器

README

Postiz MCP Server & CLI

A Model Context Protocol (MCP) server and command-line interface for the Postiz social media scheduling API. Both entrypoints share the same tool definitions so that AI assistants and human operators can manage social media posts across multiple platforms with identical capabilities.

Features

  • Command-line interface: postiz binary with --help output designed for humans and LLMs
  • Get Channels: List available social media integrations
  • Upload Files: Upload images and media for posts
  • List Posts: Query posts with date range filtering
  • Create Posts: Create draft, scheduled, or immediate posts
  • Update Posts: Modify existing posts
  • Delete Posts: Remove posts
  • Generate Videos: AI video generation with slides or prompts (Beta)

Supported Platforms

Postiz supports posting to: X (Twitter), LinkedIn, LinkedIn Pages, Reddit, Instagram (Facebook Business), Instagram (Standalone), Facebook Pages, Threads, YouTube, TikTok, Pinterest, Dribbble, Discord, Slack, Mastodon, Bluesky, Lemmy, Warpcast, Telegram, Nostr, VK, Medium, Dev.to, Hashnode, and WordPress.

Installation

  1. Clone or download this repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    

Using the CLI

The CLI and the MCP server share the same environment variables (POSTIZ_API_KEY, POSTIZ_BASE_URL). Configure them once and they will work in both contexts.

Quick test without installation

npx tsx src/cli.ts --help

Install the postiz binary

npm run build
npm_config_prefix="$HOME/.npm-global" npm link   # Or just `npm link` if you have system permissions

Make sure $(npm config get prefix)/bin (e.g. ~/.npm-global/bin) is in your PATH, then run:

postiz --help
postiz posts --start-date 2024-10-01 --end-date 2024-10-07 --pretty

Hot reload during development

npm run dev:cli -- --help

The watcher re-runs the CLI with the same arguments every time you save a file under src/.

Configuration

Environment Variables

Set the variables in your shell profile (~/.zshrc, ~/.bash_profile, etc.) or create a .env file with the following values:

POSTIZ_API_KEY=your_postiz_api_key_here
POSTIZ_BASE_URL=https://api.postiz.com/public/v1  # Optional, defaults to hosted Postiz

Getting Your API Key

  1. Log into your Postiz account
  2. Go to Settings > API Keys
  3. Generate a new API key
  4. Copy the key to your .env file

Note: The Postiz API has a rate limit of 30 requests per hour.

Usage with Claude Desktop

Add this to your Claude Desktop configuration file:

Windows

%APPDATA%\Claude\claude_desktop_config.json

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "postiz": {
      "command": "node",
      "args": ["/path/to/postiz-mcp/build/index.js"],
      "env": {
        "POSTIZ_API_KEY": "your_postiz_api_key_here"
      }
    }
  }
}

Available Tools

All commands exposed by the MCP server are available in the CLI. Run postiz --help to see the full list and postiz <tool-name> --help to inspect the parameters (help text is generated automatically from the Zod schema).

postiz-get-channels (CLI: postiz channels)

Get list of available social media channels/integrations.

No parameters required

postiz-upload-file (CLI: postiz upload)

Upload a file for use in posts.

- filePath: string (required) - Path to the file to upload
- filename: string (optional) - Custom filename

postiz-list-posts (CLI: postiz posts)

List posts with date range filtering.

- startDate: string (required) - Start date in YYYY-MM-DD or ISO 8601 datetime (date-only expands to 00:00:00)
- endDate: string (required) - End date in YYYY-MM-DD or ISO 8601 datetime (date-only expands to 23:59:59.999)
- customer: string (optional) - Customer filter

postiz-create-post (CLI: postiz create)

Create a new post.

- content: string (required) - Post text content
- integrations: string[] (required) - Array of channel IDs
- status: 'draft' | 'scheduled' | 'now' (optional, default: 'draft')
- scheduledDate: string (optional) - ISO 8601 date for scheduling
- images: string[] (optional) - Array of image URLs/file IDs

postiz-update-post (CLI: postiz update)

Update an existing post. IMPORTANT: updates are not partial; include the full content again or it will be cleared.

- id: string (required) - Post ID to update
- content: string (optional) - Full content (send all text again, even if unchanged)
- integrations: string[] (optional) - New channel IDs
- status: 'draft' | 'scheduled' | 'now' (optional) - New status
- scheduledDate: string (optional) - New schedule date
- images: string[] (optional) - New images

postiz-delete-post (CLI: postiz delete)

Delete a post.

- id: string (required) - Post ID to delete

postiz-generate-video

Generate AI video (Beta feature).

- slides: object[] (optional) - Array of slide objects with image and text
- prompt: string (optional) - Text prompt for AI generation
- voice: string (optional) - Voice setting
- duration: number (optional) - Duration in seconds

Example Usage (CLI)

# Create an immediate post
postiz create \
  --content "Hello from my AI assistant! 🤖" \
  --integrations twitter_channel_id \
  --integrations linkedin_channel_id \
  --status now

# Schedule a post
postiz create \
  --content "Scheduled post content" \
  --integrations twitter_channel_id \
  --status scheduled \
  --scheduled-date "2024-01-15T10:00:00+01:00"

# Upload an image and reuse it
postiz upload --file-path /path/to/image.jpg --pretty
# Use the returned URL in the --images array when calling `postiz create`

Development

Build

npm run build

Development Mode

# Rebuilds and restarts the MCP server in watch mode
npm run dev

# Iterate on the CLI without rebuilding the output in build/
npm run dev:cli -- --help

Format Code

npm run format

API Rate Limits

Postiz API has a rate limit of 30 requests per hour. The MCP server will handle rate limit errors gracefully and return appropriate error messages.

Self-Hosted Postiz

If you're using a self-hosted Postiz instance, set the POSTIZ_BASE_URL environment variable:

POSTIZ_BASE_URL=https://your-postiz-instance.com/public/v1

Error Handling

All tools return structured JSON responses with:

  • success: boolean indicating if the operation succeeded
  • error: error message if operation failed
  • statusCode: HTTP status code for API errors
  • Data fields specific to each operation

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选