Labsco
KynuxDev logo

mcp-instagram-dm

β˜… 3

from KynuxDev

Read, send, search, and manage Instagram DMs through AI assistants via MCP. 15 tools, cookie-based auth, single dependency.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredNeeds API keys
<div align="center">

πŸ“¨ MCP Instagram DM

Control your Instagram DMs with AI

Read, send, search, and manage Instagram Direct Messages through natural language with any MCP-compatible AI assistant.

npm version npm downloads GitHub stars

CI License: MIT Node.js TypeScript MCP

<br />

A Model Context Protocol server that bridges Instagram Direct Messages with AI assistants like Claude, Cursor, and any MCP-compatible client.

Cookie-based authentication β€” no API keys, no OAuth, just works.

<br />

Getting Started Β· Features Β· Configuration Β· Tools Reference Β· Contributing

<br />

πŸ’‘ If you find this useful, please consider giving it a ⭐ β€” it helps others discover the project!

</div>

🎬 What It Looks Like

You:    "Show me my unread Instagram DMs"
Claude: Fetching your inbox...

        πŸ“¬ Inbox (3 conversations)

        [UNREAD] john_doe (thread_id: 340282366841710300...)
          Last: [2026-03-29 14:23:01] john_doe: Hey, are you free tonight?

        [UNREAD] [GROUP] project_team (thread_id: 340282366841710301...)
          Last: [2026-03-29 13:45:22] alice: Meeting moved to 3pm

        jane_smith (thread_id: 340282366841710302...)
          Last: [2026-03-29 10:12:45] You: Thanks! See you then

You:    "Reply to john_doe: Yeah, let's meet at 7!"
Claude: βœ… Message sent: "Yeah, let's meet at 7!"

✨ Features

15 tools across three categories β€” everything you need to manage your Instagram DMs:

πŸ“₯ Read & Monitor

ToolDescription
instagram_get_inboxList recent DM conversations with unread/group/muted indicators
instagram_get_threadGet messages from a conversation (auto-paginates β€” fetch 500+ messages at once)
instagram_get_pendingList pending DM requests waiting for your approval
instagram_user_infoGet any user's profile: bio, followers, posts, verification
instagram_thread_infoThread metadata: participants, group info, mute/archive status

✏️ Send & Manage

ToolDescription
instagram_send_messageSend a text message in any thread
instagram_send_linkShare a URL with optional caption
instagram_create_threadStart a new DM with one or multiple users
instagram_like_messageReact to any message with any emoji
instagram_unsend_messageUnsend your own messages
instagram_mark_seenMark a conversation as read
instagram_approve_pendingApprove a pending DM request

πŸ” Search & Discover

ToolDescription
instagram_search_inboxSearch conversations by username or name (scans all pages)
instagram_search_messagesFind messages containing specific text within a thread
instagram_search_usersSearch Instagram users to start new conversations

πŸ“– Tools Reference

<details> <summary><b>View all 15 tools with parameters</b></summary> <br />
ToolDescriptionParameters
instagram_get_inboxList DM conversationslimit?, cursor?
instagram_get_threadGet thread messages (auto-paginates)thread_id, limit?, cursor?
instagram_get_pendingList pending requestslimit?, cursor?
instagram_user_infoGet user profileuser_id
instagram_thread_infoGet thread detailsthread_id
instagram_send_messageSend text messagethread_id, text
instagram_send_linkShare a URLthread_id, url, text?
instagram_create_threadStart new DMrecipient_ids[], text
instagram_like_messageReact with emojithread_id, item_id, emoji?
instagram_unsend_messageUnsend a messagethread_id, item_id
instagram_mark_seenMark as readthread_id, item_id
instagram_approve_pendingApprove requestthread_id
instagram_search_inboxSearch conversationsquery, max_pages?
instagram_search_messagesSearch within threadthread_id, query, max_messages?
instagram_search_usersFind usersquery
</details>

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     MCP (stdio)     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   AI Assistant       │◄──────────────────►│   MCP Server          β”‚
β”‚   (Claude, Cursor)   β”‚                     β”‚   src/index.ts        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚   15 tools            β”‚
                                             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                        β”‚
                                             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                             β”‚   Instagram Client    β”‚
                                             β”‚   src/instagram.ts    β”‚
                                             β”‚   Cookie auth + HTTP  β”‚
                                             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                        β”‚
                                             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                             β”‚   Instagram Web API   β”‚
                                             β”‚   (Private endpoints) β”‚
                                             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Design principles:

  • Single dependency β€” only @modelcontextprotocol/sdk. No axios, no puppeteer, no bloat.
  • TypeScript strict β€” zero any types, fully typed interfaces in src/types.ts
  • Auto-pagination β€” request 500 messages and the server handles the rest with rate limiting
  • 14+ message types β€” text, media, voice, reels, links, clips, GIFs, posts, stories, and more

πŸ”’ Security

  • Session cookies are never logged or stored beyond runtime
  • All credentials are read from environment variables only
  • No data is sent to any third-party service
  • See SECURITY.md for reporting vulnerabilities

⚠️ Disclaimer

This project uses Instagram's unofficial web API, which may change without notice.

  • Personal use only β€” do not use for spam, mass messaging, or automation that violates Instagram's Terms of Service
  • Your session cookies are sensitive credentials β€” never share or commit them
  • This project is not affiliated with, endorsed by, or connected to Meta or Instagram
  • Use at your own risk β€” the authors are not responsible for any account restrictions

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for development setup and guidelines.

If you'd like to support the project financially, consider sponsoring on GitHub.

πŸ“„ License

MIT β€” Made with ❀️ by Kynux


<div align="center">

If this project helped you, consider giving it a ⭐

Report Bug Β· Request Feature Β· Contribute

</div>