MCP-powered Instagram automation system for @brandonio31 - AI content generation, scheduling, analytics, and engagement management
This project is a comprehensive Instagram automation system built using the Model Context Protocol (MCP). It enables natural language commands to manage your entire Instagram presence, from content creation to analytics.
- AI-powered caption generation using Claude
- Content idea generation based on pillars
- Caption refinement and optimization
- Hook-Story-Lesson template support
- Consistent brand voice maintenance
- Automated post scheduling
- Optimal time posting (Mon/Wed/Fri 7 PM, Tue/Thu 9 AM, Sat 2 PM)
- Batch scheduling for weeks/months
- Instagram Graph API integration
- Performance tracking (likes, comments, reach, engagement rate)
- Growth monitoring
- Content comparison and analysis
- AI-powered insights and recommendations
- Comment monitoring and suggested replies
- DM management
- Engagement analytics
- Automated response suggestions
- View and manage content calendar
- Update posting schedules
- Content compliance checks
- Weekly/monthly planning
- MCP SDK: Model Context Protocol for tool orchestration
- Instagram Graph API v22.0: Content publishing and analytics
- Claude API: AI content generation
- PostgreSQL: Database for content and analytics
- TypeScript + Node.js: Core implementation
generate_caption- Create AI-powered captionsgenerate_content_ideas- Generate post ideasrefine_caption- Improve existing captionsschedule_post- Schedule single postsschedule_week- Schedule week of contentschedule_batch- Batch schedule multiple postsget_performance- Get post performance metricsget_insights- Get AI-powered insightscompare_posts- Compare post performanceget_comments- Retrieve recent commentssuggest_replies- AI-suggested comment repliesget_dms- Retrieve direct messagesview_calendar- View content calendarupdate_calendar- Update calendar entriescheck_compliance- Ensure content compliance
- Node.js 18+
- PostgreSQL database
- Instagram Business Account
- Facebook Page (linked to Instagram)
- Claude API key
- Instagram Access Token
# Clone the repository
git clone https://github.com/abcnuts/instagram-mcp-automation.git
cd instagram-mcp-automation
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your credentials
# Initialize database
npm run db:init
# Build the project
npm run build
# Start the MCP server
npm startCreate a .env file with:
# Instagram API
INSTAGRAM_ACCESS_TOKEN=your_access_token
INSTAGRAM_USER_ID=your_instagram_user_id
# Claude API
CLAUDE_API_KEY=your_claude_api_key
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/instagram_mcp
# Content Calendar
CALENDAR_PATH=./data/content-calendar.json
HASHTAGS_PATH=./data/hashtags.jsonAdd to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on Mac):
{
"mcpServers": {
"instagram-automation": {
"command": "node",
"args": ["/path/to/instagram-mcp-automation/dist/index.js"]
}
}
}Once configured, use natural language commands in Claude:
"Create captions for Week 1 of my content calendar"
"Schedule this week's posts at optimal times"
"How did my posts perform this month?"
"Check my recent comments and suggest replies"
"Generate 5 content ideas about AI consciousness"
"What's on my calendar for next week?"
instagram-mcp-automation/
├── src/
│ ├── index.ts # Main MCP server
│ ├── tools/ # MCP tool implementations
│ ├── services/ # Core services
│ │ ├── instagram.ts # Instagram API service
│ │ ├── claude.ts # Claude AI service
│ │ └── database.ts # Database service
│ ├── types/ # TypeScript types
│ └── utils/ # Utility functions
├── data/
│ ├── content-calendar.json # Your content calendar
│ ├── hashtags.json # Hashtag collections
│ └── brand-voice.json # Brand voice profile
├── database/
│ └── schema.sql # Database schema
├── .env.example # Environment template
├── package.json
├── tsconfig.json
└── README.md
- Never commit
.envor credentials to Git - Use environment variables for all secrets
- Instagram Access Tokens expire - refresh regularly
- Follow Instagram's Terms of Service and rate limits
- Store sensitive data in PostgreSQL with encryption
Posting Schedule: 3x per week
- Monday, Wednesday, Friday: 7 PM
- Tuesday, Thursday: 9 AM
- Saturday: 2 PM
Content Pillars:
- AI & Technology
- Philosophy & Consciousness
- Personal Growth
- Creativity & Innovation
npm run buildnpm run devnpm testnpm run lintMIT License - See LICENSE file for details
This is a personal project, but suggestions and improvements are welcome!
Instagram: @brandonio31 GitHub: @abcnuts
Note: This system respects Instagram's API rate limits and Terms of Service. Always review content before publishing.