Content Automation
Automated content publishing for Pinterest and Instagram with AI-powered content generation and scheduling.
Features
- ✅ MCP Integration ⭐ - Natural language control through AI assistants (primary way of working)
- 📖 Detailed MCP description - setup, prompt examples, troubleshooting
- ✅ TypeScript - Full type safety for reliability and better IDE support
- ✅ Late API - Publishing to Instagram and Pinterest through a unified API
- ✅ Local Image Processing - Automatic conversion (HEIC/PNG/GIF → JPG) and center-crop to platform aspect ratios via
sharp - ✅ SCP Upload to CDN - Processed images are automatically uploaded to your CDN server via
scp - ✅ Unique AI-powered content generation for Pinterest and Instagram (OpenAI with customizable prompts)
- ✅ Publication scheduling through Late API (no local scheduler needed)
- ✅ Instagram Stories Support - Publishing Stories through Late API
- ✅ Instagram Carousel - Publish 2–10 photos in one post (via MCP)
- ✅ Publishing to both platforms with a single request
- ✅ Processed image tracking
- ✅ OpenAI integration for content generation (optional)
- ✅ CLI commands - alternative way of working through terminal
Installation
- Install dependencies:
npm install
- Build the TypeScript project:
npm run build
- Copy
.env.exampleto.envand fill it:
cp .env.example .env
- Configure environment variables in
.env:- Late API (required): Get API key at getlate.dev
- CDN Base URL (required): Specify the base CDN URL where images are hosted
- SCP Upload (optional): Configure SCP to auto-upload processed local images to CDN
- OpenAI API (optional): For AI-powered content generation
- Content Prompt (optional): Customize content generation by copying
prompts/content-prompt.example.txttoprompts/content-prompt.txtand editing it
Getting API Keys
Late API (Required) ⭐
The project uses only Late API for publishing to Instagram and Pinterest.
- Register at getlate.dev
- Get API key
- Connect Instagram and Pinterest accounts
- Get Profile ID and Account IDs from the dashboard
- Add to
.env:LATE_API_KEY=your_key LATE_PROFILE_ID=your_profile_id LATE_INSTAGRAM_ACCOUNT_ID=your_instagram_account_id LATE_PINTEREST_ACCOUNT_ID=your_pinterest_account_id
Late API Benefits:
- ✅ No local scheduler needed - Late API publishes on schedule automatically
- ✅ Reliable scheduling on Late servers
- ✅ Publishing to Instagram AND Pinterest with a single request - saves API requests!
- ✅ Free plan available (60 requests/minute)
- ✅ Support for 13 platforms (Instagram, Pinterest, Facebook, LinkedIn, Twitter/X, TikTok, YouTube, Reddit, Bluesky, Threads, Google Business, Telegram, Snapchat)
Supported Platforms: Instagram, Pinterest, Facebook, LinkedIn, Twitter/X, TikTok, YouTube, Reddit, Bluesky, Threads, Google Business, Telegram, Snapchat
Usage
The project supports two ways of working:
- Through MCP agent (recommended) - Natural language control through AI assistant
- Through CLI commands - Traditional way through terminal
Setup Check
Before starting, check API connection:
npm run check
This will check:
- Late API connection (required)
- CDN configuration (required)
- SCP upload configuration (optional)
- OpenAI API availability (optional)
CLI Commands
Publishing Images
npm run publish -- --image=IMG_5857.jpg [options]
Image Input:
- Local file (recommended): Place source images (HEIC, JPG, PNG, GIF) in the images directory. By default the system looks in
images/(relative to project root); you can override withIMAGES_SOURCE_DIRin.env(e.g. an absolute path like/path/to/story-matcher). The system will convert to JPG, center-crop to platform aspect ratios, upload to CDN via SCP, and use the CDN URLs for publishing. - CDN URL: If the image is already on CDN, pass the full URL — processing is skipped.
- Filename only: If SCP is not configured, the filename is resolved against
CDN_BASE_URLdirectly (existing behavior).
Examples:
# Local image: auto-process + upload + publish to all platforms
npm run publish -- --image=IMG_5857.HEIC
# Publish in 1 hour
npm run publish -- --image=IMG_5857.jpg 1
# Draft with publication date
npm run publish -- --image=IMG_5857.jpg --date="tomorrow 18:00" --draft
# With context
npm run publish -- --image=IMG_5857.jpg 1 --context="City center"
# Instagram post only
npm run publish -- --image=IMG_5857.jpg --post
# Instagram story only
npm run publish -- --image=IMG_5857.jpg --story
# Instagram story + Pinterest pin (comma-separated)
npm run publish -- --image=IMG_5857.jpg --types=story,pin
# Instagram post + Pinterest pin
npm run publish -- --image=IMG_5857.jpg --types=post,pin
# Pinterest pin only
npm
Tools 1
publishPublishes content to Instagram and Pinterest with optional AI-generated captions and scheduling.Environment Variables
LATE_API_KEYrequiredAPI key from getlate.devLATE_PROFILE_IDrequiredProfile ID from Late dashboardLATE_INSTAGRAM_ACCOUNT_IDrequiredInstagram account ID from Late dashboardLATE_PINTEREST_ACCOUNT_IDrequiredPinterest account ID from Late dashboardCDN_BASE_URLrequiredBase URL where images are hostedOPENAI_API_KEYAPI key for AI-powered content generation