social-publisher
Publishes Reels to the user's own Instagram account through the official Graph API: the video is exposed via a temporary S3-compatible bucket URL, the media container is created and polled until ready, the is_ai_generated flag is always set, and the post is published only after approval; also fetches Reels insights (24-48h metrics) and supports scheduled posting via the scheduler worker.
Uploads videos to the user's TikTok inbox as drafts via the official inbox sharing API (chunked upload), respecting a cap of pending inbox shares; since the inbox API cannot send captions or the AI flag, it hands back the approved caption to paste and a reminder to enable the AI-generated label and finish posting in the app. Supports scheduling through the worker.
Uploads finished, approved videos to the user's own YouTube channel via the official YouTube Data API with chunked uploads, always sets the containsSyntheticMedia AI-content flag, schedules natively with publishAt, and fetches 24-48h video metrics to feed the recommendation bandit.
social-publisher
An MCP server that posts finished videos to your own YouTube, Instagram and TikTok accounts, and only after you approve them.
Part of Manez, a set of tools for running AI agents under rules.
What and why
I generate story videos with AI and wanted an agent to handle the posting without being able to post anything I hadn't seen. social-publisher uses the official platform APIs only. Approval locks the exact video file and caption by hash, so the agent can't swap content after the fact. Daily caps, spacing between posts and quiet hours are enforced in code, an AI-content flag is always on, and every publish starts as a dry run.
Related MCP server: AdaptlyPost
Headline results
72 tests pass in about 1 minute 49 seconds (Windows 11, Python 3.11.9). They use fake platforms and an in-memory keyring, so nothing is posted. You need
ffmpegon PATH.No performance numbers exist for this repo beyond the test run. Nothing here shows that the bandit's suggestions improve views.
Features
Tools for an MCP client:
list_accounts,prepare_post,approve_post,publish_post,schedule_post,cancel_post,get_post_status,fetch_stats,recommend_next,quota_status.An approval gate.
approve_postasks you through an MCP elicitation prompt, and fails closed if the client doesn't support elicitation. You can also approve from a terminal.A hash lock over the file and the caption. If either changes after approval, the post needs approving again.
Caps per platform, minimum gaps between go-live times and quiet hours (default 00:00 to 07:00 local time). The code clamps the daily cap to each platform's ceiling: YouTube 100, Instagram 50, TikTok 5 pending inbox shares.
AI-content flags always on. YouTube gets
containsSyntheticMedia, Instagram getsis_ai_generated, and metadata that saysai_generated: falseis overridden with a warning.Dry run by default on
publish_post.A state machine around each platform call. If a platform may have acted when something failed, the post goes to
needs_checkand you resolve it by hand.A small bandit (discounted Beta-Bernoulli) that suggests the next hook, length, topic and time slot from 24 to 48 hour metrics.
A scheduler worker for scheduled Instagram and TikTok posts. YouTube schedules natively with
publishAt.OAuth tokens and app credentials are stored only in the OS keyring.
Quick start
Python 3.11 or newer and ffmpeg (with ffprobe) on PATH. Only Windows was tested.
python -m venv .venv
.venv\Scripts\python -m pip install -r requirements.txt
.venv\Scripts\python -m pytest -qRegister a developer app on each platform you want. The repo ships no client IDs, and each platform's developer terms apply to you. Then store credentials and sign in:
.venv\Scripts\python -m social_publisher secret set GOOGLE_CLIENT_SECRETS
.venv\Scripts\python -m social_publisher auth youtube
.venv\Scripts\python -m social_publisher secret checkThe same pattern works for instagram (IG_APP_ID, IG_APP_SECRET) and tiktok (TIKTOK_CLIENT_KEY, TIKTOK_CLIENT_SECRET). auth instagram --paste stores a long-lived token you generated in the Meta App Dashboard. Instagram also needs a temporary public bucket for the video (see Configuration), with R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY stored the same way.
Register the server with Claude Code, or with mcp-hub as a stdio backend:
claude mcp add social-publisher -- <venv python> <repo>/serve.pyRun the scheduler worker if you schedule Instagram or TikTok posts:
.venv\Scripts\python -m social_publisher workerCLI commands: serve, worker, auth, secret set|check, approve POST_ID, resolve POST_ID posted [ID], resolve POST_ID not-posted, list.
How it works
A video carries a metadata JSON next to it (samples/sample_story.json shows the format): title, description, tags, per-platform captions, the AI flag, asset licences and a decision log. prepare_post reads it, checks the file with ffprobe and queues the post. approve_post shows you the exact file, caption and account and records your yes. publish_post shows a dry run by default, and a call with dry_run=false posts for real. It re-checks both hashes first, and calling it twice never posts twice.
Path | What it is |
| The FastMCP tools |
| Queueing, the hash lock, caps, spacing, quiet hours, the approval text |
| The post state machine, including |
| Platform clients |
| Loopback OAuth sign-in and keyring storage |
| Temporary S3-compatible bucket for Instagram's |
| The suggestion bandits |
| APScheduler process for scheduled posts |
| ffprobe checks, SQLite queue, retries, settings |
| Entry point for clients that start servers by file path |
Configuration
config.toml holds no secrets. It sets quiet_hours, the [caps.<platform>] tables (daily, min_gap_hours), the YouTube category and chunk size, Instagram's Graph version and polling, the TikTok chunk size, the [bucket] for Instagram's temporary upload (any S3-compatible store: Cloudflare R2, S3, B2) and the [bandit] arms. SOCIAL_PUBLISHER_STATE moves the state folder (the SQLite queue) and SOCIAL_PUBLISHER_CONFIG points at another config file.
Limits and known gaps
Official APIs only, for your own accounts. There is no scraping and no multi-account tooling.
TikTok goes through the inbox route. The video lands in your TikTok inbox as a draft, and you finish it in the app: add the caption, switch on the AI-generated label and tap Post. The inbox API can't send the caption or the AI flag, so the tool hands back the caption to paste and a reminder.
Instagram needs a public URL for the video, which is why the temporary bucket exists.
The Instagram Reels insight metric names in
config.tomlwere not confirmed against the platform docs. If the API rejects one, the error lists the valid names.Only Windows was tested. The credential wording and the sign-in flow assume Windows Credential Manager.
The tests use fake platforms, so they don't cover live posting. Dry-run first on your own accounts.
Platform rules change. Check each platform's current developer terms before you rely on the caps.
Licence
MIT, Armaan Francisco Shivpuri. Dependencies: fastmcp (Apache-2.0), httpx (BSD-3), google-api-python-client, google-auth-oauthlib and google-auth-httplib2 (Apache-2.0), keyring (MIT), APScheduler (MIT), boto3 (Apache-2.0). Tests use pytest (MIT), pytest-asyncio (Apache-2.0) and respx (BSD-3). ffmpeg is a system tool and is not bundled.
Part of Manez
This is the publishing step of Manez. The other parts are mcp-hub, grounded-kb and limit-aware-launcher.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Schedule and publish posts and short videos to every major social platform from any AI agent.
Publish approved videos and posts to TikTok, YouTube Shorts, Instagram, X, LinkedIn and Hashnode.
Schedule and publish social media posts to Instagram, Facebook, X, YouTube and more from AI agents
Let your AI agent publish to your own YouTube, Instagram, X, LinkedIn and more, with a preview.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables publishing content to multiple social media platforms (YouTube, Twitter, Facebook, Instagram, TikTok, Reddit, Blog) through automation agents, with task management and system validation.4MIT

AdaptlyPostofficial
AlicenseAqualityBmaintenanceGives AI agents the ability to schedule and publish social media posts to Instagram, TikTok, YouTube, X, LinkedIn, Facebook, Pinterest, Threads, and Bluesky. Create, schedule, and bulk-plan posts with per-platform captions, then check per-platform results and retry failures.91MIT- AlicenseNot gradedqualityCmaintenanceEnables AI agents to publish videos to Douyin, WeChat Channels, and Xiaohongshu with isolated account sessions, preflight checks, duplicate protection, and post-publish verification. Also offers task management and an optional comment assistant for handling first-level comments on the user's own Douyin videos.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to publish text, images, and video to LinkedIn and queue posts for X that a Chrome extension fills into the composer for review and posting. Facebook Pages and Instagram are supported once Meta approval is granted.613 npmMIT