Manage Instagram DM automation from Claude Code
After a few months you have rules on old reels, keywords nobody uses and comments that slipped through. Ask Claude Code what is running, switch rules off and on, and send the DMs that were missed, without opening a dashboard.
For Instagram professional accounts · Updated October 2026
One-time setup in Claude Code
Read https://www.cueedit.io/agent.md and set up CueEditio for me. Use my email: you@example.comclaude mcp add --transport http cueedit https://www.cueedit.io/api/mcp/mcp
# then in Claude Code: /mcp → cueedit → Authenticate- 1.Paste the line above into Claude Code. It signs up with an email code it reads, then gives you one link.
- 2.Open the link, check the email shown, and approve Instagram.
- 3.Ask it to list your Instagram accounts.
Ask Claude Code
You
Find comments from the last 7 days that matched a rule keyword but have dm_sent false, and DM them.
Claude Code
Checked 9 posts. 7 comments matched a keyword but never got a DM (all inside the 7-day window). I’ll send each the DM from its rule, about 6 seconds apart. Proceed?
Example conversation. Post names and counts will be your own.
The CueEditio tools that run
list_autodm_rulesEvery rule with its keywords, message, posts and active or paused status.set_autodm_rule_statusPauses or resumes a rule.list_commentsShows comments with dm_sent and dm_eligible, so Claude Code can see who was missed.send_dmDMs a commenter directly, one per comment.
How it works
1.Ask what is running
"List my Auto DM rules and which posts they cover."
2.Clean up
Pause rules for old offers, resume the ones you need. Claude Code confirms each change.
3.Find the gaps
Claude Code checks recent posts for comments with no DM and a still-open 7-day window.
4.Send the missed DMs
After your yes, it DMs them, about 6 seconds apart, and stops on the first error.
Claude Code asks for permission before each MCP write. For unattended runs, claude -p with --allowedTools limits it to the CueEditio tools you name, so a cron job can reply to comments without touching anything else.
Limits to know
- Instagram only lets a business DM someone who commented, as a private reply to that comment. The agent cannot cold-DM people who never commented.
- One DM per comment. A second send to the same comment returns already_dmed unless you tell the agent to force it.
- The comment must be 7 days old or newer. Older comments come back with dm_eligible false.
- At most 600 DMs and 600 public replies per hour per account, below Meta’s ceiling of 750.
- Reading posts, comments and rules works on the free plan. Sending replies, DMs and creating rules needs CueEditio Pro ($6 or ₹459 a month).
Questions
No. Instagram only allows a business to message people who commented on its posts (a private reply) or who messaged it first. CueEditio sends private replies to commenters only.
It can pause and resume rules and create new ones. To change a rule’s text, create a new rule and pause the old one, or edit it in the CueEditio dashboard.
Every DM and reply, whether from a rule or from Claude Code, shows up in CueEditio under Auto DM → Activity.
Yes. Every agent connection is listed in CueEditio Settings. Remove it and access stops at once.
Yes. Use claude -p in a cron job or CI step with --allowedTools set to the CueEditio tools you want. Set it up once in an interactive session; later runs reuse the saved sign-in.
Connect CueEditio to Claude Code
Create an account, connect your Instagram professional account, then add the MCP server above. Reading comments is free; sending replies and DMs needs Pro.
Instagram DM automation with other agents
More with Claude Code
Comparing tools? CueEditio vs ManyChat, CueEditio vs Postiz, CueEditio vs Blotato.