Content Pipeline
AI-powered content pipeline: trend discovery -> deep research -> algorithm-optimized writing -> social publishing.
MCP Servers Required
Install via uvx (one-time, auto-cached):
uvx --from 'trend-pulse[mcp]' trend-pulse-server
uvx --from cf-browser-mcp cf-browser-mcp
uvx --from notebooklm-skill notebooklm-mcp
MCP Tools Reference
trend-pulse (12 tools)
Trend Data:
- get_trending(sources, geo, count): Query ALL 20 free sources. sources="" for all. geo: "TW"/"US"/"JP"/"". count: 20.
- Sources: google_trends, hackernews, mastodon, bluesky, wikipedia, github, pypi, google_news, lobsters, devto, npm, reddit, coingecko, dockerhub, stackoverflow, producthunt, arxiv, lemmy, dcard, ptt
- search_trends(query, sources, geo): Cross-source keyword search.
- list_sources(): List all sources.
- take_snapshot(sources, geo, count): Save snapshot for velocity tracking.
- get_trend_history(keyword, days, source): Historical data with direction.
Content Guide:
- get_content_brief(topic): Writing brief with hook examples, patent strategies, CTA.
- get_scoring_guide(): 5-dimension patent scoring. Score >= 70 required.
- get_platform_specs(platform): Platform specs (char limits, algorithm signals, posting times).
- get_review_checklist(): Quality review checklist (7 checks).
- get_reel_guide(): Reels script guide (3 styles).
Search:
- search_threads_posts(query): Search Threads posts by heat score.
cf-browser (10 tools)
Headless Chrome via Cloudflare Browser Rendering. Use instead of WebFetch for JS-rendered pages.
- browser_markdown(url): Clean Markdown. Most used for deep research.
- browser_content(url): Full rendered HTML.
- browser_screenshot(url): Full page screenshot (PNG).
- browser_pdf(url): Generate PDF.
- browser_scrape(url, selector): CSS selector extraction.
- browser_json(url, schema): AI-driven structured data extraction.
- browser_links(url): Extract all hyperlinks.
- browser_a11y(url): Accessibility tree (low token cost).
- browser_crawl(url): Async multi-page crawl.
- browser_crawl_status(id): Check crawl progress.
notebooklm (13 tools)
Deep research + 9 downloadable artifact types (podcast, slides, report, quiz, flashcards, mindmap, datasheet, study_guide).
⚠️ infographic download is unreliable — use slides instead.
Management: create_notebook, list_notebooks, delete_notebook
Research: add_source, ask, summarize, list_sources, research(mode="fast"|"thorough")
Artifacts: generate_artifact(type, lang?), download_artifact(type, output_path)
Pipelines: research_pipeline(sources, questions, output_format), trend_research(geo?, count?, platform?)
Video Synthesis (slides + podcast -> MP4):
- Generate slides (PDF) + audio (podcast M4A) — sequentially
- Download both
pdftoppm -png -r 300 slides.pdf slides_page
ffmpeg -framerate 1/$per_slide -pattern_type glob -i 'slides_page-*.png' -i audio.mp3 -c:v libx264 -pix_fmt yuv420p -c:a aac -shortest output.mp4
Visual Content Generation
Use NotebookLM to generate all visual content. It produces professional-quality slides and mind maps — far better than any alternative.
⛔ 嚴格禁止:不得使用 Pillow/PIL、ImageMagick、Python 程式碼或 HTML+Playwright 生成圖卡。
所有圖卡一律透過 NotebookLM nlm_generate(type="slides") 生成。
⚠️ Do NOT use infographic (download unreliable). Use slides for all visual content.
⚠️ NLM slides 多頁時 → 必須全部上傳 → 用 carousel_urls 發文(不要只發一張)。
Image Cards & Slides (圖卡 / 簡報)
Workflow: Create a NotebookLM notebook with the content as a text source, then generate the visual artifact.
1. create_notebook(title="Post Visual", text_sources=["<post content + key data points>"])
2. generate_artifact(name_or_id, "slides", lang="zh-TW") → PDF slides (best for cards)
3. download_artifact(name_or_id, "slides", "downloads/card.pdf")
Choose artifact type by use case:
| Need |
Artifact Type |
Output |
| Single image card |
slides (1 slide) |
PDF → export as image |
| Multi-slide carousel |
slides (N slides) |
PDF → split per page |
| Data visualization |
slides |
infographic ⚠️ download unreliable — use slides |
| Topic overview |
mindmap |
Mind map diagram |
| Detailed report |
report |
Formatted document |
| Study material |
flashcards / study_guide |
Learning cards |
Carousel Posts (輪播貼文)
For multi-image carousel (Threads supports 2-20 images):
- Create notebook with content organized as numbered sections (one per slide)
generate_artifact(name_or_id, "slides") → multi-page PDF
- Download and split:
pdftoppm -png -r 300 slides.pdf slide
- Upload EVERY image — call
upload_image for EACH slide PNG:upload_image(file_path="downloads/slide-1.png") → url1
upload_image(file_path="downloads/slide-2.png") → url2
upload_image(file_path="downloads/slide-3.png") → url3
...repeat for ALL slides
- Publish as carousel — pass ALL URLs to
publish_to_threads:publish_to_threads(text="...", carousel_urls=[url1, url2, url3, ...])
Do NOT use image parameter — use carousel_urls when there are 2+ images.
⚠️ CRITICAL: When slides have multiple pages, you MUST use carousel_urls (not image).
Single image parameter only posts the first image. carousel_urls posts ALL images as a swipeable carousel.
Video (影片)
Combine slides + podcast audio into MP4:
generate_artifact(name_or_id, "slides") → PDF
generate_artifact(name_or_id, "podcast") → M4A audio (run sequentially, NOT parallel)
- Download both artifacts
pdftoppm -png -r 300 slides.pdf slides_page
ffmpeg -framerate 1/$per_slide -pattern_type glob -i 'slides_page-*.png' -i audio.mp3 -c:v libx264 -pix_fmt yuv420p -c:a aac -shortest output.mp4
Tips for Better Visuals
- Language: Always pass
lang="zh-TW" for Traditional Chinese content
- Rich text sources: The more context you feed into the notebook, the better the visual output
- One topic per notebook: Don't mix unrelated topics — create separate notebooks
- Add URLs as sources:
add_source(name_or_id, url="...") for reference material — NotebookLM will incorporate key data into visuals
Mandatory Rules
0. Workspace Containment
All files MUST be saved within the session workspace directory. Use relative paths like downloads/card.pdf. NEVER use ~/Downloads, ~/Desktop, or any absolute path outside the workspace.
1. Read Original Sources
NEVER write content based on titles/metadata alone.
- Single topic: read >= 1 primary source via browser_markdown(url)
- Controversial: read >= 2 sources (both sides)
- Data claims: find original data source
2. Timeline Verification
Every fact must have a verified timestamp. Discard anything > 48 hours old.
| Source age |
Allowed |
Forbidden |
| Today |
"today" "just now" |
- |
| 1-3 days |
"recently" "the other day" |
"just" "latest" |
| 4-7 days |
"last week" "this week" |
"just" "yesterday" |
| 8-30 days |
"this month" |
"last week" "just" |
| >30 days |
"earlier" "this year" |
any freshness words |
3. Use ALL Sources
get_trending with sources="" to query ALL 20 sources. Do NOT filter unless user explicitly asks.
Meta Patent-Based Scoring (5 Dimensions)
| # |
Dimension |
Weight |
Check |
| 1 |
Hook Power |
25% |
First line: number or contrast, 10-45 chars |
| 2 |
Engagement Trigger |
25% |
CTA anyone can answer, direct "you" address |
| 3 |
Conversation Durability |
20% |
Has contrast/both sides, creates discussion |
| 4 |
Velocity Potential |
15% |
Timely, 50-300 chars, urgency language |
| 5 |
Format Score |
15% |
Mobile-scannable, line breaks, no text walls |
Quality Gates (ALL must pass before publishing):
- Overall Score >= 70
- Conversation Durability >= 55
- Hook: 10-45 chars with number or contrast
- CTA: clear question or poll
- Timeline: all time words verified
- Source: every claim traceable
- No AI filler words
Pipeline Workflow
- Discover: get_trending(sources="", geo, count=20)
- Read Source: browser_markdown(url) — MANDATORY
- Verify Timeline: Check dates, discard stale
- Research: browser_markdown + WebSearch, 2-3 sources min
- Brief: get_content_brief(topic)
- Create: Write -> patent check (5 dimensions)
- Score: get_scoring_guide — self-score (>= 70)
- Review: get_review_checklist — final check
- NotebookLM (optional): create notebook -> generate artifacts
- Publish: provide ready-to-post content or use publish tool
1---2name: content-pipeline3description: Full-autopilot trend discovery, deep research, and social publishing pipeline. Uses trend-pulse (20 sources), cf-browser (headless Chrome), and notebooklm (research + artifacts) MCP servers. Generates algorithm-optimized content based on Meta's 7 patent-based ranking algorithms. Use when user mentions trending topics, content creation, social media publishing, trend analysis, research pipeline, viral content, content scoring, or Threads posting.4---56# Content Pipeline78AI-powered content pipeline: trend discovery -> deep research -> algorithm-optimized writing -> social publishing.910## MCP Servers Required1112Install via uvx (one-time, auto-cached):1314```bash15uvx --from 'trend-pulse[mcp]' trend-pulse-server16uvx --from cf-browser-mcp cf-browser-mcp17uvx --from notebooklm-skill notebooklm-mcp18```1920## MCP Tools Reference2122### trend-pulse (12 tools)2324**Trend Data:**2526- **get_trending(sources, geo, count)**: Query ALL 20 free sources. sources="" for all. geo: "TW"/"US"/"JP"/"". count: 20.27 - Sources: google_trends, hackernews, mastodon, bluesky, wikipedia, github, pypi, google_news, lobsters, devto, npm, reddit, coingecko, dockerhub, stackoverflow, producthunt, arxiv, lemmy, dcard, ptt28- **search_trends(query, sources, geo)**: Cross-source keyword search.29- **list_sources()**: List all sources.30- **take_snapshot(sources, geo, count)**: Save snapshot for velocity tracking.31- **get_trend_history(keyword, days, source)**: Historical data with direction.3233**Content Guide:**3435- **get_content_brief(topic)**: Writing brief with hook examples, patent strategies, CTA.36- **get_scoring_guide()**: 5-dimension patent scoring. Score >= 70 required.37- **get_platform_specs(platform)**: Platform specs (char limits, algorithm signals, posting times).38- **get_review_checklist()**: Quality review checklist (7 checks).39- **get_reel_guide()**: Reels script guide (3 styles).4041**Search:**4243- **search_threads_posts(query)**: Search Threads posts by heat score.4445### cf-browser (10 tools)4647Headless Chrome via Cloudflare Browser Rendering. Use instead of WebFetch for JS-rendered pages.4849- **browser_markdown(url)**: Clean Markdown. **Most used** for deep research.50- **browser_content(url)**: Full rendered HTML.51- **browser_screenshot(url)**: Full page screenshot (PNG).52- **browser_pdf(url)**: Generate PDF.53- **browser_scrape(url, selector)**: CSS selector extraction.54- **browser_json(url, schema)**: AI-driven structured data extraction.55- **browser_links(url)**: Extract all hyperlinks.56- **browser_a11y(url)**: Accessibility tree (low token cost).57- **browser_crawl(url)**: Async multi-page crawl.58- **browser_crawl_status(id)**: Check crawl progress.5960### notebooklm (13 tools)6162Deep research + 9 downloadable artifact types (podcast, slides, report, quiz, flashcards, mindmap, datasheet, study_guide).63⚠️ `infographic` download is unreliable — use `slides` instead.6465**Management:** create_notebook, list_notebooks, delete_notebook66**Research:** add_source, ask, summarize, list_sources, research(mode="fast"|"thorough")67**Artifacts:** generate_artifact(type, lang?), download_artifact(type, output_path)68**Pipelines:** research_pipeline(sources, questions, output_format), trend_research(geo?, count?, platform?)6970**Video Synthesis (slides + podcast -> MP4):**71721. Generate slides (PDF) + audio (podcast M4A) — sequentially732. Download both743. `pdftoppm -png -r 300 slides.pdf slides_page`754. `ffmpeg -framerate 1/$per_slide -pattern_type glob -i 'slides_page-*.png' -i audio.mp3 -c:v libx264 -pix_fmt yuv420p -c:a aac -shortest output.mp4`7677## Visual Content Generation7879Use **NotebookLM** to generate all visual content. It produces professional-quality slides and mind maps — far better than any alternative.8081⛔ **嚴格禁止**:不得使用 Pillow/PIL、ImageMagick、Python 程式碼或 HTML+Playwright 生成圖卡。82所有圖卡一律透過 NotebookLM `nlm_generate(type="slides")` 生成。8384⚠️ Do NOT use `infographic` (download unreliable). Use `slides` for all visual content.85⚠️ NLM slides 多頁時 → 必須全部上傳 → 用 `carousel_urls` 發文(不要只發一張)。8687### Image Cards & Slides (圖卡 / 簡報)8889**Workflow:** Create a NotebookLM notebook with the content as a text source, then generate the visual artifact.9091```921. create_notebook(title="Post Visual", text_sources=["<post content + key data points>"])932. generate_artifact(name_or_id, "slides", lang="zh-TW") → PDF slides (best for cards)943. download_artifact(name_or_id, "slides", "downloads/card.pdf")95```9697**Choose artifact type by use case:**9899| Need | Artifact Type | Output |100| -------------------- | ---------------------------- | --------------------------------------------------- |101| Single image card | `slides` (1 slide) | PDF → export as image |102| Multi-slide carousel | `slides` (N slides) | PDF → split per page |103| Data visualization | `slides` | ~~infographic~~ ⚠️ download unreliable — use slides |104| Topic overview | `mindmap` | Mind map diagram |105| Detailed report | `report` | Formatted document |106| Study material | `flashcards` / `study_guide` | Learning cards |107108### Carousel Posts (輪播貼文)109110For multi-image carousel (Threads supports 2-20 images):1111121. Create notebook with content organized as numbered sections (one per slide)1132. `generate_artifact(name_or_id, "slides")` → multi-page PDF1143. Download and split: `pdftoppm -png -r 300 slides.pdf slide`1154. **Upload EVERY image** — call `upload_image` for EACH slide PNG:116 ```117 upload_image(file_path="downloads/slide-1.png") → url1118 upload_image(file_path="downloads/slide-2.png") → url2119 upload_image(file_path="downloads/slide-3.png") → url3120 ...repeat for ALL slides121 ```1225. **Publish as carousel** — pass ALL URLs to `publish_to_threads`:123 ```124 publish_to_threads(text="...", carousel_urls=[url1, url2, url3, ...])125 ```126 Do NOT use `image` parameter — use `carousel_urls` when there are 2+ images.127128⚠️ **CRITICAL**: When slides have multiple pages, you MUST use `carousel_urls` (not `image`).129Single `image` parameter only posts the first image. `carousel_urls` posts ALL images as a swipeable carousel.130131### Video (影片)132133Combine slides + podcast audio into MP4:1341351. `generate_artifact(name_or_id, "slides")` → PDF1362. `generate_artifact(name_or_id, "podcast")` → M4A audio (run sequentially, NOT parallel)1373. Download both artifacts1384. `pdftoppm -png -r 300 slides.pdf slides_page`1395. `ffmpeg -framerate 1/$per_slide -pattern_type glob -i 'slides_page-*.png' -i audio.mp3 -c:v libx264 -pix_fmt yuv420p -c:a aac -shortest output.mp4`140141### Tips for Better Visuals142143- **Language**: Always pass `lang="zh-TW"` for Traditional Chinese content144- **Rich text sources**: The more context you feed into the notebook, the better the visual output145- **One topic per notebook**: Don't mix unrelated topics — create separate notebooks146- **Add URLs as sources**: `add_source(name_or_id, url="...")` for reference material — NotebookLM will incorporate key data into visuals147148## Mandatory Rules149150### 0. Workspace Containment151152All files MUST be saved within the session workspace directory. Use relative paths like `downloads/card.pdf`. NEVER use ~/Downloads, ~/Desktop, or any absolute path outside the workspace.153154### 1. Read Original Sources155156NEVER write content based on titles/metadata alone.157158- Single topic: read >= 1 primary source via browser_markdown(url)159- Controversial: read >= 2 sources (both sides)160- Data claims: find original data source161162### 2. Timeline Verification163164Every fact must have a verified timestamp. Discard anything > 48 hours old.165166| Source age | Allowed | Forbidden |167| ---------- | -------------------------- | ------------------- |168| Today | "today" "just now" | - |169| 1-3 days | "recently" "the other day" | "just" "latest" |170| 4-7 days | "last week" "this week" | "just" "yesterday" |171| 8-30 days | "this month" | "last week" "just" |172| >30 days | "earlier" "this year" | any freshness words |173174### 3. Use ALL Sources175176get_trending with sources="" to query ALL 20 sources. Do NOT filter unless user explicitly asks.177178## Meta Patent-Based Scoring (5 Dimensions)179180| # | Dimension | Weight | Check |181| --- | ----------------------- | ------ | -------------------------------------------- |182| 1 | Hook Power | 25% | First line: number or contrast, 10-45 chars |183| 2 | Engagement Trigger | 25% | CTA anyone can answer, direct "you" address |184| 3 | Conversation Durability | 20% | Has contrast/both sides, creates discussion |185| 4 | Velocity Potential | 15% | Timely, 50-300 chars, urgency language |186| 5 | Format Score | 15% | Mobile-scannable, line breaks, no text walls |187188**Quality Gates (ALL must pass before publishing):**189190- Overall Score >= 70191- Conversation Durability >= 55192- Hook: 10-45 chars with number or contrast193- CTA: clear question or poll194- Timeline: all time words verified195- Source: every claim traceable196- No AI filler words197198## Pipeline Workflow1992001. **Discover**: get_trending(sources="", geo, count=20)2012. **Read Source**: browser_markdown(url) — MANDATORY2023. **Verify Timeline**: Check dates, discard stale2034. **Research**: browser_markdown + WebSearch, 2-3 sources min2045. **Brief**: get_content_brief(topic)2056. **Create**: Write -> patent check (5 dimensions)2067. **Score**: get_scoring_guide — self-score (>= 70)2078. **Review**: get_review_checklist — final check2089. **NotebookLM** (optional): create notebook -> generate artifacts20910. **Publish**: provide ready-to-post content or use publish tool