Instagram MCP Server
Enables AI agents to control Instagram accounts programmatically, supporting profile management, media interaction, direct messaging, and follower management.
README
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.
⚙️ 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 install -
Set 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 dev
2. Production Mode
Compiles the project to JavaScript first, then runs it:
npm run build
npm start
3. 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。