Install
$ agentstack add mcp-official-arvind-instagram-mcp β scanned Β· β verified β works with Claude Code, Cursor, and more.
Security review
β PassedNo issues found. Passed automated security review. Β· v0.1.0 How review works β
- β Prompt-injection patterns
- β Secret / credential exfiltration
- β Dangerous shell & filesystem operations
- β Untrusted network calls
- β Known-malicious package signatures
What it can access
- β Network access No
- β Filesystem access No
- β Shell / process execution No
- β Environment & secrets No
- β Dynamic code execution No
From automated source analysis of v0.1.0. βUsedβ means the capability is present in the source β more access means more to trust, not that itβs unsafe.
About
π€ Instagram Control MCP Server
[](https://pypi.org/project/instagram-mcp-server/) [](https://github.com/official-Arvind/instagram-mcp/releases) [](LICENSE) [](https://modelcontextprotocol.io)
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](#-key-features) β’ [Installation](#-installation) β’ [Client Config](#%EF%B8%8F-client-configuration) β’ [Authentication](#-authentication-flow) β’ [Tool Reference](#-tool-reference) β’ [Safety Guide](#-rate-limits--safety)
β‘ 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.
π οΈ 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-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
- Open Settings β Features β MCP.
- Click + Add New MCP Server.
- 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.
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 'yourusername' and session id 'copiedcookie_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:
π Authentication & Sessions
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.
πΈ Media Posting & Content Management
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.
π Stories & Highlights
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.
π¬ Direct Messaging
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.
β€οΈ Social Engagement
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.
π₯ Profile & Relationships
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](LICENSE) for more details.
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source β we do not rehost the code.
- Author: official-Arvind
- Source: official-Arvind/instagram-mcp
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet β be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.