Instagram Carousel MCP

Instagram Carousel MCP

An MCP server that designs multi-slide Instagram carousels as SVG, provides a live swipeable preview, and exports to PNG. Supports multiple templates, themes, and sizes.

Category
访问服务器

README

Instagram Carousel MCP

An MCP server that designs multi-slide Instagram carousels as crisp SVG, shows them in a live swipeable preview, and exports them to PNG ready to upload. Pure-Python, no system image libraries required.

What it does

  • Describe a carousel as a list of slide specs → it renders each slide to SVG.
  • Six slide templates: title, content, list, quote, stat, cta.
  • Six themes: midnight, sunset, mono, forest, slate, bubblegum.
  • Three sizes: portrait (1080×1350, recommended), square (1080×1080), story (1080×1920).
  • A live preview page (swipe / arrow keys / dots) that also rasterises each slide to PNG in the browser — no extra dependencies for export.

Tools

Tool Purpose
list_themes List available themes with colours.
create_carousel Build a carousel from slide specs; writes SVGs + preview. Accepts brand, caption, hashtags. Returns preview_url.
update_slide Replace one slide (by index) and re-render.
add_slide Insert/append a slide.
save_brand Create/update a brand profile (handle, logo, custom theme, default hashtags).
list_brands List saved brand profiles.
get_preview_url Get the live preview URL for an existing carousel.
export_png Server-side PNG export (optional; needs Playwright).

Slide fields

title    eyebrow?, heading,  subheading?, handle?
content  eyebrow?, heading,  body
list     eyebrow?, heading,  items[] (strings), ordered? (bool)
quote    quote,    author?,  role?
stat     value,    label?,   caption?
cta      eyebrow?, heading,  body?, button?, handle?

Any slide also accepts handle (e.g. @brand) and page (bool — show n/total).

Images

Slides aren't text-only — you can add photos:

  • background_image (any slide): a full-bleed photo behind the content. Text automatically switches to light and a gradient scrim is added so it stays readable on top of the image.
  • image (on the content template): an inline rounded image card shown between the heading and the body text.

You don't have to supply files at all — use background_query / image_query with a text description and the server auto-sources a fitting image, trying in order: Replicate/Flux (AI, needs REPLICATE_API_TOKEN) → Pexels (stock, needs PEXELS_API_KEY) → Openverse (free CC photos, no key) → Picsum (random, guaranteed). Results cache under assets/cache/. Override the order with IMAGE_PROVIDER_ORDER. So image-sourcing works with zero setup (real photos) and upgrades to custom AI art once a Replicate token is present.

{ "template": "title", "heading": "The State of Remote Work",
  "background_query": "minimal home office, soft morning light" }
{ "template": "content", "heading": "Hybrid is winning",
  "image_query": "team collaborating in a bright office",
  "body": "58% of teams now run hybrid." }

Or supply images explicitly: background_image / image values can be a local file path, an http(s) URL (downloaded), or a data URI — all base64-embedded so exported PNGs are self-contained. Drop files in assets/:

{ "template": "title", "heading": "2026 Report",
  "background_image": "assets/cover.jpg" }
{ "template": "content", "heading": "Hybrid is winning",
  "image": "https://example.com/chart.png",
  "body": "58% of teams now run hybrid — up from 41% last year." }

Brand your page (theme + logo)

Save a brand profile once, then pass brand: "<name>" to create_carousel and every slide gets your colours, logo, @handle, and default hashtags.

// save_brand({ profile: { ... } })  -> brands/mypage.json
{
  "name": "mypage",
  "handle": "@mypage",
  "logo": "mypage-logo.png",          // path; absolute, or relative to brands/
  "base_theme": "midnight",           // theme to extend
  "theme": {                          // override only what you want
    "accent": "#f472b6",
    "bg": ["#1e1b4b", "#312e81"]      // "#hex" solid, or ["#a","#b"] gradient
  },
  "default_hashtags": ["#buildinpublic", "#startup"],
  "caption_signature": "Follow @mypage 🚀",
  "default_size": "portrait"
}
  • Logo: any PNG/JPG/SVG. It's base64-embedded into each slide (top-left), so exported PNGs are fully self-contained. Drop your logo in brands/ (or give an absolute path) and set logo to it.
  • Theme: start from a built-in base_theme and override any of accent, bg, bg_angle, text, muted, accent_fg, font_sans, font_serif.
  • Profiles are JSON in brands/, so they commit to the repo and sync across devices.

Captions & hashtags

create_carousel (and a follow-up) take caption and hashtags. The final post text is assembled as caption → brand signature → merged hashtags (per-call + brand defaults, deduped), written to caption.txt, and shown in the live preview with a Copy button — paste straight into Instagram.

create_carousel(
  slides=[...],
  brand="mypage",
  caption="Speed compounds. Here are 5 moves that cut our cycle time in half.",
  hashtags=["#shipfast", "#engineering"],
)

Viewing the output interactively

create_carousel returns a preview_url served by the MCP server itself (e.g. http://127.0.0.1:<port>/<carousel-id>/). Open it in any browser for the full interactive carousel + Download all (ZIP) button.

In the Claude Code desktop app, the Preview tool reads ~/.claude/launch.json. The included carousel-preview config serves a carousel directory over http://127.0.0.1:8745/. To preview a specific carousel, point its --directory arg at output/<carousel-id> and start the preview. (Claude can do this for you on request.)

Exporting PNGs

  • Easiest: click Download all (ZIP) in the live preview — rasterises all slides in the browser and bundles them into one ZIP (a single download, so the browser's multi-download block never trips). Zero setup. "Download this slide (PNG)" grabs just the current one.
  • Headless / programmatic: export_png. One-time setup:
    ./.venv/bin/python -m pip install playwright
    ./.venv/bin/python -m playwright install chromium
    

Run it on another device

Prerequisites: Python 3.10+ and the claude CLI on PATH.

git clone https://github.com/vaheedsk36/instagram-carousel-mcp.git
cd instagram-carousel-mcp
./setup.sh           # creates .venv, installs deps, registers the MCP server

setup.sh registers the server at user scope so it's available in every Claude Code session on that machine. Verify with claude mcp list | grep carousel. Your brand profiles travel with the repo (they live in brands/), so the same look is available everywhere.

Manual equivalent if you'd rather not run the script:

python3 -m venv .venv
./.venv/bin/python -m pip install -r requirements.txt
claude mcp add instagram-carousel --scope user -- \
  "$(pwd)/.venv/bin/python" "$(pwd)/server.py"

Note: the .venv is machine-specific and git-ignored — always recreate it per device. Only the source and brands/ profiles are committed.

Project layout

server.py              MCP server (FastMCP) — the tools
carousel/themes.py     theme palettes + custom-theme builder
carousel/brand.py      brand profiles (handle, logo, theme, hashtags) + caption assembly
carousel/render.py     slide spec -> SVG (text wrapping, templates, logo embedding)
carousel/preview.py    background HTTP preview server + viewer HTML (caption + copy)
carousel/export.py     optional Playwright SVG->PNG
brands/                saved brand profiles (committed; sync across devices)
output/<id>/           generated slides, manifest, preview, caption.txt, spec
setup.sh               one-shot setup for a fresh machine
requirements.txt       Python dependencies
test_render.py         smoke test covering all templates
test_brand.py          smoke test for brand + logo + caption

Note on this machine

The Homebrew Python 3.14 bottle shipped with a mis-linked pyexpat (pointed at the system libexpat which lacks a newer symbol). It was repaired by repointing the extension at Homebrew's expat:

install_name_tool -change /usr/lib/libexpat.1.dylib \
  /opt/homebrew/opt/expat/lib/libexpat.1.dylib <pyexpat.so>
codesign --force -s - <pyexpat.so>

A future brew upgrade python@3.14 may revert this; re-run if import xml.parsers.expat fails again.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选