Claude Code Plugin for multi-platform content publishing via MCP.
Supports 22 platforms: 知乎 · 掘金 · CSDN · 小红书 · 微信公众号 · 微博 · V2EX · SegmentFault · OSCHINA · 博客园 · X/Twitter · Medium · Hashnode · Dev.to · Reddit · LinkedIn · Product Hunt · Hacker News · MoltBook + AI Directories (TAAFT · Futurepedia · Toolify)
# Clone to Claude Code plugins directory
git clone https://github.com/ava-agent/promotion-agent ~/.claude/plugins/promotion-agent
# Install Python dependencies
cd ~/.claude/plugins/promotion-agent
pip install -e .Restart Claude Code after installation. The plugin loads automatically via plugin.json.
cd ~/.claude/plugins/promotion-agent
cp .env.example .env
# Fill in your platform credentials (see guides below)| Platform | Auth Type | Method | Stability |
|---|---|---|---|
| 知乎 | Cookie | API | Stable |
| 掘金 | Cookie | API (draft + manual publish fallback) | Good |
| CSDN | Cookie | API (WAF may block, manual fallback) | Limited |
| 小红书 | QR Login | External MCP proxy | Stable |
| 微信公众号 | AppID/Secret | External MCP proxy | Stable |
| 微博 | OAuth 2.0 | API | Stable |
| V2EX | Token | API | Stable |
| SegmentFault | Cookie | API | Stable |
| OSCHINA | Cookie | API | Stable |
| 博客园 | API Token | MetaWeblog XML-RPC | Stable |
| X/Twitter | OAuth 1.0a | API (tweepy) | Stable |
| Medium | Integration Token | REST API v1 | Stable |
| Hashnode | PAT | GraphQL | Stable |
| Dev.to | API Key | REST API | Stable |
| OAuth 2.0 | API (praw) | Stable | |
| OAuth 2.0 | REST API | Stable | |
| Product Hunt | Bearer Token | GraphQL | Stable |
| Hacker News | Username/Password | Web form scraping | Fragile |
| MoltBook | API Key | API | Stable |
| TAAFT | None | Form submission | Best-effort |
| Futurepedia | None | Form submission | Best-effort |
| Toolify | None | Form submission | Best-effort |
These platforms use browser Cookie authentication.
Auto-extract (recommended):
# Ensure you're logged in to the platform in Chrome
python3 get_cookies.pyManual extract:
- Log in to the platform in your browser
- F12 → Network tab → refresh → click any request
- Copy the
Cookieheader value
PROMOTE_ZHIHU_COOKIE=_xsrf=xxx; z_c0=xxx; ...
PROMOTE_JUEJIN_COOKIE=sessionid=xxx; ...
PROMOTE_CSDN_COOKIE=UserName=xxx; uuid=xxx; ...
PROMOTE_SEGMENTFAULT_COOKIE=...
PROMOTE_OSCHINA_COOKIE=...Cookies expire every 1-3 months. Re-extract when auth errors occur.
- Visit developer.x.com, create Project + App
- Enable OAuth 1.0a with Read and Write permissions
- Generate Access Token & Secret
PROMOTE_X_CONSUMER_KEY=your_consumer_key
PROMOTE_X_CONSUMER_SECRET=your_consumer_secret
PROMOTE_X_ACCESS_TOKEN=your_access_token
PROMOTE_X_ACCESS_TOKEN_SECRET=your_access_token_secret- Visit medium.com/me/settings/security
- Generate an Integration Token
PROMOTE_MEDIUM_INTEGRATION_TOKEN=your_token- Visit hashnode.com/settings/developer
- Generate a Personal Access Token
PROMOTE_HASHNODE_TOKEN=your_token
PROMOTE_HASHNODE_PUBLICATION_ID=your_pub_id # Optional, auto-discovered if omitted- Visit dev.to/settings/extensions
- Generate a DEV Community API Key
PROMOTE_DEVTO_API_KEY=your_api_key- Visit linkedin.com/developers, create an App
- Request Share on LinkedIn permission
- Obtain an OAuth 2.0 Access Token (scope:
w_member_social)
PROMOTE_LINKEDIN_ACCESS_TOKEN=your_access_tokenToken expires in 60 days. Re-obtain when expired.
- Visit Product Hunt API Dashboard
- Create application, get API Token
PROMOTE_PRODUCTHUNT_TOKEN=your_token- Visit reddit.com/prefs/apps
- Create a script type app (redirect:
http://localhost:8080)
PROMOTE_REDDIT_CLIENT_ID=your_client_id
PROMOTE_REDDIT_CLIENT_SECRET=your_client_secret
PROMOTE_REDDIT_USERNAME=your_username
PROMOTE_REDDIT_PASSWORD=your_password- Visit cnblogs.com settings
- Enable MetaWeblog access and generate API Token
PROMOTE_CNBLOGS_BLOG_URL=https://www.cnblogs.com/your-blog-name
PROMOTE_CNBLOGS_USERNAME=your_username
PROMOTE_CNBLOGS_TOKEN=your_api_tokenPROMOTE_HN_USERNAME=your_username
PROMOTE_HN_PASSWORD=your_passwordUses web form scraping (no official API). May break if HN changes its HTML.
PROMOTE_MOLTBOOK_API_KEY=your_api_keyRequires a Weibo Open Platform app (needs approval).
PROMOTE_WEIBO_ACCESS_TOKEN=your_access_tokenToken expires in ~30 days.
- Visit v2ex.com/settings/tokens
- Generate a Personal Access Token
PROMOTE_V2EX_TOKEN=your_tokenPROMOTE_WECHAT_APP_ID=your_app_id
PROMOTE_WECHAT_APP_SECRET=your_app_secretAuth managed by external MCP proxy. Use auth_qr_login tool to scan QR code.
No authentication required. Submissions are HTTP form posts.
This project is a Claude Code Plugin embedding an MCP Server.
| Layer | Component | Purpose |
|---|---|---|
| Interaction | Skills (/publish) |
Guide user through publish flow: select platforms, preview, confirm, publish |
| Automation | Agents (publisher) |
Read content files, split by platform, batch publish, report results |
| Security | Hooks (auth-check) |
PreToolUse intercept on all publish* calls — validate auth before publishing |
| Execution | MCP Server (server.py) |
12 tools, launched as subprocess via plugin.json |
| Platform | Platform classes | Each platform implements adapt_content() + post() + health_check() |
| Tool | Description | Key Parameters |
|---|---|---|
publish_zhihu |
Publish to Zhihu column | title, body, column?, topics?, dry_run? |
publish_x |
Tweet or thread on X | text, thread?, url?, hashtags?, dry_run? |
publish_xiaohongshu |
Post to Xiaohongshu | title, body, images?, tags?, dry_run? |
publish_wechat |
Publish to WeChat | title, body, cover_image?, digest?, dry_run? |
publish |
Generic — any of 18 platforms | platform, title, body, tags?, url?, metadata?, dry_run? |
submit_directory |
Submit to AI directory | directory, name, url, description, category?, pricing?, dry_run? |
All publish tools support
dry_run: truefor preview without posting.
| Tool | Description |
|---|---|
auth_status |
Show auth status for all platforms |
auth_set_cookie |
Save a cookie to .env (platform, cookie) |
auth_qr_login |
QR code login for Xiaohongshu |
auth_health_check |
Verify credentials are valid (platform) |
| Tool | Description |
|---|---|
list_platforms |
List all platforms with auth status |
preview_content |
Preview content adaptation per platform (title, body, platforms?) |
> Publish this article to Zhihu
> Post README.md to Dev.to and Medium
> Share this to all configured platforms
> /publish
Guides you through: identify content, select platforms, check auth, preview, confirm, publish.
For *-社媒版.md files, auto-splits by ## headings into per-platform content.
> Batch publish this to all platforms
Autonomous agent: reads content, checks auth, previews all, waits for confirmation, publishes sequentially, reports summary table.
ls ~/.claude/plugins/promotion-agent/plugin.json # Must exist
# Restart Claude Codecd ~/.claude/plugins/promotion-agent
pip install -e .
python server.py # Should start and wait for stdio inputCookies expire every 1-3 months. Re-extract:
python3 get_cookies.pyJuejin's publish API may reject requests. The system creates a draft — visit juejin.cn/editor/drafts to publish manually.
CSDN's WAF may block API calls. Use the CSDN web editor to publish manually when this occurs.
If publish calls are blocked, run auth_status to see what's missing, then configure the required credentials.
