Instagram MCP Server
Provides integration with Instagram's Graph API, enabling AI agents to manage content, analyze post and account performance, research competitors, handle comments, and manage publishing workflows.
Provides integration with Meta's APIs, using Meta App credentials and the Meta Graph API to access Instagram Business accounts and related data.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Instagram MCP ServerWhat were my best performing Reels last month?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Instagram MCP Server
A production-ready Model Context Protocol (MCP) server for interacting with Instagram/Meta APIs. Enables AI agents to manage content, analyze performance, research competitors, and handle publishing workflows through structured MCP tools.
Features
Account Management: Profile retrieval, account insights, media listing
Content Analytics: Post, Reel, and Story insights with engagement metrics
Content Generation: Reel ideas, captions, hashtags, content calendars
Competitor Research: Profile analysis, content comparison, competitor reports
Comment Management: Classification, moderation, auto-reply workflows
Publishing Workflow: Container creation, media publishing, status tracking
Lead Scoring: Business lead analysis with scoring tiers
Audit Logging: Full request/response logging with execution metrics
Related MCP server: Instagram Control MCP Server
Prerequisites
Python 3.10+
Meta Developer App with Instagram Graph API access
Instagram Business Account connected to your Meta App
Quick Start
1. Clone and Install
git clone <repository-url>
cd instagram-mcp
pip install -r requirements.txt2. Configure Environment
cp .env.example .envEdit .env with your credentials:
META_APP_ID=your_meta_app_id
META_APP_SECRET=your_meta_app_secret
INSTAGRAM_ACCESS_TOKEN=your_instagram_access_token
INSTAGRAM_BUSINESS_ACCOUNT_ID=your_instagram_business_account_id3. Run the Server
python server.pyDocker
docker-compose up --buildMCP Client Configuration
Add to your MCP client configuration (e.g., Claude Desktop, Cursor):
{
"mcpServers": {
"instagram": {
"command": "python",
"args": ["server.py"],
"cwd": "/path/to/instagram-mcp"
}
}
}Available Tools
Account Tools
Tool | Description |
| Get profile information |
| Get account-level analytics |
| List media posts |
| Get detailed post info |
Analytics Tools
Tool | Description |
| Post performance metrics |
| Reel performance metrics |
| Story performance metrics |
| Top-performing content |
| Period-over-period comparison |
Content Tools
Tool | Description |
| Analyze post structure |
| Generate Reel concepts |
| Generate captions with hashtags |
| Generate relevant hashtags |
| Create multi-day calendars |
| Identify content patterns |
Competitor Tools
Tool | Description |
| Analyze competitor profile |
| Compare multiple accounts |
| Find top competitor content |
| Full competitor report |
Comment Tools
Tool | Description |
| Get and classify comments |
| Reply to a comment |
| Moderate with classification |
Publishing Tools
Tool | Description |
| Create publish container |
| Publish to Instagram |
| Check publish status |
Lead Tools
Tool | Description |
| Score and analyze leads |
Example Natural Language Commands
"What were my best performing Reels last month?"
→ instagram_get_reel_insights (multiple calls) → sort → analyze → top results
"Generate a 30-day content calendar for an AI automation agency"
→ instagram_generate_content_calendar
"Analyze my competitor @examplebrand"
→ instagram_analyze_competitor → instagram_find_competitor_content
"What comments need moderation on my latest post?"
→ instagram_get_comments → classify → filter
"Compare my engagement with @competitor1 and @competitor2"
→ instagram_compare_accountsAI Decision Layer
The server implements an internal decision pipeline:
User Request - Natural language input
Intent Detection - Determine required operation
Permission Check - Validate API access
Tool Selection - Map to appropriate MCP tool
Instagram API - Execute authorized API call
Data Validation - Validate response data
Analytics/Reasoning - Process and analyze results
Structured Response - Return formatted JSON
Comment Classification
Comments are automatically classified into:
Category | Description |
| Praise, compliments, positive feedback |
| Complaints, criticism, negative sentiment |
| Questions, inquiries |
| Purchase intent, business inquiries |
| Promotional spam, scam content |
| Support requests, issue reports |
| Unclassified comments |
Lead Scoring
Score Range | Tier |
81-100 | Very High |
61-80 | High |
31-60 | Medium |
0-30 | Low |
Scoring factors: follower count, posting frequency, business category, identified needs, website presence.
Error Handling
All tools return structured error responses:
{
"success": false,
"error": {
"code": "RATE_LIMIT",
"message": "Instagram API rate limit reached.",
"retryable": true
}
}Error codes: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, RATE_LIMIT, SERVER_ERROR, NETWORK_ERROR, INVALID_MEDIA, PERMISSION_MISSING
Project Structure
instagram-mcp/
├── server.py # Main MCP server with tool definitions
├── config.py # Configuration management
├── requirements.txt # Python dependencies
├── .env.example # Environment template
├── Dockerfile # Container configuration
├── docker-compose.yml # Docker Compose setup
├── mcp/
│ ├── tools/ # MCP tool implementations
│ │ ├── account.py # Account tools
│ │ ├── analytics.py # Analytics tools
│ │ ├── content.py # Content generation tools
│ │ ├── comments.py # Comment management tools
│ │ ├── publishing.py # Publishing workflow tools
│ │ └── competitors.py # Competitor research tools
│ └── schemas/ # Pydantic data models
│ ├── account.py
│ ├── content.py
│ └── analytics.py
├── services/ # Business logic layer
│ ├── instagram_api.py # Instagram Graph API client
│ ├── analytics.py # Analytics calculations
│ ├── content_ai.py # Content generation engine
│ └── lead_scoring.py # Lead analysis and scoring
├── database/ # Data persistence
│ ├── models.py # SQLAlchemy models
│ └── repository.py # Database operations
└── tests/ # Unit tests
├── test_account.py
├── test_analytics.py
├── test_publishing.py
└── test_errors.pyRunning Tests
pytest tests/ -vSecurity
OAuth 2.0 authentication via Meta Graph API
Access tokens stored in environment variables
No credential scraping or session extraction
Permission validation before operations
Rate-limit handling with retry logic
Audit logging for all tool executions
Never exposes tokens or secrets in responses
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for QPost — lets AI agents publish video and image posts to YouTube, TikTok, Instagram.
Instagram for AI agents: publish, read comments and DMs, insights, and engage from your account.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP server that integrates with Instagram's Graph API to enable AI-driven management of Instagram Business accounts. It provides tools for fetching profile data, publishing media, analyzing engagement metrics, and managing direct messages.182MIT
- AlicenseBqualityCmaintenanceA professional, full-fidelity MCP server enabling AI agents to fully control and manage an Instagram account exactly like a human user.684MIT
- AlicenseBqualityCmaintenanceMCP server that connects AI agents to Instagram for reading statistics, insights, and comments via the official Meta Graph API.162MIT
- AlicenseNot gradedqualityCmaintenanceA production-ready Remote MCP Server that gives Claude direct, tool-based access to your Instagram Business account through the Meta Graph API — profile data, posts, comments, publishing, insights, analytics, hashtags, messaging, and real-time webhooks.26MIT