Skip to main content
Glama
Instagram Control MCP Server

Instagram Control MCP Server

πŸ€– Instagram Control MCP Server

PyPI version GitHub Release License MCP Compatible

A professional, full-fidelity Model Context Protocol (MCP) server enabling AI agents (like Claude Desktop, Cursor, and custom wrappers) to fully control and manage an Instagram account exactly like a human user.

Key Features β€’ Installation β€’ Client Config β€’ Authentication β€’ Tool Reference β€’ Safety Guide


⚑ Overview

The Instagram Control MCP Server bridges LLMs with the private Instagram Mobile API. By wrapping instagrapi and utilizing FastMCP, this integration gives AI agents a set of 68 granular tools to perform everything from media publishing and direct messaging to relationship management, story uploads, and hashtag explorations.

Unlike simple graph API wrappers, this server works with standard consumer accounts, automatically handles session persistence, supports two-factor authentication (2FA), and resolves SMS/email challenge prompts interactively.


Related MCP server: Instagram MCP Server

πŸ› οΈ Key Features

  • πŸ“¦ Production Ready β€” Install directly via pip or run locally.

  • πŸ” Seamless Auth β€” Session cookies, username/password, 2FA, and SMS/Email verification challenge handlers.

  • πŸš€ Automatic Persistence β€” Saves sessions locally to bypass repeat logins and prevent login flags.

  • πŸ“Έ Rich Media Posting β€” Support for single-photo posts, carousel albums, video feeds, and Reels.

  • πŸ“– Interactive Stories β€” Upload photos/videos directly to stories.

  • πŸ’¬ Frictionless Direct Messages β€” Read threads, mark as seen, and send text, photo, or video messages.

  • πŸ‘₯ Social & Engagement β€” Bulletproof interactions: like, unlike, comment, follow, unfollow, block, and list followers.

  • πŸ” Context Discovery β€” Search users, tags, locations, highlights, and similar profiles.


πŸš€ Installation

You can run this server either as a global package from PyPI or clone it for local modifications.

Installs the package and registers a global CLI entry point instagram-mcp:

pip install instagram-mcp-server

Option B: Local Setup (Development)

Clone the repository, create a virtual environment, and install dependencies:

git clone https://github.com/official-Arvind/instagram-mcp.git
cd instagram-mcp
python -m venv venv

# Windows
venv\Scripts\pip install -e .

# Mac/Linux
venv/bin/pip install -e .

βš™οΈ Client Configuration

Configure your favorite MCP host to locate the executable.

1. Claude Desktop

Add the following to your %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "instagram-control": {
      "command": "instagram-mcp"
    }
  }
}

If using a virtual environment manually, specify the absolute path to the executable:

{
  "mcpServers": {
    "instagram-control": {
      "command": "C:\\path\\to\\instagram-mcp\\venv\\Scripts\\instagram-mcp.exe"
    }
  }
}

2. Cursor IDE

  1. Open Settings β†’ Features β†’ MCP.

  2. Click + Add New MCP Server.

  3. Fill in the parameters:

    • Name: instagram-control

    • Type: command

    • Command: instagram-mcp (or path to your virtual environment's executable)


πŸ” Authentication Flow

To allow your AI agent to operate your account, use one of the following methods.

Bypasses credential inputs, avoids triggering 2FA blocks, and mimics your existing browser session.

  1. Log in to Instagram on your desktop browser.

  2. Open Developer Tools (F12) β†’ Go to Application (Chrome) or Storage (Firefox) β†’ Cookies.

  3. Select https://www.instagram.com and copy the value of the sessionid cookie.

  4. Instruct your agent:

    "Log in using session ID with username 'your_username' and session id 'copied_cookie_value'"

Method 2: Username & Password

If session cookies are not used, prompt the agent with your credentials:

instagram_login_with_credentials(username="your_username", password="your_password")
  • Two-Factor Auth: If the login request triggers 2FA, the agent will receive a challenge response. Provide the code: instagram_complete_2fa(code="123456")

  • Security Verification: If Instagram sends a challenge check (Email/SMS verification), provide the code: instagram_complete_challenge(code="123456")

Session Lifecycle

On successful authentication, the server saves encrypted session cookies in instagram_session.json in the current directory. Subsequent runs will automatically recover this session without prompting for login.


πŸ“‚ Tool Reference

The server exposes 68 specialized tools. Here is the functional breakdown:

  • instagram_login_with_sessionid β€” Authenticate via browser cookie session bypass.

  • instagram_login_with_credentials β€” Authenticate using username + password.

  • instagram_complete_2fa β€” Submit a 2-factor authentication code.

  • instagram_complete_challenge β€” Submit SMS/Email challenge verification code.

  • instagram_get_login_status β€” Query the state of the session lifecycle.

  • instagram_logout β€” Clear local session data and disconnect.

  • instagram_post_photo β€” Upload a single image (supports captions, tags, and locations).

  • instagram_post_album β€” Upload carousel posts (up to 10 images).

  • instagram_post_video β€” Upload standard video content.

  • instagram_post_reel β€” Publish Reels (with custom thumbnails and cover pages).

  • instagram_delete_post β€” Delete feed items by Media PK.

  • instagram_get_user_feed β€” Retrieve published posts for any profile.

  • instagram_get_timeline_feed β€” Fetch the home feed timeline.

  • instagram_get_media_info β€” View exact JSON metadata for any post.

  • instagram_download_post β€” Save media items directly to disk.

  • instagram_post_photo_story β€” Publish a photo story (supports link/hashtag stickers).

  • instagram_post_video_story β€” Publish a video story (supports link/hashtag stickers).

  • instagram_get_user_stories β€” Fetch active stories on any target account.

  • instagram_delete_story β€” Remove active stories.

  • instagram_get_story_viewers β€” Fetch list of story viewers.

  • instagram_get_highlights β€” Fetch highlight categories on a profile.

  • instagram_create_highlight β€” Bundle selected active stories into a new highlight.

  • instagram_delete_highlight β€” Remove custom highlights.

  • instagram_get_direct_threads β€” Fetch ongoing chat threads and inbox lists.

  • instagram_get_direct_messages β€” Retrieve history/chat logs from a thread.

  • instagram_send_direct_message β€” Dispatch text DMs.

  • instagram_send_dm_photo β€” Send photo attachments inside a thread.

  • instagram_send_dm_video β€” Send video attachments inside a thread.

  • instagram_mark_thread_seen β€” Mark incoming messages as read.

  • instagram_like_post / instagram_unlike_post β€” Toggle likes on feed items.

  • instagram_save_post / instagram_unsave_post β€” Toggle bookmarking.

  • instagram_comment_on_post β€” Post a new comment.

  • instagram_reply_to_comment β€” Thread replies under a comment ID.

  • instagram_delete_comment β€” Delete comment instances.

  • instagram_like_comment β€” Like comment targets.

  • instagram_get_post_comments β€” List comments under a post.

  • instagram_get_profile β€” Fetch metadata of any profile.

  • instagram_edit_profile β€” Modify name, bio, and external links.

  • instagram_change_profile_picture β€” Update profile photo.

  • instagram_follow_user / instagram_unfollow_user β€” Toggle follow states.

  • instagram_get_followers / instagram_get_following β€” Query social graphs.

  • instagram_block_user / instagram_unblock_user β€” Manage blocklists.

  • instagram_get_blocked_users β€” View current blocks.

  • instagram_get_notifications β€” Read current activity notifications (likes, tags, comments).

  • instagram_get_pending_follow_requests β€” List incoming follow requests.


⚠️ Rate Limits & Safety

Because this server connects using the private mobile client layer, it is subject to Instagram's rate limit filters. To prevent account suspension or temporary blocks, adhere to these guidelines:

  1. Avoid High-Frequency Actions β€” Spread out posting, liking, and messaging. Do not script loops that execute multiple social actions in rapid succession.

  2. Mimic Human Timing β€” If scripting routines, inject random delays (time.sleep(20, 60)) between events.

  3. Warm-Up New Accounts β€” Freshly created profiles are flags for automation blocks. Use an established account or warm up a new account gradually.

  4. Use Cookie Sessions β€” Cookie login triggers far fewer security flags than standard username/password authentication.


πŸ›‘οΈ Disclaimer

This software is for educational purposes only. It interacts with Instagram's private APIs and is not endorsed, affiliated with, or supported by Meta Platforms Inc. Continued automation may result in temporary limits, shadowbans, or permanent closure of your account. Use responsibly at your own risk.


πŸ“„ License

Distributed under the MIT License. See LICENSE for more details.

Available Tools

68 tools
instagram_archive_postB

Archive a post (hides it from your profile grid, but keeps it saved). Archived posts can be found in your Archive section.

Inputs: media_id_or_url (required). Returns: result

instagram_block_userB

Block a user by username.

Inputs: username (required). Returns: result

instagram_change_profile_pictureB

Change the profile picture. Accepts local file path or image URL.

Inputs: image_path_or_url (required). Returns: result

instagram_comment_on_postC

Post a comment on any media item.

Inputs: media_id_or_url (required), text (required). Returns: result

instagram_complete_2faA

Submit the 2FA authenticator code after login returned 'needs_2fa'.

Inputs: code (required). Returns: result

instagram_complete_challengeA

Submit the email/SMS challenge code after login returned 'needs_challenge'.

Inputs: code (required). Returns: result

instagram_create_highlightB

Create a new story highlight collection from existing stories.

Inputs: title (required), story_ids (required). Returns: result

instagram_delete_commentB

Delete a comment by media ID/URL and comment ID.

Inputs: media_id_or_url (required), comment_id (required). Returns: result

instagram_delete_highlightB

Delete a highlights collection by its ID.

Inputs: highlight_id (required). Returns: result

instagram_delete_postA

Permanently delete a post. This cannot be undone.

Inputs: media_id_or_url (required). Returns: result

instagram_delete_storyC

Delete one of your active stories by media ID.

Inputs: story_id (required). Returns: result

instagram_disable_commentsC

Disable comments on a post.

Inputs: media_id_or_url (required). Returns: result

instagram_download_postC

Download a post's photo or video to local disk.

Inputs: media_id_or_url (required), save_dir. Returns: result

instagram_edit_post_captionB

Edit the caption of an existing post.

Parameters:

  • media_id_or_url: Post media ID or full Instagram URL

  • new_caption: The new caption text (replaces the old one entirely)

  • hashtags: Hashtags to append to the new caption

  • mentions: @mentions to append to the new caption

Inputs: media_id_or_url (required), new_caption (required), hashtags, mentions. Returns: result

instagram_edit_profileA

Edit the logged-in account's profile.

  • full_name: Display name

  • biography: Bio text (supports emojis, newlines, @mentions, #hashtags)

  • external_url: Website link in bio Only fields you provide are updated.

Inputs: full_name, biography, external_url. Returns: result

instagram_enable_commentsA

Enable comments on a post (reverses a previous disable).

Inputs: media_id_or_url (required). Returns: result

instagram_follow_userC

Follow a user by username.

Inputs: username (required). Returns: result

instagram_get_blocked_usersA

Get the full list of users you have blocked.

Inputs: no named parameters. Returns: result

instagram_get_direct_messagesC

Get messages in a DM thread, sorted chronologically.

Inputs: thread_id (required), amount. Returns: result

instagram_get_direct_threadsA

Get recent DM threads with thread IDs, participants, and last activity.

Inputs: amount. Returns: result

instagram_get_followersA

Get the followers list for the logged-in account or a target username.

Inputs: username, amount. Returns: result

instagram_get_followingA

Get the accounts that the logged-in account (or target username) is following.

Inputs: username, amount. Returns: result

instagram_get_hashtag_infoA

Get information about a hashtag including total post count.

Inputs: hashtag (required). Returns: result

instagram_get_hashtag_top_postsA

Get trending/top posts for a hashtag. Do not include '#' symbol.

Inputs: hashtag (required), amount. Returns: result

instagram_get_highlightsB

Get story highlights for the logged-in account or a target username.

Inputs: username. Returns: result

instagram_get_location_postsC

Get recent posts tagged at a specific location.

Inputs: location_name (required), amount. Returns: result

instagram_get_login_statusA

Check if the server is authenticated and which account is active.

Inputs: no named parameters. Returns: result

instagram_get_media_infoA

Get detailed information about any post by ID or URL.

Inputs: media_id_or_url (required). Returns: result

instagram_get_notificationsB

Get recent activity β€” likes, comments, follows, mentions, tags.

Inputs: amount. Returns: result

instagram_get_pending_follow_requestsA

Get pending follow requests for your account (relevant for private accounts).

Inputs: no named parameters. Returns: result

instagram_get_post_commentsB

Get comments on a post with usernames, text, and timestamps.

Inputs: media_id_or_url (required), amount. Returns: result

instagram_get_post_likersC

Get the list of users who liked a post.

Inputs: media_id_or_url (required). Returns: result

instagram_get_profileB

Get full profile details for the logged-in account or any target username. Includes bio, follower/following counts, post count, website, verification status.

Inputs: username. Returns: result

instagram_get_saved_postsB

Get posts saved in your Saved collection.

Inputs: amount. Returns: result

instagram_get_similar_accountsB

Find accounts similar to a given username (Instagram's 'suggested for you').

Inputs: username (required). Returns: result

instagram_get_story_viewersC

Get the list of users who viewed one of your stories.

Inputs: story_id (required). Returns: result

instagram_get_tagged_postsB

Get posts where the logged-in account (or a target username) is tagged.

Inputs: username, amount. Returns: result

instagram_get_timeline_feedC

Get the home timeline feed β€” posts from accounts you follow.

Inputs: amount. Returns: result

instagram_get_user_feedB

Get recent posts from the logged-in account or any target username.

Inputs: username, amount. Returns: result

instagram_get_user_storiesC

Get active stories for the logged-in account or a target username.

Inputs: username. Returns: result

instagram_like_commentC

Like a comment on a post.

Inputs: comment_id (required). Returns: result

instagram_like_postB

Like a post by media ID or URL.

Inputs: media_id_or_url (required). Returns: result

instagram_login_with_credentialsA

Log in using username + password. Returns 'needs_2fa' or 'needs_challenge' if verification is required.

Inputs: username (required), password (required). Returns: result

instagram_login_with_sessionidA

Log in via browser sessionid cookie β€” most reliable, bypasses 2FA. Get it: Instagram.com β†’ F12 β†’ Application β†’ Cookies β†’ copy 'sessionid'.

Inputs: username (required), session_id (required). Returns: result

instagram_logoutA

Log out and delete the saved session file from disk.

Inputs: no named parameters. Returns: result

instagram_mark_thread_seenC

Mark a DM thread as seen/read.

Inputs: thread_id (required). Returns: result

instagram_pin_postB

Pin a post to the top of your profile grid. You can pin up to 3 posts on your profile.

Inputs: media_id_or_url (required). Returns: result

instagram_post_albumB

Post a carousel album (2–10 photos/videos) with full caption control.

Parameters:

  • image_paths_or_urls: List of local paths or URLs (up to 10 items)

  • caption: Main caption text

  • hashtags: Comma-separated hashtags (e.g. "#travel, #photography")

  • mentions: Comma-separated @mentions (e.g. "@friend1, @brand")

  • location_name: Location tag string

  • disable_comments: Set True to disable comments

Inputs: image_paths_or_urls (required), caption (required), hashtags, mentions, +2 more. Returns: result

instagram_post_photoA

Post a photo to the Instagram feed with FULL control.

Parameters:

  • image_path_or_url: Local file path or direct image URL

  • caption: Main post caption/description text

  • hashtags: Comma-separated hashtags to append (e.g. "#python, #ai, #coding")

  • mentions: Comma-separated @usernames to mention in caption (e.g. "@nasa, @google")

  • tag_users_in_photo: Comma-separated @usernames to physically TAG in the image (people tags)

  • location_name: Location to tag (e.g. "New York, USA" or "Eiffel Tower")

  • alt_text: Accessibility alt text describing the image content

  • disable_comments: Set True to disable comments on this post

  • hide_likes: Set True to hide like count from others

Inputs: image_path_or_url (required), caption (required), hashtags, mentions, +5 more. Returns: result

instagram_post_photo_storyA

Post a photo Story with full sticker support.

Parameters:

  • image_path_or_url: Local path or image URL

  • mentions: Comma-separated @usernames to add as mention stickers

  • hashtags: Comma-separated hashtags for hashtag stickers

  • location_name: Location sticker text

  • link_url: Link sticker URL (the swipe-up / link button on story)

  • close_friends_only: Post only to your Close Friends list

Inputs: image_path_or_url (required), mentions, hashtags, location_name, +2 more. Returns: result

instagram_post_reelA

Post a Reel with full caption control. Reels have the highest organic reach.

Parameters:

  • video_path_or_url: Local path or URL to MP4 video

  • caption: Caption text

  • hashtags: Comma-separated hashtags (crucial for Reel discovery)

  • mentions: Comma-separated @mentions

  • location_name: Location tag

  • disable_comments: Set True to disable comments

Inputs: video_path_or_url (required), caption (required), hashtags, mentions, +2 more. Returns: result

instagram_post_videoB

Post a video to the feed with full caption control.

Parameters:

  • video_path_or_url: Local path or URL to MP4 file

  • caption: Caption text

  • hashtags: Comma-separated hashtags

  • mentions: Comma-separated @mentions

  • location_name: Location to tag

  • thumbnail_path_or_url: Custom thumbnail image (optional)

  • alt_text: Accessibility description for the video

  • disable_comments: Set True to disable comments

Inputs: video_path_or_url (required), caption (required), hashtags, mentions, +4 more. Returns: result

instagram_post_video_storyB

Post a video Story with full sticker support.

Parameters:

  • video_path_or_url: Local path or URL to MP4

  • mentions: Comma-separated @usernames for mention stickers

  • hashtags: Comma-separated hashtags for hashtag stickers

  • location_name: Location sticker text

  • link_url: Link sticker URL

  • close_friends_only: Post only to Close Friends

Inputs: video_path_or_url (required), mentions, hashtags, location_name, +2 more. Returns: result

instagram_reply_to_commentC

Reply to a specific comment on a post.

Inputs: media_id_or_url (required), comment_id (required), text (required). Returns: result

instagram_save_postB

Save a post to your Saved collection.

Inputs: media_id_or_url (required). Returns: result

instagram_search_hashtagA

Get recent posts for a hashtag. Do not include '#' symbol.

Inputs: hashtag (required), amount. Returns: result

instagram_search_usersA

Search for Instagram users by name or username.

Inputs: query (required), count. Returns: result

instagram_send_direct_messageA

Send a text DM. Provide either:

  • username: to start or continue a conversation with a user.

  • thread_id: to reply in an existing thread.

Inputs: text (required), username, thread_id. Returns: result

instagram_send_dm_photoC

Send a photo via DM. Provide username or thread_id.

Inputs: image_path_or_url (required), username, thread_id. Returns: result

instagram_send_dm_videoB

Send a video via DM. Provide username or thread_id.

Inputs: video_path_or_url (required), username, thread_id. Returns: result

instagram_set_post_alt_textB

Attempt to set accessibility alt text on an existing post via the private API. Alt text describes the image content for visually impaired users.

Parameters:

  • media_id_or_url: Post media ID or full Instagram URL

  • alt_text: Text description of the image/video content

Inputs: media_id_or_url (required), alt_text (required). Returns: result

instagram_tag_users_in_postA

Tag one or more users physically IN a photo (people tags). NOTE: Instagram's API only supports setting usertags at upload time. Use the tag_users_in_photo parameter in instagram_post_photo/post_reel instead. This tool attempts a post-upload tag via the private endpoint.

Parameters:

  • media_id_or_url: Post media ID or Instagram URL

  • usernames: Comma-separated @usernames to tag in the photo

Inputs: media_id_or_url (required), usernames (required). Returns: result

instagram_unarchive_postC

Unarchive a post (restores it to your profile grid).

Inputs: media_id_or_url (required). Returns: result

instagram_unblock_userC

Unblock a previously blocked user.

Inputs: username (required). Returns: result

instagram_unfollow_userC

Unfollow a user by username.

Inputs: username (required). Returns: result

instagram_unlike_postC

Remove a like from a post.

Inputs: media_id_or_url (required). Returns: result

instagram_unpin_postA

Remove a pinned post from the top of your profile grid.

Inputs: media_id_or_url (required). Returns: result

instagram_unsave_postB

Remove a post from your Saved collection.

Inputs: media_id_or_url (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 68 tools

    Disambiguation5/5

    Each tool has a very specific purpose with detailed descriptions that clearly differentiate them. Even similar tools like post_photo, post_video, and post_reel have distinct parameters and use cases, leaving no ambiguity.

    Naming Consistency5/5

    All tools follow the exact same 'instagram_verb_noun' pattern with snake_case. This is perfectly consistent across all 68 tools, making it easy to predict tool names.

    Tool Count3/5

    68 tools is quite high for an MCP server. While each tool covers a distinct Instagram feature, the sheer number could be overwhelming. Some tools like the various post types could potentially be consolidated, but the count is still within a reasonable range for a full-featured client.

    Completeness4/5

    The toolset is extensive, covering login, profile, posts, stories, highlights, comments, likes, DMs, and more. It includes advanced features like 2FA, alt text, and reels. Minor gaps exist, such as managing close friends list or live streaming, but overall, it covers the vast majority of Instagram interactions.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An 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.
      206
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Instagram Graph API integration, enabling AI applications to manage Instagram Business accounts: fetch profiles, media, insights, publish content, and handle DMs.
      MIT