lama-assaf/Instagram-mcp
If you are the rightful owner of Instagram-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
Instagram Content Analyzer MCP Server is a powerful tool that provides advanced Instagram content analysis, competitive intelligence, and growth insights using RapidAPI's Instagram Scraper API.
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.
Table of Contents
- Features
- Quick Start
- Installation
- Configuration
- Available Tools
- Usage Examples
- Development
- API Rate Limits
- Troubleshooting
- Privacy & Legal
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
Quick Start
1. Get RapidAPI Key (2 minutes)
- Visit: https://rapidapi.com/thetechguy32744/api/instagram-scraper-stable-api
- Click "Subscribe to Test"
- Copy your API key from the right panel
2. Install Package (1 minute)
npm install -g instagram-mcp
# OR
npx instagram-mcp
3. Set Environment Variable (1 minute)
macOS/Linux:
export RAPIDAPI_KEY="your_api_key_here"
Windows (Command Prompt):
set RAPIDAPI_KEY=your_api_key_here
Windows (PowerShell):
$env:RAPIDAPI_KEY="your_api_key_here"
4. Start the Server (1 minute)
instagram-mcp
You should see:
Instagram MCP server started
Installation
Option 1: Using NPX (Recommended)
npx instagram-mcp
Option 2: Global Installation
npm install -g instagram-mcp
instagram-mcp
Option 3: Development Setup
git clone https://github.com/agent-llama/instagram-mcp.git
cd instagram-mcp
npm install
cp .env.example .env
# Edit .env and add your RAPIDAPI_KEY
npm run build
node dist/index.js
Configuration
For Claude Desktop App
macOS/Linux: Edit or create ~/.config/Claude/claude_desktop_config.json
Windows: Edit or create %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"instagram": {
"command": "npx",
"args": ["instagram-mcp"],
"env": {
"RAPIDAPI_KEY": "your_api_key_here"
}
}
}
}
Restart Claude.app. You should see "Instagram" in the MCP menu.
For VS Code + Claude Extension
- Open settings:
Cmd+,(macOS) orCtrl+,(Windows/Linux) - Search for "Claude MCP Servers"
- Add this JSON:
{
"instagram": {
"command": "npx",
"args": ["instagram-mcp"],
"env": {
"RAPIDAPI_KEY": "your_api_key_here"
}
}
}
For Development
Create a .env file:
cp .env.example .env
# Edit .env and add your RAPIDAPI_KEY
Available Tools
Content Analysis Tools (8 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
- 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
- Caption strategy
- 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
- Competitive gaps with priority levels
- Best practices from top performers
Example:
Compare "yourbrand" 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"]
#️⃣ 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
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
- 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
- Comment sentiment analysis
- Engagement timing
- Loyalty metrics
- Insights and red flags
Example:
Perform deep engagement analysis for "techcrunch"
Core Data Access Tools (21 Tools)
User Tools (13):
search_user- Search for Instagram users by usernameget_user_profile- Get detailed user profile informationget_user_posts- Retrieve user's postsget_user_followers- Get user's followers listget_user_followings- Get user's following listget_user_reels- Retrieve user's reelsget_user_stories- Get user's active storiesget_user_tagged_posts- Get posts where user is taggedget_user_highlights- Get user's story highlightsget_user_about- Get detailed about informationget_similar_accounts- Find similar accountsget_basic_profile- Get basic profile informationget_user_bio_links- Get bio links
Content Tools (8):
search_hashtag- Search posts by hashtagget_highlight_stories- Get stories from a highlightget_media_data- Get media metadataget_post_comments- Get comments on a postget_comment_replies- Get replies to a commentget_post_likers- Get users who liked a postget_reel_title- Get reel titleget_media_id- Get media ID from URL
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 accounts
What you'll get:
- List of relevant accounts in your niche
- Performance comparison across accounts
- Engagement quality and audience insights
Development
Build Commands
npm run build # Compile TypeScript to dist/
npm run watch # Watch mode compilation
npm run dev # Development mode with hot reload
Testing
npm test # Run tests with Vitest
npm run test:ui # Run tests with UI
npm run test:coverage # Run tests with coverage
Code Quality
npm run lint # Lint TypeScript files
npm run lint:fix # Auto-fix linting issues
npm run format # Format code with Prettier
npm run format:check # Check formatting
npm run type-check # Type check without emitting
Testing with MCP Inspector
Debug and test the server with the official inspector:
npx @modelcontextprotocol/inspector node dist/index.js
Then open http://localhost:5173 in your browser.
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
Troubleshooting
"RAPIDAPI_KEY environment variable is required"
Make sure you've set the environment variable:
export RAPIDAPI_KEY="your_key_here"
echo $RAPIDAPI_KEY # Should print your key
"Authentication failed"
Check that:
- Your API key is correct (no extra spaces)
- Your RapidAPI subscription is active
- Visit https://rapidapi.com/developer/dashboard to verify
"Rate limited"
You've hit the API rate limit. Check your usage at: https://rapidapi.com/developer/dashboard
Wait according to your plan's limits before making more requests.
"User not found"
The Instagram account might be:
- Private (API only works with public accounts)
- Deleted
- Suspended
- Doesn't exist
"Command not found: instagram-mcp"
Try using npx instead:
npx instagram-mcp
Claude doesn't show the MCP server
- Restart Claude.app completely
- Check that the config file path is correct
- Verify the JSON is valid (use JSONLint if unsure)
- Check the logs in Claude.app
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.
Architecture
The server follows a modular tool-based architecture:
- Entry Point (
src/index.ts) - Initializes MCP server with stdio transport - Tool Organization - Divided into user, content, and analytics tools
- API Layer (
src/lib/instagram-api.ts) - Wraps all RapidAPI endpoints - Analytics Engine (
src/analytics.ts) - Core metrics calculations - Content Analyzers - Basic and advanced content analysis
For detailed architecture information, see .
Contributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run the test suite:
npm test - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Guidelines
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting
Support
For issues with the MCP server, create an issue on GitHub.
For API-specific questions, check the RapidAPI documentation.
For MCP protocol help, visit https://modelcontextprotocol.io/
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.