π± π€ Instagram MCP AI agent β read, reply & manage comments with GPT-4o
β‘ 5,637 views Β· π± Social Media & Email Marketing
π‘ Pro Tip β Heads up β if this workflowβs Instagram scraping breaks (it happens whenever Meta updates their frontend), ScraperNode is a community node that handles profiles, posts, reels, and comments without any HTML parsing.
Description
π€ Instagram AI Agent with MCP Server β Built for Smart Engagement and Automation
Hi! Iβm Amanda π₯°
I build intelligent automations with n8n and Make.
This powerful workflow was designed to help teams automatically handle Instagram interactions with AI. Using Meta Graph API, LangChain, MCP Server, and GPT-4o, it allows your AI agent to search for posts, read captions, fetch comments, and even reply or message followers, all through structured tools.
π§ What the workflow does
- Searches for recent media using Instagram ID and access token
- Reads and extracts captions or media URLs
- Fetches comments and specific replies from each post
- Replies to comments automatically with GPT-generated responses
- Sends direct messages to followers who commented
- Maps user input and session to keep memory context via LangChain
- Communicates via Server-Sent Events (SSE) using your MCP Server URL
π§° Nodes & Tech Used
LangChain Agent+Chat Modelwith GPT-4oMemory Bufferfor session memorytoolHttpRequestto search media, comments, and send repliesMCP TriggerandMCP Tool(custom SSE connection)Setnode for input and variable assignmentWebhookand JSON for Instagram API structure
βοΈ Setup Instructions
- Create your Instagram App in Meta Developer Portal
- Add your Instagram ID and Access Token in the
Setnode - Update the MCP Server Tool URL in the
MCP Instagramnode- Use your n8n server URL (e.g.
https://yourdomain.com/mcp/server/instagram/sse)
- Use your n8n server URL (e.g.
- Trigger the workflow using the included
LangChain Chat Trigger - Interact via text to ask the agent to:
- βGet latest postsβ
- βReply to comment X with this messageβ
- βSend DM to this user aboutβ¦β
π₯ Who this is for
- Social media teams managing multiple comments
- Brands automating engagement with followers
- Agencies creating smart, autonomous digital assistants
- Developers building conversational Instagram bots
β Requirements
- Meta Graph API access
- Instagram Business account
- n8n instance (Cloud or Self-hosted)
- MCP Server configured (SSE Endpoint enabled)
- OpenAI API Key (for GPT-4o + LangChain)
π Want to use this workflow?
β€οΈ Buy workflows: https://iloveflows.com
βοΈ Try n8n Cloud: https://n8n.partnerlinks.io/amanda
π Nodes Used
AI Agent, OpenAI Chat Model, Simple Memory, Chat Trigger, HTTP Request Tool, MCP Client Tool
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File