Instagram auto DM from Codex
Tell Codex the keyword, the post and the message. It finds the reel, shows you the exact DM, and after your yes creates an Auto DM rule in CueEditio. From then on every matching comment gets the DM within seconds, even when Codex is closed.
For Instagram professional accounts · Updated October 2026
One-time setup in Codex
Read https://www.cueedit.io/agent.md and set up CueEditio for me. Use my email: you@example.comcodex mcp add cueedit --url https://www.cueedit.io/api/mcp/mcp
codex mcp login cueedit- 1.Paste the line above into Codex. It signs up with an email code and gives you one link.
- 2.Open the link, check the email shown, and approve Instagram.
- 3.Ask Codex to list your Instagram accounts.
Ask Codex
You
Create an auto DM on my newest reel: keyword TEMPLATE, DM "Grab the template here: https://example.com/t". Add a public reply too.
Codex
Newest reel: "Notion setup in 60s". Rule to create: • TEMPLATE → DM "Grab the template here: https://example.com/t" • Public reply variations: "Sent!", "Check your DMs" Approve the create_autodm_rule call?
Example conversation. Post names and counts will be your own.
The CueEditio tools that run
list_accountsChecks which Instagram account is connected and whether it can send (Pro).list_postsFinds your latest reel or the post you described, with its id.create_autodm_ruleSaves the rule: keywords, the DM text, which posts, optional public reply and follow gate.list_autodm_rulesReads the rule back so you can see it is active.
How it works
1.Connect once
Add the CueEditio MCP to Codex and sign in. Connect your Instagram professional account in CueEditio.
2.Describe the rule
Name the keyword, the post ("my latest reel") and the message, link included.
3.Confirm
Codex shows the exact rule and DM text. Nothing is created until you say yes.
4.It runs on its own
The rule lives on CueEditio’s servers. It keeps sending after you close Codex. Ask Codex to pause it any time.
Codex works well for repeatable jobs: keep the instructions in a file, run them with codex exec, and read the tally it prints at the end.
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. Codex only creates the rule. CueEditio stores it and Instagram’s webhook triggers it, so DMs go out while your computer is off.
Yes. Ask for "any comment" and Codex sets trigger_mode to any. Keyword rules match when the comment contains the word; ask for an exact match if you need one.
Yes. The rule can post a public reply under the comment, with up to three variations picked at random so the replies do not all look the same.
Yes. CueEditio uses the Instagram API with Instagram Login. Our messaging and comment permissions passed Meta App Review in October 2026.
codex mcp add writes the server to ~/.codex/config.toml under [mcp_servers.cueedit]. Codex stores the sign-in itself.
Connect CueEditio to Codex
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 auto DM with other agents
More with Codex
Comparing tools? CueEditio vs ManyChat, CueEditio vs Postiz, CueEditio vs Blotato.