Insta MCP Server
Provides integration with Instagram, enabling interaction with Instagram's platform through the Model Context Protocol.
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., "@Insta MCP Server show me my latest Instagram posts"
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.
Insta MCP Server
MCP (Model Context Protocol) server for Instagram integration.
Features
Comprehensive Access: View user profiles, timelines, stories, and detailed post information.
Smart Engagement: Like posts, comments, and follow users directly from your MCP client.
Search & Discovery: Powerful search capabilities to find accounts and explore content.
Secure login: Username and password with two-factor prompts (email, SMS or authenticator app), or the session of a browser where you are already logged in.
Developer Ready: Works with Claude Code, Claude Desktop, VS Code, Cursor, and other MCP-compatible clients.
Related MCP server: Instagram MCP Server
Requirements
Node.js 22 or newer (
node --version). Node 20 reached end-of-life on 2026-04-30.An Instagram account. Prefer a secondary account; see the disclaimer below.
Logging in
There are two ways to log in. Either way, the session is saved privately and reused after restarts, so you only log in once (see Session storage).
Username and password
Set IG_USERNAME and IG_PASSWORD, as in the client examples below. The server logs in the way the current Instagram Android app does: the password is encrypted with Instagram's public key, sent once, and never written to disk.
If the account uses two-factor authentication, or Instagram wants to confirm a login from a new device, Instagram sends a code by email, SMS or authenticator app. You enter it on a one-time page the server opens on your own machine, so the code never passes through the assistant. See Two-factor authentication.
Instagram watches for repeated logins, so the server allows at most one password login per minute (see Rate limits), and a new device may need to be confirmed in the Instagram app the first time.
Browser session cookie
Instead of a password, you can give the server the session of a browser where you are logged in to Instagram (IG_SESSION_ID). No password or two-factor code is involved:
Log in to instagram.com in a browser (a private window works).
Open the developer tools: Application (Chrome, Edge) or Storage (Firefox), then Cookies, then
https://www.instagram.com.Copy the value of the
sessionidcookie. It starts with your numeric user id, followed by%3A.Set it as
IG_SESSION_IDin your MCP client's server configuration, in place ofIG_USERNAMEandIG_PASSWORD.Close the tab, but don't log out in that browser: logging out ends the session the server is using.
The session cookie gives full access to the account, so treat it like a password. If Instagram ends the session (for example after you log out or change your password), copy a fresh cookie into IG_SESSION_ID and restart the server. instagram_logout ends the session on Instagram, which also logs out the browser the cookie came from.
When both are configured, IG_SESSION_ID is used first.
Installation for MCP Clients
The server runs locally over stdio and is published on npm, so every client below starts it with npx -y mcp-instagram.
Claude Code
claude mcp add --env IG_USERNAME=your_username --env IG_PASSWORD=your_password --transport stdio instagram -- npx -y mcp-instagramKeep --transport stdio between the last --env and the server name; otherwise the name is read as another KEY=value pair. Add --scope user to make the server available in every project.
claude mcp add stores the values in your Claude Code config file in plain text. To keep the password out of config files, put the server in a project .mcp.json and reference variables from your shell environment instead:
{
"mcpServers": {
"instagram": {
"command": "npx",
"args": ["-y", "mcp-instagram"],
"env": {
"IG_USERNAME": "${IG_USERNAME}",
"IG_PASSWORD": "${IG_PASSWORD}"
}
}
}
}Claude Desktop
One-click bundle. Starting with the first release after 0.0.6, each GitHub release includes mcp-instagram-<version>.mcpb. Open the file (double-click, or drag it into Claude Desktop's Settings > Extensions). Claude Desktop asks for your Instagram username and password (or a session cookie, see Logging in), masks the secrets, and runs the server with its built-in Node.js, so no separate Node install or JSON editing is needed. To build the bundle yourself: yarn build && node scripts/pack-mcpb.mjs.
Manual configuration:
Locate your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Open the configuration file (create it if it doesn't exist) and add the following to the
mcpServerssection:
{
"mcpServers": {
"mcp-instagram": {
"command": "npx",
"args": [
"-y",
"mcp-instagram"
],
"env": {
"IG_USERNAME": "your_instagram_username",
"IG_PASSWORD": "your_instagram_password"
}
}
}
}Replace the credentials with your Instagram username and password, or use
IG_SESSION_IDinstead; see Logging in.Restart Claude Desktop for the changes to take effect. You should then see the Instagram MCP server in the list of available tools.
VS Code
Add this to .vscode/mcp.json in your workspace. VS Code prompts for the username and password when the server starts and masks the password, so neither is written into the file:
{
"inputs": [
{
"type": "promptString",
"id": "ig-username",
"description": "Instagram username"
},
{
"type": "promptString",
"id": "ig-password",
"description": "Instagram password",
"password": true
}
],
"servers": {
"instagram": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-instagram"],
"env": {
"IG_USERNAME": "${input:ig-username}",
"IG_PASSWORD": "${input:ig-password}"
}
}
}
}Cursor
Locate your Cursor MCP configuration file:
Workspace config:
.cursor/mcp.json(in your project root)Global config:
~/.cursor/mcp.json
Open the configuration file (create it if it doesn't exist) and add the following to the
mcpServerssection:
{
"mcpServers": {
"mcp-instagram": {
"command": "npx",
"args": [
"-y",
"mcp-instagram"
],
"env": {
"IG_USERNAME": "your_instagram_username",
"IG_PASSWORD": "your_instagram_password"
}
}
}
}Replace the credentials with your Instagram username and password, or use
IG_SESSION_IDinstead; see Logging in.Restart Cursor for the changes to take effect.
Running from a local clone
git clone https://github.com/anand-kamble/mcp-instagram.git
cd mcp-instagram
yarn install --frozen-lockfile
yarn buildThen point your client at the built entry point instead of npx:
{
"mcpServers": {
"mcp-instagram": {
"command": "node",
"args": ["/absolute/path/to/mcp-instagram/bin/insta-mcp.js"],
"env": {
"IG_USERNAME": "your_instagram_username",
"IG_PASSWORD": "your_instagram_password"
}
}
}
}Configuration
All configuration is through environment variables set in your MCP client's server entry.
Variable | Required | Description |
| For password login | Instagram username (an email or phone number also works for login). If it is a username, the server also refuses a saved session that belongs to a different account. |
| For password login | Instagram password. Sent once, encrypted, at login; never written to disk. Like any environment variable it stays in the server process's memory. |
| Instead of a password | The |
| No | Directory for the saved session. Default: |
| No | Diagnostics: a directory where a password login that hits an Instagram screen the server cannot handle saves Instagram's responses (tokens and session ids removed, file mode 0600). Off by default; the files can still contain account details, so delete them after sharing. |
| No | JSON overrides for the write-action limits, for example |
Session storage
After a successful login, the server saves the Instagram session (cookies and device identifiers) to session.json in the session directory above, so restarts do not require logging in again. Anyone who can read that file can act as your Instagram account, so the server creates the directory with mode 0700 and the file with mode 0600, and writes it atomically. instagram_logout ends the session on Instagram (when Instagram is reachable) and deletes the file.
Versions up to 0.0.6 stored the session in data/session.json inside the package directory (under npx, that is the npm cache). On first start, the current version moves such a file to the new location and removes the old copy. This happens only when IG_SESSION_DIR is not set, and only for the package directory, never the directory your MCP client runs in.
If IG_USERNAME is set and the saved session (or IG_SESSION_ID) belongs to a different account, the server refuses it. When IG_SESSION_ID changes, the server logs in with the new value instead of the saved session. Session files written by earlier versions are converted on first start and keep you logged in.
Rate limits
Instagram restricts accounts that like, comment or follow in fast bursts, and locks accounts behind a security checkpoint after repeated logins. To keep an agent loop from getting the account blocked, the server limits write actions and logins per process. When a limit is reached, the tool returns an error saying when to retry, and nothing is sent to Instagram.
Action | Per minute | Per hour | Per day |
like / unlike (posts and comments) | 10 | 60 | 500 |
comment | 3 | 20 | 100 |
follow / unfollow | 5 | 30 | 150 |
login (including the automatic login at startup) | 1 | 5 | 10 |
Instagram does not publish its limits, so these defaults are deliberately conservative rather than derived from Instagram's numbers. Override any subset with IG_RATE_LIMITS, using the keys like, comment, follow, login and perMinute, perHour, perDay. Counters are kept in memory and reset when the server restarts.
Security Notes
Never commit your session cookie or credentials to version control. Prefer the Claude Code
${VAR}or VS Codeinputssetups above over plain-text values in config files.Credentials are never requested from the LLM. They come only from environment variables.
The saved session is a credential too; see Session storage.
All Instagram traffic uses verified TLS. The underlying library disables certificate checks by default; this server turns them back on for every request.
Two-factor codes are the only thing the server ever asks you for, and you type them on a local page, not in the chat. Your password or session cookie come only from its configuration.
Text in tool results (captions, comments, bios, usernames) is written by other Instagram users. The server tells the assistant to treat it as data, not instructions, but review write actions the assistant proposes.
Verifying Installation
After restarting your MCP client, the Instagram server should appear in its list of servers. Ask the assistant to log in, then try something like "show me the latest posts from @nasa".
Tools
Read-only tools return structured JSON (structuredContent, described by each tool's outputSchema) as well as a text copy. Write tools are marked non-read-only, and every tool declares MCP annotations so clients can decide which calls need confirmation.
Tool | Title | Kind |
| Log in to Instagram | write, idempotent |
| Complete two-factor login | write |
| Log out of Instagram | write, destructive, idempotent |
| Search accounts | read-only |
| Get user profile | read-only |
| Get current user profile | read-only |
| Get user posts | read-only, paginated |
| Get post details | read-only |
| Get post comments | read-only, paginated |
| Get user stories | read-only |
| Get home timeline | read-only, paginated |
| Like a post | write, idempotent, rate limited |
| Like a comment | write, idempotent, rate limited |
| Comment on a post | write, rate limited |
| Follow a user | write, idempotent, rate limited |
Every tool except login and logout needs an active session. Paginated tools return nextMaxId when more items exist; pass it back as maxId to get the next page. Instagram decides the page size; limit only caps how many items of the current page are returned.
Two-factor authentication
instagram_login takes no arguments and never asks for your password; it uses IG_USERNAME and IG_PASSWORD (or IG_SESSION_ID). If Instagram asks for a verification code, it sends it by email, SMS or authenticator app, and the server says which:
The server opens a one-time page on your own machine (
http://127.0.0.1:<port>/2fa/...) where you type the code, so it never passes through the MCP client or the assistant. Clients that support MCP URL elicitation (for example Claude Code in an interactive session) offer to open it in your browser; in other clients the assistant gives you the link. The page accepts one code, expires after 10 minutes, and closes when you log out or start a new login. A malformed code can be corrected on the page; a code Instagram rejects ends the attempt, and callinginstagram_loginagain starts a new one.If you cannot open the page, tell the assistant the code and it calls
instagram_complete_2fawith it (the code then passes through the conversation). If you decline the prompt to open the page, the login stops and the assistant is told not to ask again.
If a login is already waiting for a code (for example from the automatic login at startup), instagram_login reuses it rather than sending your password again. With IG_SESSION_ID, two-factor authentication already happened in the browser, so no code is needed.
⚠️ Legal Disclaimer and Risks
IMPORTANT: READ BEFORE USE
This software utilizes unofficial Instagram API access methods and is not affiliated with, endorsed by, or supported by Meta Platforms, Inc. (Instagram). By using this MCP server, you acknowledge and agree to the following:
Risks and Limitations
Account Restrictions: Use of this software may result in your Instagram account being flagged for suspicious or automated activity. Instagram may issue warnings, temporarily restrict account functionality, or permanently suspend or delete your account.
No Guarantees: The functionality of this software is not guaranteed and may cease to work at any time due to changes in Instagram's platform, security measures, or policies. It talks to Instagram's private mobile API through its own client (a TypeScript port of parts of instagrapi, see
NOTICE). Instagram changes that API without notice, so tools can stop working until the client is updated.
Limitation of Liability
THE AUTHOR(S) AND CONTRIBUTOR(S) OF THIS SOFTWARE PROVIDE IT "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHOR(S) BE HELD LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THE SOFTWARE, INCLUDING BUT NOT LIMITED TO:
Instagram account suspensions, restrictions, or deletions
Loss of data, content, or access to Instagram services
Any direct, indirect, incidental, special, consequential, or punitive damages
BY USING THIS SOFTWARE, YOU ACCEPT FULL RESPONSIBILITY FOR ANY CONSEQUENCES THAT MAY RESULT FROM ITS USE. USE AT YOUR OWN RISK.
Recommendations
Use a secondary or test Instagram account rather than your primary account
Monitor your account for any warnings or unusual activity
Keep the built-in rate limits at or below their defaults to minimize detection risk
Regularly review Instagram's Terms of Service and comply with all applicable laws and regulations
TL;DR: It's just common sense, really. Don't go liking 10,000 posts in an hour or following everyone on the planet. Instagram doesn't like robots pretending to be humans. Be cool, don't overdo it, and you'll probably be fine. Probably.
Available Tools
15 toolsinstagram_comment_on_postA
Add a comment to an Instagram post or reply to an existing comment. Requires authentication.
Inputs: mediaId (required), text (required), replyToCommentId.
instagram_complete_2faA
Complete Instagram login by providing the 2FA verification code. Use this after 'instagram_login' indicates 2FA is required.
Inputs: verification_code (required).
instagram_follow_userA
Follow an Instagram user by user ID. Requires authentication. May require approval for private accounts.
Inputs: userId (required).
instagram_get_current_user_profileA
Get the authenticated user's own profile information. Returns complete account details including username, full name, bio, follower/following counts, verification status, profile picture, account type, and settings. Requires authentication.
Inputs: no named parameters.
instagram_get_post_commentsA
Get comments for an Instagram post. Returns paginated list of comments with author info, text, timestamps, and engagement metrics. Supports pagination via maxId cursor. Requires authentication.
Inputs: mediaId (required), maxId, limit.
instagram_get_post_detailsA
Get detailed information about a specific Instagram post by media ID. Returns comprehensive post details including caption, engagement metrics, media URLs, dimensions, location, and author information.
Inputs: mediaId (required).
instagram_get_timeline_feedA
Get home feed (posts from accounts you follow). Returns paginated feed of posts with media URLs, captions, engagement metrics, and metadata. Supports pagination via maxId cursor. Requires authentication.
Inputs: maxId, limit.
instagram_get_user_postsA
Get paginated feed of a user's Instagram posts. Returns posts with media URLs, captions, engagement metrics, and metadata. Supports pagination via maxId cursor.
Inputs: userId, username, maxId, limit.
instagram_get_user_profileA
Get comprehensive Instagram profile information by user ID or username. Returns profile details including username, full name, bio, follower/following counts, verification status, profile picture, and account type flags.
Inputs: userId, username.
instagram_get_user_storiesA
Get active Instagram stories from a user by user ID or username. Returns story items with media URLs, timestamps, story type, duration, and viewer count (if viewing own stories). Stories expire after 24 hours.
Inputs: userId, username.
instagram_like_commentB
Like an Instagram comment by comment ID. Requires authentication.
Inputs: commentId (required).
instagram_like_postC
Like an Instagram post or reel by media ID. Requires authentication.
Inputs: mediaId (required), module.
instagram_loginA
Login to an Instagram account using credentials from environment variables (IG_USERNAME and IG_PASSWORD). The session will be saved and persist across server restarts.
Inputs: no named parameters.
instagram_logoutA
Logout from Instagram and clear the saved session. This will invalidate the current session and require re-authentication for future operations.
Inputs: no named parameters.
instagram_search_accountsC
Search for Instagram accounts by username query. Returns a list of matching accounts with their profile information.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Every tool has a clearly distinct purpose with no ambiguity. Tools are well-separated by resource (e.g., post, user, comment) and action (e.g., get, like, follow), making it easy for an agent to select the right one. For example, instagram_get_post_comments and instagram_comment_on_post serve different but complementary functions without overlap.
All tool names follow a consistent verb_noun pattern with the prefix 'instagram_' for clarity. The naming is uniform across all tools (e.g., instagram_like_post, instagram_get_user_profile), using snake_case consistently without any deviations or mixed conventions.
The 15 tools are well-scoped for an Instagram server, covering core functionalities like authentication, profile management, posting interactions, and search. Each tool earns its place without feeling excessive or insufficient, providing a comprehensive yet manageable set for typical Instagram operations.
The tool surface is nearly complete for Instagram interactions, covering authentication, CRUD-like operations (e.g., get, like, comment, follow), and profile/post management. A minor gap exists in update/delete actions for posts or comments, but agents can work around this with the available tools, and core workflows are well-supported.
Maintenance
Related MCP Connectors
MCP server for AI agents: posts, messages and comments on WhatsApp, Instagram, TikTok and Facebook.
Hosted Instagram MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Instagram data over MCP: profiles, posts, reels, stories, highlights and search as JSON
Social media MCP server: your Instagram, TikTok, YouTube, LinkedIn and Threads history for your AI.
Related MCP Servers
- FlicenseBqualityDmaintenanceA server that allows fetching Instagram posts using Chrome's existing login session via Model Context Protocol (MCP).151-
- 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.209MIT
- AlicenseBqualityBmaintenanceAn MCP server for the official Instagram Graph API, enabling read, publish, comment, and analytics across Instagram Business/Creator accounts.2984 PyPI21MIT
- AlicenseBqualityFmaintenanceMCP server that connects AI agents to Instagram for reading statistics, insights, and comments via the official Meta Graph API.162MIT