Instagram MCP Server
Allows programmatic control of an Instagram account, including profile management, media interaction, direct messaging, and follower management.
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 MCP Server Send a direct message to user123 saying 'Great shot!'"
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 πΈ
The Instagram MCP Server is a comprehensive Model Context Protocol (MCP) server that allows you to control your Instagram account programmatically and via AI agents. Built with TypeScript and the powerful instagram-private-api library, it provides a wide range of tools for profile management, interacting with media, sending direct messages, and managing followers.
π Features & Available Tools
The server provides the following tools for use via MCP clients:
π€ Profile & Search
ig_get_profile: Fetch comprehensive profile data for any user by their username.ig_search_users: Search for Instagram users using keywords.
πΌοΈ Feeds
ig_get_timeline: Get the recent media feed from your personal timeline.ig_get_user_feed: Get the media feed grid for a specific user.
πΈ Media Interaction
ig_publish_photo: Publish a new photo to your feed (Requires the absolute local path to the image and a text caption).ig_like_media: Like a specific post using its Media ID.ig_comment_media: Add a text comment to a specific post.
π¬ Direct Messages
ig_get_inbox: Fetch the latest conversations and messages from your direct inbox.ig_send_message: Send a direct message to a specific user using their User ID (PK).
π₯ Relationships
ig_follow_user: Send a follow request to a user.ig_unfollow_user: Unfollow a user.ig_get_followers: Extract the list of followers for a specific account.ig_get_following: Extract the list of accounts that a specific user is following.
Related MCP server: Instagram MCP Server
βοΈ Prerequisites
Node.js: Version 18 or newer.
npm or yarn for package management.
An active Instagram account (A dedicated test/bot account is highly recommended to avoid getting your primary account banned).
π Installation & Setup
Access the Project Directory: Make sure you are in the root directory of the project.
Install Dependencies:
npm installSet Up Environment Variables: Create a
.envfile in the root directory and add your Instagram login credentials:IG_USERNAME=your_instagram_username IG_PASSWORD=your_instagram_password
πββοΈ Running the Server
You have multiple options to run the server depending on your environment:
1. Development Mode
Uses ts-node to run TypeScript files directly without a build step:
npm run dev2. Production Mode
Compiles the project to JavaScript first, then runs it:
npm run build
npm start3. Using Docker π³
The project includes a Dockerfile ready to build and run the container easily:
# Build the image
docker build -t instagram-mcp-server .
# Run the container with environment variables
docker run -e IG_USERNAME=your_username -e IG_PASSWORD=your_password -i instagram-mcp-serverπ Client Integration (MCP)
Example: Connecting to Claude Desktop
To link this server with the Claude Desktop app (or any MCP client), edit your client configuration file. (On Windows, Claude's config is usually at C:\Users\Username\AppData\Roaming\Claude\claude_desktop_config.json):
{
"mcpServers": {
"instagram": {
"command": "node",
"args": [
"F:\\MCP_Server\\Instagram_MCP_server\\build\\index.js"
],
"env": {
"IG_USERNAME": "your_username",
"IG_PASSWORD": "your_password"
}
}
}
}Make sure to build the project (npm run build) before referencing the build/index.js path.
β οΈ Important Warnings
Bans & Rate Limits: This project uses
instagram-private-apiwhich relies on unofficial APIs simulating the mobile app. Excessive use (e.g., rapid consecutive likes, following many accounts in a short time) will almost certainly lead to your account being restricted or permanently banned (Action Block / Shadowban).Use With Caution: It is strongly recommended to interact gradually and implement time delays between requests if you plan to automate processes.
Two-Factor Authentication (2FA): Currently, the server supports simple login. If your account has 2FA enabled, the login process might fail. It's recommended to disable it on your test account or implement programmatic handling for 2FA challenges.
π License
Licensed under the ISC License.
Available Tools
13 toolsig_comment_mediaC
Comment on a specific post using its media ID.
Inputs: mediaId (required), text (required).
ig_follow_userC
Follow a user using their userId (pk).
Inputs: userId (required).
ig_get_followersB
Get a list of followers for a user using their userId (pk).
Inputs: userId (required).
ig_get_followingC
Get a list of following users for a user using their userId (pk).
Inputs: userId (required).
ig_get_inboxB
Get recent direct messaging threads from the inbox.
Inputs: no named parameters.
ig_get_profileB
Get profile information for a specific Instagram username.
Inputs: username (required).
ig_get_timelineB
Get the authenticated user's timeline feed.
Inputs: no named parameters.
ig_get_user_feedB
Get the media feed of a specific user by username.
Inputs: username (required).
ig_like_mediaB
Like a specific post using its media ID.
Inputs: mediaId (required).
ig_publish_photoB
Upload a photo to the feed. Requires an absolute image path.
Inputs: imagePath (required), caption (required).
ig_search_usersC
Search for Instagram users by query.
Inputs: query (required).
ig_send_messageC
Send a direct message to a user. Pass userId (pk).
Inputs: userId (required), text (required).
ig_unfollow_userB
Unfollow a user using their userId (pk).
Inputs: userId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 13 tools
Each tool targets a distinct action (comment, follow, get data, like, publish, message, etc.) with clear boundaries. No two tools have overlapping purposes.
All tools follow a consistent ig_verb_noun pattern (e.g., ig_comment_media, ig_get_profile), making the tool set predictable and easy to navigate.
13 tools is a reasonable number for an Instagram server, covering core operations without being excessive. Slightly more could be added for stories or reels, but the current set is well-scoped.
The tool set covers essential Instagram interactions: profile viewing, following/unfollowing, liking, commenting, posting photos, and direct messaging. Missing some features like stories or saved posts, but core workflows are complete.
Related MCP Connectors
Instagram for AI agents: publish, read comments and DMs, insights, and engage from your account.
Instagram and Facebook Pages for AI agents: publish, comments, DM by keyword, inbox, insights.
Instagram MCP for DM and comment automation, AI Agent and content publishing via Meta's official API
Instagram profiles for AI agents β followers, similar accounts, keyword and location search.
Related MCP Servers
- FlicenseBqualityNot gradedmaintenanceEnables AI assistants to interact with Instagram and Facebook accounts through their APIs, supporting messaging, post management, commenting, and content creation.14-
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with Instagram through a comprehensive toolkit for account management, content creation, messaging, social graph analysis, and content discovery.13-
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to interact with Instagram Business accounts through the Graph API, supporting profile management, media publishing, insights retrieval, and direct messaging capabilities.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Instagram Business accounts by automating content publishing, scheduling posts, and analyzing performance metrics. Supports posts, stories, reels, and carousels with detailed audience insights and hashtag discovery.1-