MCP server for Instagram API integration via RapidAPI
npm install instagram-mcp1# 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.
``bash`
npx @agent-llama/instagram-mcp
`bash`
npm install @agent-llama/instagram-mcp
instagram-mcp
`bash`
git clone
cd instagram-mcp
npm install
npm run build
node dist/index.js
1. Go to Instagram Scraper Stable API
2. Sign up or login to RapidAPI
3. Subscribe to the API (free tier available)
4. Copy your API key
`bash`
export RAPIDAPI_KEY="your_api_key_here"
Or create a .env file:
`bash`
cp .env.example .envEdit .env and add your RAPIDAPI_KEY
Add to your Claude configuration file:
`json`
{
"mcpServers": {
"instagram": {
"command": "node",
"args": ["/path/to/instagram-mcp/dist/index.js"],
"env": {
"RAPIDAPI_KEY": "your_api_key_here"
}
}
}
}
`json`
{
"mcpServers": {
"instagram": {
"command": "npx",
"args": ["@agent-llama/instagram-mcp"],
"env": {
"RAPIDAPI_KEY": "your_api_key_here"
}
}
}
}
#### š 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"
For detailed documentation on the 21 core data access tools (search_user, get_user_profile, get_user_posts, etc.), see INSTAGRAM_ENDPOINTS.md.
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
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
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
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
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 accounts
What you'll get:
- List of relevant accounts in your niche
- Performance comparison across accounts
- Engagement quality and audience insights
`bash`
npm run build
`bash`
npm run watch
`bash`
npx @modelcontextprotocol/inspector node dist/index.js
Then open the Inspector at http://localhost:5173
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
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
ā ļø 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.
Make sure you've set the environment variable:
`bash``
export RAPIDAPI_KEY="your_key_here"
Check that your API key is correct and your RapidAPI subscription is active.
You've hit the API rate limit. Wait according to your plan's limits.
The Instagram account might be:
- Private
- Deleted
- Suspended
- Doesn't exist
For issues with the MCP server, create an issue on GitHub.
For API-specific questions, check the RapidAPI documentation.
MIT
This project is not affiliated with Instagram or Facebook. Use responsibly and in compliance with all applicable laws and terms of service.