Instagram Control MCP Server
Provides tools to fully control and manage an Instagram account, including media posting, stories, direct messaging, social engagement, profile management, and authentication with session persistence and 2FA support.
Click on "Deploy 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 Control MCP Server Post a picture of my dog to Instagram"
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 Control MCP Server
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
pipor 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.
Option A: Install from PyPI (Recommended)
Installs the package and registers a global CLI entry point instagram-mcp:
pip install instagram-mcp-serverOption 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
Open Settings β Features β MCP.
Click + Add New MCP Server.
Fill in the parameters:
Name:
instagram-controlType:
commandCommand:
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.
Method 1: Session Cookie (Recommended & Safest)
Bypasses credential inputs, avoids triggering 2FA blocks, and mimics your existing browser session.
Log in to Instagram on your desktop browser.
Open Developer Tools (F12) β Go to Application (Chrome) or Storage (Firefox) β Cookies.
Select
https://www.instagram.comand copy the value of thesessionidcookie.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:
Avoid High-Frequency Actions β Spread out posting, liking, and messaging. Do not script loops that execute multiple social actions in rapid succession.
Mimic Human Timing β If scripting routines, inject random delays (
time.sleep(20, 60)) between events.Warm-Up New Accounts β Freshly created profiles are flags for automation blocks. Use an established account or warm up a new account gradually.
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 toolsinstagram_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
Scored across 68 tools
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.
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.
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.
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
Related MCP Connectors
Hosted Instagram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Instagram MCP for DM and comment automation, AI Agent and content publishing via Meta's official API
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.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that enables integration with Instagram, allowing interaction with Instagram features through the Model Context Protocol.1518 npm9MIT
- AlicenseNot gradedqualityDmaintenanceAn 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.206MIT
- AlicenseBqualityFmaintenanceMCP server that connects AI agents to Instagram for reading statistics, insights, and comments via the official Meta Graph API.162MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for Instagram Graph API integration, enabling AI applications to manage Instagram Business accounts: fetch profiles, media, insights, publish content, and handle DMs.MIT