Skip to main content
Glama
README.md3.85 kB
# Instagram MCP Server An MCP (Model Context Protocol) server for interacting with Instagram and Facebook APIs. This server enables AI assistants to send messages, view posts, manage comments, and interact with your Instagram/Facebook accounts. ## Features ### Messaging - Send text messages on Instagram and Facebook Messenger - Send media (images, videos, audio) - React to messages - Human agent tag support for extended messaging windows ### Inbox / Conversations - List all conversations - Get messages from specific conversations - Find conversations by user ID ### Profile - Get your Instagram business profile - Get your Facebook page info - Look up user profiles ### Posts - View your Instagram posts and reels - View your Facebook page posts - Get detailed post information including carousel items ### Comments - View comments on posts - Reply to comments ### Content Creation - Post images to Instagram - Post videos/reels to Instagram - Post to Facebook (text, links, photos) ## Installation ```bash cd instagram-mcp-server npm install npm run build ``` ## Configuration Create a `.env` file based on `.env.example`: ```bash cp .env.example .env ``` Required environment variables: | Variable | Description | |----------|-------------| | `FB_PAGE_ID` | Your Facebook Page ID | | `FB_PAGE_ACCESS_TOKEN` | Page Access Token with required permissions | | `IG_ACCOUNT_ID` | (Optional) Instagram Business Account ID | | `FB_API_VERSION` | (Optional) Graph API version (default: v24.0) | ### Getting Your Access Token 1. Go to [Facebook Developer Portal](https://developers.facebook.com) 2. Create or select your app 3. Generate a Page Access Token with these permissions: - `pages_messaging` - `pages_manage_metadata` - `pages_read_engagement` - `instagram_basic` - `instagram_manage_messages` - `instagram_manage_comments` - `instagram_content_publish` ## Usage with Claude Code Add to your Claude Code MCP settings (`~/.claude/claude_desktop_config.json`): ```json { "mcpServers": { "instagram": { "command": "node", "args": ["/path/to/instagram-mcp-server/dist/index.js"], "env": { "FB_PAGE_ID": "your_page_id", "FB_PAGE_ACCESS_TOKEN": "your_access_token", "IG_ACCOUNT_ID": "your_ig_account_id" } } } } ``` Or if using environment file: ```json { "mcpServers": { "instagram": { "command": "node", "args": ["/path/to/instagram-mcp-server/dist/index.js"], "cwd": "/path/to/instagram-mcp-server" } } } ``` ## Available Tools ### Messaging - `send_message` - Send text/media message to Instagram or Facebook - `send_reaction` - React to a message ### Conversations - `get_conversations` - List inbox conversations - `get_conversation_by_user` - Find conversation by user ID - `get_conversation_messages` - Get messages from a conversation ### Profiles - `get_user_profile` - Get a user's profile - `get_my_instagram_profile` - Get your IG profile - `get_my_facebook_page` - Get your FB page info ### Posts - `get_posts` - List your posts - `get_instagram_post_details` - Get detailed post info ### Comments - `get_post_comments` - Get comments on a post - `reply_to_comment` - Reply to a comment ### Content Creation - `post_to_instagram` - Create Instagram post/reel - `post_to_facebook` - Create Facebook post ## Available Resources The server also exposes these resources for easy access: - `instagram://profile` - Your Instagram profile - `facebook://page` - Your Facebook page - `instagram://inbox` - Instagram DM inbox - `facebook://inbox` - Facebook Messenger inbox - `instagram://posts` - Recent Instagram posts - `facebook://posts` - Recent Facebook posts ## Development ```bash # Run in development mode npm run dev # Build npm run build # Run built version npm start ``` ## License MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/osborn1997/instagram-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server