Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Tiktok Viral Factory

FreeNot checked

Enables automated generation and publishing of TikTok Shop Affiliate videos using 7 AI agents. Integrates research, script writing, video production, and publis

GitHubEmbed

About

Enables automated generation and publishing of TikTok Shop Affiliate videos using 7 AI agents. Integrates research, script writing, video production, and publishing through the MCP protocol.

README

TikTok Viral Factory

TikTok Viral Factory

Multi-Agent AI System that generates, produces, and publishes TikTok Shop Affiliate videos — fully automated.
7 AI Agents · LangGraph · Kling AI · ElevenLabs · MCP Protocol

Stars Forks License Python LangGraph

Quick Start Architecture Full Plan


What is this?

A fully autonomous AI workforce that runs 7 specialized agents working together to:

  1. Research trending TikTok Shop products in Beauty & Personal Care
  2. Plan viral content strategies based on TikTok algorithm signals
  3. Write hook-optimized scripts with karaoke-style word timestamps
  4. Generate product hero shots using Kling AI (cinematic, not AI slop)
  5. Compose full videos with ElevenLabs voiceover, stock footage, text overlays, SFX
  6. Optimize SEO (hashtags, captions, posting time)
  7. Publish to TikTok via Content Posting API

You provide the API keys. It does everything else.

Input:  TikTok Shop product URL
Output: Ready-to-post 15-60s TikTok video + optimized caption + hashtags

[!NOTE] This is not a "type your prompt, get a video" wrapper. This is a multi-agent system with real market research, content strategy, deduplication, cost tracking, and TikTok compliance built in.


Why this exists

Problem Solution
Creating TikTok content manually = 2-4 hours/video 100 videos/month, fully automated
AI-generated videos get flagged as "AI slop" and throttled Mixed pipeline: stock footage + AI hero shots + text overlays = human-feeling
Most AI video tools produce generic, soulless content 7 specialized agents — each one does ONE thing well
TikTok Shop Affiliate is lucrative but hard to scale Beauty & Personal Care niche = #1 GMV category, 15-25% commission
GPU requirements block most developers Cloud APIs (Kling, ElevenLabs) — runs on any laptop

Architecture

                        YOU (CLI)
                            │
                ┌───────────▼───────────┐
                │   SUPERVISOR          │
                │   (Marketing Director)│
                │   Routes + monitors   │
                └───────────┬───────────┘
                            │
         ┌──────────────────┼──────────────────┐
         │                  │                  │
         ▼                  ▼                  ▼
    RESEARCH          STRATEGY           ANALYTICS
    Market Intel      Content Plan       Performance
         │                  │
         │           ┌──────┴──────┐
         │           ▼             ▼
         │      SCRIPT         SEO AGENT
         │      WRITER         (Hashtags,
         │                     Captions)
         │           │
         └───────────▼
                PRODUCER
             (Video Engine)
             Kling AI + Stock +
             ElevenLabs + FFmpeg
                   │
                   ▼
               PUBLISHER
            (Upload to TikTok)

    ┌────────────────────────────────┐
    │        MCP BRIDGE              │
    │   Client ↔ Server              │
    │   Connect external tools       │
    │   Expose agents as MCP tools   │
    └────────────────────────────────┘

7 Agents

Agent Role Tools
Supervisor Marketing Director — routes tasks, monitors quality LLM + Router
Research Trending products, competitor analysis, market intel LLM + TikTok Research
Strategy Content calendar, hook library, posting schedule LLM + Trend DB
Script Writer 15-60s scripts with word timestamps, hook optimization LLM
SEO Hashtags, captions, posting time, TikTok algorithm signals LLM
Producer Video generation — Kling AI + stock footage + ElevenLabs TTS + FFmpeg Kling, Pixabay, Pexels, ElevenLabs, FFmpeg
Publisher Upload to TikTok, or export package for manual upload TikTok API
Analytics Track views, engagement, revenue, optimize strategy LLM + Analytics DB

Video Pipeline (Mixed Approach)

The key insight: pure AI-generated videos get throttled by TikTok. Our mixed approach feels human:

Stock Footage (60%)          AI Product Shots (20%)      Overlays (20%)
─────────────────────────    ────────────────────────    ─────────────────────
Pixabay/Pexels               Kling AI 2.5 Turbo Pro      FFmpeg
"woman applying cream"       "serum bottle, slow-mo      Text overlays
"close-up skincare routine"   cinematic, 9:16"           Subtitles (karaoke)
"glowing skin result"        $0.07/sec via fal.ai       SFX (whoosh, ding)

Video Output Example

[0-3s]   HOOK:   Stock footage + bold text overlay + whoosh SFX
[3-8s]   PROBLEM: Stock footage + voiceover "Punya masalah kulit kusam?"
[8-18s]  PRODUCT: Kling AI hero shot + ingredient callouts + voiceover
[18-25s] PROOF:   Stock "glowing skin" + voiceover "Coba ini..."
[25-30s] CTA:    Text overlay "Link di bio!" + product image + sparkle SFX

Tech Stack

Layer Technology Why
Framework LangGraph Supervisor pattern, native streaming, persistence
LLM OpenAI-compatible API Works with any provider (OpenAI, Groq, Together, local)
AI Video Kling 2.5 Turbo Pro (fal.ai) Best e-commerce product shots, $0.07/sec
Stock Footage Pixabay + Pexels FREE, HD, 100+ req/min
Voice ElevenLabs eleven_multilingual_v2 Natural voice, Indonesian support, word timestamps
Video Engine FFmpeg + moviepy Text overlays, composition, SFX, subtitles
Image Tools rembg Background removal for product photos
Protocol MCP (Model Context Protocol) Connect to any MCP server, expose agents as tools
Config Pydantic Settings Type-safe, .env driven

Cost Breakdown (100 videos/month)

Service Cost Notes
Kling AI ~$35/mo 5 sec product shots × 100 videos
ElevenLabs ~$10/mo 30s voiceover × 100 videos
LLM API ~$5/mo OpenAI-compatible, varies by provider
Stock Footage FREE Pixabay + Pexels
Total ~$50/month

Quick Start

Prerequisites

  • Python 3.11+
  • FFmpeg installed (apt install ffmpeg / brew install ffmpeg)
  • API keys: OpenAI-compatible LLM, fal.ai (Kling), ElevenLabs, Pixabay, Pexels

1. Clone & Install

git clone https://github.com/vanszs/tiktok-viral-factory.git
cd tiktok-viral-factory
pip install -r requirements.txt

2. Configure

cp .env.example .env
# Edit .env with your API keys

3. Run

# Generate a single video from a TikTok Shop product
python -m workflows.faceless --product-url "https://shop.tiktok.com/..."

# Batch generate from product list
python -m workflows.batch --input products.json --count 10

# Clip pipeline (transform existing content)
python -m workflows.clipping --source video.mp4

# Start MCP server (expose agents as tools)
python -m mcp_bridge.server

# Connect to external MCP tools
python -m mcp_bridge.client --config mcp_servers.json

4. Output

output/
├── video_20240115_143022.mp4     # Final video (1080x1920, 9:16)
├── video_20240115_143022.srt     # Subtitle file
├── metadata.json                  # Product data, SEO, timestamps
└── thumbnail.jpg                  # Auto-generated thumbnail

Project Structure

tiktok-viral-factory/
├── agents/              # 7 LangGraph agent nodes
├── config/
│   ├── prompts/         # System prompts for each agent
│   └── settings.py      # Pydantic settings (60+ config fields)
├── mcp_bridge/
│   ├── client.py        # Connect to external MCP servers
│   └── server.py        # Expose agents as MCP tools
├── models/
│   └── schemas.py       # 22 Pydantic models (state, products, videos)
├── tools/               # Image search, Kling, TTS, FFmpeg, SEO
├── utils/
│   └── llm.py           # OpenAI-compatible LLM factory
├── workflows/           # 3 pipelines: faceless, clipping, batch
├── fonts/               # Custom .ttf for text overlays
├── sfx/                 # Sound effects (whoosh, ding, sparkle)
├── output/              # Generated videos + metadata
├── plan.md              # Full 1200-line implementation plan
└── .env.example         # All config fields documented

Key Features

  • Anti-AI-Slop: Mixed pipeline (stock + AI hero shots + overlays) avoids TikTok's AI content throttling
  • Content Deduplication: Hash-based tracking prevents generating duplicate content across runs
  • Cost Tracking: Real-time budget monitoring per video and monthly cap ($50 default)
  • Kling AI Fallback: If AI video fails, automatically falls back to static product image with FFmpeg zoom + sparkle
  • Smart Stock Search: Searches vertical first → smart crop → letterbox → pan&scan for any orientation
  • Word-Level Subtitles: ElevenLabs timestamps enable karaoke-style subtitle sync
  • MCP Protocol: Full MCP Bridge — connect to any tool ecosystem, expose your agents to other systems
  • Multi-LLM: Works with OpenAI, Groq, Together AI, Ollama, or any OpenAI-compatible API

Roadmap

  • Architecture & PRD (1200+ lines)
  • Data models (22 Pydantic schemas)
  • Configuration system (60+ typed settings)
  • MCP Bridge (Client + Server)
  • Tools layer (Kling, ElevenLabs, Pixabay, FFmpeg)
  • 7 Agents implementation
  • 3 Video pipelines (faceless, clipping, batch)
  • TikTok Content Posting API integration
  • Analytics dashboard
  • Batch mode (100 videos/month)
  • Multi-niche support (beyond Beauty & Personal Care)

Contributing

PRs welcome! Areas where help is most needed:

  • More niches: Extend beyond Beauty & Personal Care
  • More stock sources: Additional free stock footage APIs
  • Better prompts: Improve agent system prompts with real-world results
  • UI: Simple web dashboard for monitoring

License

MIT — do whatever you want with it. If you make money from it, that's the point.


If this helps you build your TikTok empire, drop a star.
Star

Built with caffeine and LangGraph in Indonesia

from github.com/Vanszs/tiktok-viral-factory

Installing Tiktok Viral Factory

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/Vanszs/tiktok-viral-factory

FAQ

Is Tiktok Viral Factory MCP free?

Yes, Tiktok Viral Factory MCP is free — one-click install via Unyly at no cost.

Does Tiktok Viral Factory need an API key?

No, Tiktok Viral Factory runs without API keys or environment variables.

Is Tiktok Viral Factory hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Tiktok Viral Factory in Claude Desktop, Claude Code or Cursor?

Open Tiktok Viral Factory on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Tiktok Viral Factory with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All media MCPs