Instagram MCP Server

$pip install -e .
README.md

AI-driven management of Instagram Business accounts via Graph API

Instagram MCP Server

A Model Context Protocol (MCP) server that provides seamless integration with Instagram's Graph API, enabling AI applications to interact with Instagram Business accounts programmatically.

Features

🔧 Tools (Model-controlled)

  • Get Profile Info: Retrieve Instagram business profile details
  • Get Media Posts: Fetch recent posts from an Instagram account
  • Get Media Insights: Retrieve engagement metrics for specific posts
  • Publish Media: Upload and publish images/videos to Instagram
  • Get Account Pages: List Facebook pages connected to the account
  • Get Conversations: List Instagram DM conversations (requires Advanced Access)
  • Get Conversation Messages: Read messages from specific conversations (requires Advanced Access)
  • Send DM: Reply to Instagram direct messages (requires Advanced Access)

📊 Resources (Application-controlled)

  • Profile Data: Access to profile information including follower counts, bio, etc.
  • Media Feed: Recent posts with engagement metrics
  • Insights Data: Detailed analytics for posts and account performance

💬 Prompts (User-controlled)

  • Analyze Engagement: Pre-built prompt for analyzing post performance
  • Content Strategy: Template for generating content recommendations
  • Hashtag Analysis: Prompt for hashtag performance evaluation

Prerequisites

  1. Instagram Business Account: Must be connected to a Facebook Page
  2. Facebook Developer Account: Required for API access
  3. Access Token: Long-lived access token with appropriate permissions
  4. Python 3.10+: For running the MCP server (required by MCP dependencies)

Required Instagram API Permissions

Standard Access (available immediately):

  • instagram_basic
  • instagram_content_publish
  • instagram_manage_insights
  • instagram_manage_comments
  • pages_show_list
  • pages_read_engagement
  • pages_manage_metadata
  • pages_read_user_content
  • business_management

Advanced Access (requires Meta App Review):

  • instagram_manage_messages - Required for Direct Messaging features

⚠️ Instagram DM Features: Reading and sending Instagram direct messages requires Advanced Access approval from Meta. See INSTAGRAM_DM_SETUP.md for the App Review process.

🔑 How to Get Instagram API Credentials

📖 Quick Start: See AUTHENTICATION_GUIDE.md for a 5-minute setup guide!

This section provides a step-by-step guide to obtain the necessary credentials for the Instagram MCP server.

Step 1: Set Up Instagram Business Account

  1. Convert to Business Account (if not already):

    • Open Instagram app → Settings → Account → Switch to Professional Account
    • Choose "Business" → Select a category → Complete setup
  2. Connect to Facebook Page:

    • Go to Instagram Settings → Account → Linked Accounts → Facebook
    • Connect to an existing Facebook Page or create a new one
    • Important: The Facebook Page must be owned by you

Step 2: Create Facebook App

  1. Go to Facebook Developers:

  2. Create New App:

    • Click "Create App" → Choose "Business" → Click "Next"
    • Fill in app details:
      • App Name: Choose a descriptive name (e.g., "My Instagram MCP Server")
      • App Contact Email: Your email address
    • Click "Create App"
  3. Add Instagram Basic Display Product:

    • In your app dashboard, click "Add Product"
    • Find "Instagram Basic Display" → Click "Set Up"
  4. Configure Instagram Basic Display:

    • Go to Instagram Basic Display → Basic Display
    • Click "Create New App" in the Instagram App section
    • Accept the terms and create the app

Step 3: Get App Credentials

  1. Get App ID and Secret:
    • In your Facebook app dashboard, go to Settings → Basic
    • Copy your App ID and App Secret
    • Important: Keep the App Secret secure and never share it publicly

Step 4: Set Up Instagram Business API Access

  1. Add Instagram Graph API Product:

    • In your app dashboard, click "Add Product"
    • Find "Instagram Graph API" → Click "Set Up"
  2. Configure Permissions:

    • Go to Instagram Graph API → Permissions
    • Request the following permissions:
      • instagram_basic
      • instagram_content_publish
      • instagram_manage_insights
      • pages_show_list
      • pages_read_engagement

Step 5: Generate Access Token

Option A: Using Facebook Graph API Explorer (Recommended for Testing)
  1. Go to Graph API Explorer:

Tools (8)

get_profile_infoRetrieve Instagram business profile details including follower counts and bio.
get_media_postsFetch recent posts from an Instagram account.
get_media_insightsRetrieve engagement metrics for specific posts.
publish_mediaUpload and publish images or videos to Instagram.
get_account_pagesList Facebook pages connected to the account.
get_conversationsList Instagram DM conversations (requires Advanced Access).
get_conversation_messagesRead messages from specific conversations (requires Advanced Access).
send_dmReply to Instagram direct messages (requires Advanced Access).

Environment Variables

INSTAGRAM_ACCESS_TOKENrequiredLong-lived access token with appropriate permissions
INSTAGRAM_BUSINESS_ACCOUNT_IDrequiredThe ID of the Instagram Business account

Configuration

claude_desktop_config.json
{"mcpServers":{"instagram":{"command":"python","args":["-m","ig_mcp"],"env":{"INSTAGRAM_ACCESS_TOKEN":"your_token_here","INSTAGRAM_BUSINESS_ACCOUNT_ID":"your_id_here"}}}}

Try it

Fetch my recent Instagram posts and show me the engagement metrics for each.
Analyze my profile performance and suggest a content strategy based on my most successful posts.
Check my Instagram DMs and summarize the latest conversations.
Publish this image to my Instagram business account with a caption about our new product launch.
List all Facebook pages connected to my Instagram account.

Frequently Asked Questions

What are the key features of Instagram MCP Server?

Model-controlled tools for publishing media and fetching profile insights.. Resource access to profile data, media feeds, and detailed analytics.. Support for Instagram Direct Messaging including reading and sending messages.. Pre-built prompts for engagement analysis and hashtag evaluation..

What can I use Instagram MCP Server for?

Social Media Managers using AI to automate post publishing and performance reporting.. Customer Support teams managing Instagram DMs through an AI interface.. Marketing Analysts performing deep dives into post engagement and follower growth.. Content Creators seeking AI-driven recommendations for hashtag and content strategy..

How do I install Instagram MCP Server?

Install Instagram MCP Server by running: pip install -e .

What MCP clients work with Instagram MCP Server?

Instagram MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Instagram MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free