instagram-mcp
v1.1.7
Published
MCP server for Instagram API integration via RapidAPI
Maintainers
Readme
1# Instagram Content Analyzer MCP Server
A powerful Model Context Protocol (MCP) server that provides advanced Instagram content analysis, competitive intelligence, and growth insights through RapidAPI's Instagram Scraper API.
Features
Core Data Access (21 Tools)
- User Search & Profiles: Search users, get detailed profile data, bio links, similar accounts
- Content Retrieval: Posts, reels, stories, tagged posts, highlights
- Engagement Data: Comments, comment replies, post likers, media details
- Social Graph: Followers, following lists with verified account support
- Hashtag Discovery: Search and analyze posts by hashtag
Content Analysis Suite (8 Advanced Tools)
- 📊 Account Performance Dashboard: Comprehensive metrics, insights, and recommendations
- 🎯 Content Strategy Analyzer: Deep dive into posting patterns, captions, and optimization
- ⚔️ Competitive Analysis: Compare against competitors with gap analysis
- 🔥 Trending Content Discovery: Identify viral content and trending topics
- #️⃣ Hashtag Performance Analyzer: Evaluate hashtag effectiveness and opportunities
- ✅ Content Quality Audit: Comprehensive quality scoring with action plans
- 🚀 Growth Opportunities: Actionable strategies with implementation roadmap
- 💬 Engagement Deep Dive: Audience quality, sentiment analysis, and optimal timing
Installation
Option 1: Using NPX (Recommended)
npx @agent-llama/instagram-mcpOption 2: Local Installation
npm install @agent-llama/instagram-mcp
instagram-mcpOption 3: Development Setup
git clone <repo-url>
cd instagram-mcp
npm install
npm run build
node dist/index.jsSetup
1. Get RapidAPI Key
- Go to Instagram Scraper Stable API
- Sign up or login to RapidAPI
- Subscribe to the API (free tier available)
- Copy your API key
2. Set Environment Variable
export RAPIDAPI_KEY="your_api_key_here"Or create a .env file:
cp .env.example .env
# Edit .env and add your RAPIDAPI_KEYConfiguration for Claude
In Claude.app
Add to your Claude configuration file:
{
"mcpServers": {
"instagram": {
"command": "node",
"args": ["/path/to/instagram-mcp/dist/index.js"],
"env": {
"RAPIDAPI_KEY": "your_api_key_here"
}
}
}
}In VS Code with Claude Extension
{
"mcpServers": {
"instagram": {
"command": "npx",
"args": ["@agent-llama/instagram-mcp"],
"env": {
"RAPIDAPI_KEY": "your_api_key_here"
}
}
}
}Available Tools
Content Analysis Tools (Advanced)
📊 analyze_account_performance
Comprehensive performance dashboard analyzing engagement rates, content performance, posting patterns, and providing actionable insights.
Parameters:
username(string, required): Instagram username to analyzetimeframe(string, optional): "7d", "30d", "90d", or "all" (default: "30d")includeStories(boolean, optional): Include stories in analysis (default: false)
Returns:
- Account metrics (followers, following, post count)
- Performance metrics (engagement rate, avg likes/comments, posting frequency)
- Performance breakdown by content type (posts vs reels vs stories)
- Top 5 performing content
- Insights and recommendations
Example:
Analyze the account performance for "natgeo" over the last 30 days🎯 analyze_content_strategy
Deep analysis of content patterns, posting schedule, caption quality, and strategic recommendations.
Parameters:
username(string, required): Instagram username to analyzepostLimit(number, optional): Number of posts to analyze (default: 50)analyzeCaptions(boolean, optional): Perform caption analysis (default: true)
Returns:
- Content mix breakdown (photos, carousels, reels percentages)
- Posting schedule analysis (frequency, consistency score)
- Caption strategy (avg length, hashtag usage, CTA usage)
- Performance correlations
- Prioritized recommendations
Example:
Analyze content strategy for "garyvee" including caption analysis⚔️ compare_competitors
Compare your account against competitors with detailed gap analysis and best practices.
Parameters:
primaryAccount(string, required): Your Instagram usernamecompetitorAccounts(array, required): Array of competitor usernames (up to 5)sampleSize(number, optional): Posts to analyze per account (default: 30)
Returns:
- Ranking summary with key strengths and weaknesses
- Comparative metrics table (engagement, posting frequency, content mix)
- Competitive gaps with priority levels
- Best practices from top performers
Example:
Compare "yourshoe brand" against competitors ["nike", "adidas", "puma"]🔥 discover_trending_content
Identify viral content, trending topics, and content opportunities in your niche.
Parameters:
hashtags(array, optional): Hashtags to monitor (without #)nicheAccounts(array, optional): Usernames of niche leaderstimeframe(string, optional): "24h", "7d", or "30d" (default: "7d")minEngagement(number, optional): Minimum engagement threshold (default: 100)
Returns:
- Viral content examples with analysis
- Trending hashtags with performance data
- Content opportunities with implementation guides
- Strategic recommendations
Example:
Discover trending content for hashtags ["fitness", "workout"] from accounts ["kayla_itsines", "joe_wicks"]#️⃣ analyze_hashtag_performance
Evaluate hashtag effectiveness, competition levels, and optimal hashtag strategies.
Parameters:
hashtags(array, required): Hashtags to analyze (without #, max 20)compareAgainst(string, optional): Username for contextdepth(string, optional): "quick" or "deep" (default: "quick")
Returns:
- Individual hashtag scores and recommendations
- Hashtag sets that work well together
- Alternative suggestions for poor performers
- Optimal hashtag strategy (count, mix, placement)
Example:
Analyze performance of hashtags ["contentcreator", "socialmedia", "instagramtips"]✅ audit_content_quality
Comprehensive quality audit with scores, strengths, weaknesses, and actionable improvement plan.
Parameters:
username(string, required): Instagram username to auditauditDepth(number, optional): Number of posts to audit (default: 30)focusAreas(array, optional): ["captions", "visuals", "engagement", "consistency"]
Returns:
- Overall quality score (0-100)
- Category scores (caption quality, visual appeal, engagement, consistency)
- Strengths and weaknesses analysis
- Content pillars detected
- Detailed feedback on top posts
- Step-by-step action plan
Example:
Audit content quality for "marketingexamples" focusing on captions and engagement🚀 identify_growth_opportunities
Discover specific, actionable growth opportunities with implementation timelines.
Parameters:
username(string, required): Instagram username to analyzegrowthGoal(string, optional): "engagement", "followers", "reach", or "sales" (default: "engagement")
Returns:
- Priority opportunities with effort/impact analysis
- Accounts to learn from with key tactics
- Collaboration match suggestions
- Quick wins with implementation guides
- 12-week growth roadmap
Example:
Identify growth opportunities for "startupco" with goal of increasing engagement💬 engagement_deep_dive
Analyze engagement quality, audience behavior, comment sentiment, and optimal timing.
Parameters:
username(string, optional): Username for account-level analysismediaId(string, optional): Specific post for post-level analysisanalysisType(string, optional): "audience_quality", "comment_sentiment", "engagement_timing", or "all" (default: "all")sampleSize(number, optional): Sample size for analysis (default: 100)
Returns:
- Audience quality metrics (bot detection, verified accounts, quality score)
- Comment sentiment analysis with sample comments
- Engagement timing (peak hours, optimal posting times)
- Loyalty metrics (repeat engagers, superfans)
- Insights and red flags
Example:
Perform deep engagement analysis for "techcrunch"Core Data Access Tools (21 Tools)
For detailed documentation on the 21 core data access tools (search_user, get_user_profile, get_user_posts, etc.), see INSTAGRAM_ENDPOINTS.md.
Usage Examples
Use Case 1: Content Creator Optimization
Scenario: You're a content creator wanting to improve your Instagram performance.
1. Analyze account performance for "your_username"
2. Audit content quality for "your_username"
3. Identify growth opportunities for "your_username" with goal "engagement"What you'll get:
- Current performance metrics and trends
- Content quality scores with specific areas to improve
- Actionable growth strategies with 12-week roadmap
Use Case 2: Competitive Intelligence
Scenario: You're a brand wanting to understand your competitive landscape.
1. Compare "your_brand" against competitors ["competitor1", "competitor2", "competitor3"]
2. Analyze content strategy for "top_competitor"
3. Discover trending content for hashtags ["your_industry", "your_niche"]What you'll get:
- Where you rank vs. competitors
- What competitors are doing better
- Trending topics and content formats in your industry
Use Case 3: Hashtag Strategy Optimization
Scenario: You want to maximize your post discoverability.
1. Analyze hashtag performance for ["hashtag1", "hashtag2", "hashtag3", ...]
2. Discover trending content for hashtags ["broad_hashtag1", "broad_hashtag2"]What you'll get:
- Effectiveness scores for each hashtag
- Optimal hashtag combinations
- Trending hashtags with low competition
Use Case 4: Content Strategy Planning
Scenario: You're planning next month's content strategy.
1. Analyze content strategy for "your_username"
2. Discover trending content in your niche
3. Identify growth opportunities for "your_username"What you'll get:
- What content types perform best for you
- What's trending in your niche right now
- Specific content opportunities to pursue
Use Case 5: Influencer Research
Scenario: You're looking for influencers to collaborate with or learn from.
1. Get similar accounts for "your_username"
2. Analyze account performance for each similar account
3. Engagement deep dive for top performing accountsWhat you'll get:
- List of relevant accounts in your niche
- Performance comparison across accounts
- Engagement quality and audience insights
Development
Build
npm run buildWatch Mode
npm run watchTest with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsThen open the Inspector at http://localhost:5173
API Rate Limits
The RapidAPI Instagram Scraper has rate limits depending on your subscription:
- Free Tier: ~100 requests/month
- Pro: ~1000 requests/month
- Enterprise: Custom limits
Monitor your usage in the RapidAPI dashboard
Error Handling
The server handles common errors:
- 401/403: Authentication failed - check your API key
- 404: User or resource not found
- 429: Rate limited - wait before retrying
- 5xx: API server error - try again later
Privacy & Legal
⚠️ Important: Only scrape public Instagram data. Always respect:
- Instagram's Terms of Service
- Local data protection laws (GDPR, CCPA, etc.)
- Users' privacy
This tool is intended for educational and research purposes with public data only.
Troubleshooting
"RAPIDAPI_KEY environment variable is required"
Make sure you've set the environment variable:
export RAPIDAPI_KEY="your_key_here""Authentication failed"
Check that your API key is correct and your RapidAPI subscription is active.
"Rate limited"
You've hit the API rate limit. Wait according to your plan's limits.
"User not found"
The Instagram account might be:
- Private
- Deleted
- Suspended
- Doesn't exist
Support
For issues with the MCP server, create an issue on GitHub.
For API-specific questions, check the RapidAPI documentation.
License
MIT
Disclaimer
This project is not affiliated with Instagram or Facebook. Use responsibly and in compliance with all applicable laws and terms of service.
