npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

instagram-mcp

v1.1.7

Published

MCP server for Instagram API integration via RapidAPI

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-mcp

Option 2: Local Installation

npm install @agent-llama/instagram-mcp
instagram-mcp

Option 3: Development Setup

git clone <repo-url>
cd instagram-mcp
npm install
npm run build
node dist/index.js

Setup

1. Get RapidAPI Key

  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

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_KEY

Configuration 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 analyze
  • timeframe (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 analyze
  • postLimit (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 username
  • competitorAccounts (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 leaders
  • timeframe (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 context
  • depth (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 audit
  • auditDepth (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 analyze
  • growthGoal (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 analysis
  • mediaId (string, optional): Specific post for post-level analysis
  • analysisType (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 accounts

What you'll get:

  • List of relevant accounts in your niche
  • Performance comparison across accounts
  • Engagement quality and audience insights

Development

Build

npm run build

Watch Mode

npm run watch

Test with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

Then 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.