
Instagram Mcp
io.github.mcpware由 GitHub 帳號 mcpware 發布v1.0.4更新於 Oct 27, 2026
Instagram MCP — 23 tools for Instagram Graph API: posts, DMs, stories, reels, analytics.
概覽
在本機執行的 MCP 伺服器,提供 23 個 Instagram Graph API 工具,讓助理讀取個人檔案、貼文、留言與私訊資料,並發佈貼文、Reels 和輪播內容。
- 可以做什麼
- 讀取個人檔案與帳號資料:個人檔案資訊、已連結的 Facebook 粉絲專頁、帳號洞察、權杖有效性檢查
- 取得媒體與數據分析:近期貼文、單篇貼文洞察、限時動態、被標註的內容、主題標籤搜尋與標籤媒體、其他商業帳號查詢
- 發佈內容:單張圖片或影片、輪播、Reel,並查詢每日發佈額度
- 管理留言:列出、張貼、回覆、刪除、隱藏或取消隱藏留言
- 處理私訊:列出對話、讀取訊息、傳送私訊(需 Meta 進階存取權)
- 適用情境
- 適合管理 Instagram 商業或創作者帳號、希望助理在聊天用戶端內草擬並發佈內容、檢視互動數據、管理留言或回覆私訊的情境。
- 執行需求
- 以本機程序方式執行(npm 套件,stdio)。需要一個已連結 Facebook 粉絲專頁的 Instagram 商業或創作者帳號、一個具備所列 Instagram 與 Pages 權限的 Facebook 開發人員應用程式,以及環境變數 INSTAGRAM_ACCESS_TOKEN 與 INSTAGRAM_ACCOUNT_ID;INSTAGRAM_API_VERSION 為選用。需要連線至 Graph API 的網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Instagram Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[MSeeP.ai Security Assessment Badge]
@mcpware/instagram-mcp
[npm version] [npm downloads] [license] [GitHub stars] [GitHub forks]
A Model Context Protocol (MCP) server that provides seamless integration with Instagram's Graph API, enabling AI applications to interact with Instagram Business accounts programmatically.
Features
🔧 Tools (Model-controlled)
- Get Profile Info: Retrieve Instagram business profile details
- Get Media Posts: Fetch recent posts from an Instagram account
- Get Media Insights: Retrieve engagement metrics for specific posts
- Publish Media: Upload and publish images/videos to Instagram
- Get Account Pages: List Facebook pages connected to the account
- Get Conversations: List Instagram DM conversations (requires Advanced Access)
- Get Conversation Messages: Read messages from specific conversations (requires Advanced Access)
- Send DM: Reply to Instagram direct messages (requires Advanced Access)
📊 Resources (Application-controlled)
- Profile Data: Access to profile information including follower counts, bio, etc.
- Media Feed: Recent posts with engagement metrics
- Insights Data: Detailed analytics for posts and account performance
💬 Prompts (User-controlled)
- Analyze Engagement: Pre-built prompt for analyzing post performance
- Content Strategy: Template for generating content recommendations
- Hashtag Analysis: Prompt for hashtag performance evaluation
Prerequisites
- Instagram Business Account: Must be connected to a Facebook Page
- Facebook Developer Account: Required for API access
- Access Token: Long-lived access token with appropriate permissions
- Python 3.10+: For running the MCP server (required by MCP dependencies)
Required Instagram API Permissions
Standard Access (available immediately):
instagram_basicinstagram_content_publishinstagram_manage_insightsinstagram_manage_commentspages_show_listpages_read_engagementpages_manage_metadatapages_read_user_contentbusiness_management
Advanced Access (requires Meta App Review):
instagram_manage_messages- Required for Direct Messaging features
⚠️ Instagram DM Features: Reading and sending Instagram direct messages requires Advanced Access approval from Meta. See INSTAGRAM_DM_SETUP.md for the App Review process.
🔑 How to Get Instagram API Credentials
📖 Quick Start: See AUTHENTICATION_GUIDE.md for a 5-minute setup guide!
This section provides a step-by-step guide to obtain the necessary credentials for the Instagram MCP server.
Step 1: Set Up Instagram Business Account
-
Convert to Business Account (if not already):
- Open Instagram app → Settings → Account → Switch to Professional Account
- Choose "Business" → Select a category → Complete setup
-
Connect to Facebook Page:
- Go to Instagram Settings → Account → Linked Accounts → Facebook
- Connect to an existing Facebook Page or create a new one
- Important: The Facebook Page must be owned by you
Step 2: Create Facebook App
-
Go to Facebook Developers:
- Visit developers.facebook.com
- Log in with your Facebook account
-
Create New App:
- Click "Create App" → Choose "Business" → Click "Next"
- Fill in app details:
- App Name: Choose a descriptive name (e.g., "My Instagram MCP Server")
- App Contact Email: Your email address
- Click "Create App"
-
Add Instagram Basic Display Product:
- In your app dashboard, click "Add Product"
- Find "Instagram Basic Display" → Click "Set Up"
-
Configure Instagram Basic Display:
- Go to Instagram Basic Display → Basic Display
- Click "Create New App" in the Instagram App section
- Accept the terms and create the app
Step 3: Get App Credentials
- Get App ID and Secret:
- In your Facebook app dashboard, go to Settings → Basic
- Copy your App ID and App Secret
- Important: Keep the App Secret secure and never share it publicly
Step 4: Set Up Instagram Business API Access
-
Add Instagram Graph API Product:
- In your app dashboard, click "Add Product"
- Find "Instagram Graph API" → Click "Set Up"
-
Configure Permissions:
- Go to Instagram Graph API → Permissions
- Request the following permissions:
instagram_basicinstagram_content_publishinstagram_manage_insightspages_show_listpages_read_engagement
Step 5: Generate Access Token
Option A: Using Facebook Graph API Explorer (Recommended for Testing)
-
Go to Graph API Explorer:
-
Configure Explorer:
- Select your app from the dropdown
- Click "Generate Access Token"
- Select required permissions when prompted
-
Get Page Access Token:
- In the explorer, make a GET request to:
/me/accounts - Find your Facebook Page in the response
- Copy the
access_tokenfor your page
- In the explorer, make a GET request to:
-
Get Instagram Business Account ID:
- Use the page access token to make a GET request to:
/{page-id}?fields=instagram_business_account - Copy the Instagram Business Account ID from the response
- Use the page access token to make a GET request to:
Option B: Using Facebook Login Flow (Recommended for Production)
-
Set Up Facebook Login:
- In your app dashboard, add "Facebook Login" product
- Configure Valid OAuth Redirect URIs
-
Implement OAuth Flow:
-
Exchange Code for Token:
Step 6: Get Long-Lived Access Token
Short-lived tokens expire in 1 hour. Convert to long-lived token (60 days):
Step 7: Set Up Environment Variables
Create a .env file in your project root:
Step 8: Test Your Setup
Run the validation script to test your credentials:
Or test manually:
🚨 Important Security Notes
- Never commit credentials to version control
- Use environment variables or secure secret management
- Regularly rotate access tokens
- Monitor token expiration dates
- Use HTTPS only in production
- Implement proper error handling for expired tokens
🔄 Token Refresh Strategy
Long-lived tokens expire after 60 days. Implement automatic refresh:
📋 Troubleshooting Common Issues
Error: "Invalid OAuth access token"
- Check if token has expired
- Verify token has required permissions
- Ensure Instagram account is connected to Facebook Page
Error: "Instagram account not found"
- Verify Instagram Business Account ID is correct
- Check if Instagram account is properly linked to Facebook Page
- Ensure account is a Business account, not Personal
Error: "Insufficient permissions"
- Review required permissions in Facebook App
- Re-generate access token with correct scopes
- Check if app is in Development vs Live mode
Rate Limiting Issues
- Implement exponential backoff
- Cache responses when possible
- Monitor rate limit headers in API responses
Installation
- Clone the repository:
- Install dependencies:
- Set up environment variables:
- Configure the MCP server:
Configuration
Environment Variables (.env)
MCP Client Configuration
Add this to your MCP client configuration (e.g., Claude Desktop):
Usage Examples
Using with Claude Desktop
- Get Profile Information:
- Analyze Recent Posts:
- Publish Content:
Using with Python MCP Client
API Endpoints Covered
Profile Management
- Get business profile information
- Update profile details (future feature)
Media Management
- Retrieve recent posts
- Get specific media details
- Upload and publish new content
- Delete media (future feature)
Analytics & Insights
- Post engagement metrics (likes, comments, shares)
- Account insights (reach, impressions)
- Hashtag performance analysis
Account Management
- List connected Facebook pages
- Switch between business accounts
Rate Limiting & Best Practices
The server implements intelligent rate limiting to comply with Instagram's API limits:
- Profile requests: 200 calls per hour
- Media requests: 200 calls per hour
- Publishing: 25 posts per day
- Insights: 200 calls per hour
Best Practices
- Cache frequently accessed data
- Use batch requests when possible
- Implement exponential backoff for retries
- Monitor rate limit headers
Error Handling
The server provides comprehensive error handling for common scenarios:
- Authentication errors: Invalid or expired tokens
- Permission errors: Missing required permissions
- Rate limiting: Automatic retry with backoff
- Network errors: Connection timeouts and retries
- API errors: Instagram-specific error responses
Security Considerations
- Token Security: Store access tokens securely
- Environment Variables: Never commit tokens to version control
- HTTPS Only: All API calls use HTTPS
- Token Refresh: Implement automatic token refresh
- Audit Logging: Log all API interactions
Development
Project Structure
Running Tests
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Troubleshooting
Common Issues
-
"Invalid Access Token"
- Verify token is not expired
- Check token permissions
- Regenerate long-lived token
-
"Rate Limit Exceeded"
- Wait for rate limit reset
- Implement request queuing
- Use batch requests
-
"Permission Denied"
- Verify Instagram Business account setup
- Check Facebook page connection
- Review API permissions
Debug Mode
Enable debug logging by setting:
Troubleshooting
Environment Variables
Tools (23)
Profile & Account
Media & Publishing
Comments
Direct Messages
Discovery & Content
Limitations
These are Instagram Graph API limitations, not this tool's:
- Business/Creator accounts only — personal accounts are not supported
- Long-lived tokens expire after 60 days — refresh before expiry
- 200 API calls per hour rate limit
- 25 posts per day publishing limit
- DMs require Advanced Access — Meta app review required
- Hashtag search: 30 unique hashtags per 7 days
Credits
TypeScript rewrite of jlbadano/ig-mcp (Python).
More from @mcpware
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 📧 Email: [email protected]
- 🐛 Issues: GitHub Issues
- 📖 Documentation: Wiki
Acknowledgments
- Model Context Protocol by Anthropic
- Instagram Graph API by Meta
- FastMCP for rapid MCP development
來源:README.md,提交 c6b7992
工具
0版本歷史
1- v1.0.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分