This Instagram MCP Server enables AI assistants to interact with Instagram and Facebook accounts through a REST API with remote HTTPS access.
Capabilities:
Messaging: Send text/media messages (images, videos, audio), react to messages with emoji reactions (love, like, haha, wow, sad, angry), and use human agent tags for extended messaging windows
Conversation Management: List conversations, retrieve messages from specific threads, and find conversations by user ID
Profile Management: Access your Instagram business profile and Facebook page information, and look up other user profiles
Content Viewing: Browse posts/reels with pagination, get detailed post information including carousel items, and view comments
Engagement: Reply to comments and respond to messages on both platforms
Content Creation: Post images/videos to Instagram (including Reels) and create Facebook posts with text, links, or photos, all with captions and optional metadata
Remote Deployment: Deploy to cloud platforms (Vercel, Railway, Render, etc.) with API key authentication for secure team access and monitoring via health check endpoints
Provides tools for sending Messenger messages, creating posts with text/links/photos, viewing page posts, managing comments, accessing inbox conversations, and retrieving page information through Facebook's Graph API.
Enables sending messages, viewing and creating posts and reels, managing comments and replies, accessing inbox conversations, and retrieving profile information through Instagram's Business API.
Instagram MCP Server
An HTTP MCP (Model Context Protocol) server for interacting with Instagram and Facebook APIs. Deploy this server to any cloud platform and access it remotely via HTTPS from any MCP client.
This server enables AI assistants to send messages, view posts, manage comments, and interact with your Instagram/Facebook accounts through a REST API.
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)
Architecture
This is an HTTP-based MCP server using Express.js:
Transport: HTTP/HTTPS (not stdio)
Deployment: Cloud platforms (Vercel, Railway, Render, DigitalOcean, etc.)
Access: Remote access from anywhere via HTTPS
Authentication: API key-based (MCP_API_KEY)
Protocol: RESTful HTTP endpoints following MCP specification
Why HTTP?
✅ Remote Access - Access from any machine, not just locally ✅ Team Sharing - Multiple team members can use the same server ✅ Scalable - Deploy to cloud platforms with auto-scaling ✅ Secure - HTTPS encryption + API key authentication ✅ Simple - Just like any REST API you're used to
Endpoints
POST /mcp- MCP protocol endpoint (handles all tool calls)GET /health- Health check endpoint
Installation
Configuration
Create a .env file based on .env.example:
Required environment variables:
Variable | Description |
| Your Facebook Page ID |
| Page Access Token with required permissions |
| (Optional) Instagram Business Account ID |
| (Optional) Graph API version (default: v24.0) |
Getting Your Access Token
Create or select your app
Generate a Page Access Token with these permissions:
pages_messagingpages_manage_metadatapages_read_engagementinstagram_basicinstagram_manage_messagesinstagram_manage_commentsinstagram_content_publish
Running the Server
This is an HTTP MCP server that can be deployed anywhere and accessed remotely.
Local Development
The server will start on http://localhost:3000 (or custom PORT from .env)
Endpoints:
POST /mcp- MCP protocol endpointGET /health- Health check endpoint
Test the Server
Connecting MCP Clients
Claude Code
Add the server to Claude Code using the CLI:
Other MCP Clients
Any MCP-compatible client can connect via HTTP:
Available Tools
Messaging
send_message- Send text/media message to Instagram or Facebooksend_reaction- React to a message
Conversations
get_conversations- List inbox conversationsget_conversation_by_user- Find conversation by user IDget_conversation_messages- Get messages from a conversation
Profiles
get_user_profile- Get a user's profileget_my_instagram_profile- Get your IG profileget_my_facebook_page- Get your FB page info
Posts
get_posts- List your postsget_instagram_post_details- Get detailed post info
Comments
get_post_comments- Get comments on a postreply_to_comment- Reply to a comment
Content Creation
post_to_instagram- Create Instagram post/reelpost_to_facebook- Create Facebook post
Available Resources
The server also exposes these resources for easy access:
instagram://profile- Your Instagram profilefacebook://page- Your Facebook pageinstagram://inbox- Instagram DM inboxfacebook://inbox- Facebook Messenger inboxinstagram://posts- Recent Instagram postsfacebook://posts- Recent Facebook posts
Development
Note: A stdio version is also available for local-only use. Run with
npm run dev:stdioornpm run start:stdio
Deployment
Deploy to Vercel
Install Vercel CLI:
Create
vercel.json:
Deploy:
Set environment variables in Vercel dashboard
Deploy to Railway
Create
railway.toml:
Deploy:
Set environment variables in Railway dashboard
Deploy to Render
Create account at https://render.com
Create new Web Service
Configure:
Build Command:
npm install && npm run buildStart Command:
npm startAdd environment variables
Deploy to DigitalOcean/VPS
Environment Variables for Production
Required:
FB_PAGE_ID- Your Facebook Page IDFB_PAGE_ACCESS_TOKEN- Page Access TokenIG_ACCOUNT_ID- Instagram Business Account IDFB_API_VERSION- Graph API version (default: v24.0)MCP_API_KEY- Secret key for MCP endpoint authenticationPORT- Server port (default: 3000)
Security Notes
⚠️ IMPORTANT: When deploying publicly:
Always set - Never deploy without authentication
Use HTTPS only - Encrypt all traffic
Rotate tokens regularly - Update access tokens periodically
Use environment variables - Never commit secrets to git
Rate limiting - Consider adding rate limiting for production
License
MIT