Send Instagram DMs via your LLM
{{ message }}
trypeggy / instagram_dm_mcp Public
Instagram Direct messages MCP
tally.so/r/mR18zl
MIT license
87 stars16 forksBranches Tags Activity
Star
Notifications
main
BranchesTags
Go to file
Code
Name | Name | Last commit message | Last commit date |
---|---|---|---|
27 Commits | |||
src | src | ||
.gitignore | .gitignore | ||
.python-version | .python-version | ||
LICENSE | LICENSE | ||
env.example | env.example | ||
pyproject.toml | pyproject.toml | ||
readme.md | readme.md | ||
requirements.txt | requirements.txt | ||
setup_env.py | setup_env.py | ||
uv.lock | uv.lock | ||
View all files |
This is a Model Context Protocol (MCP) server for sending instagram Direct Messages.
With this you can send Instagram Direct Messages from your account (more capabilities coming soon).
Here's an example of what you can do when it's connected to Claude.
Instagram_DM_MCP_Demo-2.mp4
To get updates on this and other projects we work on enter your email here
PS: Join our Twitter community for all things MCP
Build anything using this Instagram DM MCP (can be technical, no-code or low-code) and submit!
No restrictions, open to anyone/anywhere to join.
Note: submisions due by Friday 27 June 11:59PM PST
python -m pip install
.env
file securely..env
file in the project root:.env
with your actual credentials:INSTAGRAM_USERNAME=your_instagram_username
INSTAGRAM_PASSWORD=your_instagram_password
Option B: Command Line Arguments
You can still pass credentials as command line arguments (less secure).
2. Connect to the MCP server
For Claude Desktop:
Save this as claude_desktop_config.json
in your Claude Desktop configuration directory at:
~/Library/Application Support/Claude/claude_desktop_config.json
For Cursor:
Save this as mcp.json
in your Cursor configuration directory at:
~/.cursor/mcp.json
Configuration with Environment Variables (Recommended):
Below is a list of all available tools and what they do:
Tool Name | Description |
---|---|
send_message | Send an Instagram direct message to a user by username. |
send_photo_message | Send a photo as an Instagram direct message to a user by username. |
send_video_message | Send a video as an Instagram direct message to a user by username. |
list_chats | Get Instagram Direct Message threads (chats) from your account, with optional filters/limits. |
list_messages | Get messages from a specific Instagram Direct Message thread by thread ID. Now exposes item_type and shared post/reel info for each message. Use this to determine which download tool to use. |
download_media_from_message | Download a direct-uploaded photo or video from a DM message (not for shared posts/reels/clips). |
download_shared_post_from_message | Download media from a shared post, reel, or clip in a DM message (not for direct uploads). |
list_media_messages | List all messages containing direct-uploaded media (photo/video) in a DM thread. |
mark_message_seen | Mark a specific message in an Instagram Direct Message thread as seen. |
list_pending_chats | Get Instagram Direct Message threads from your pending inbox. |
search_threads | Search Instagram Direct Message threads by username or keyword. |
get_thread_by_participants | Get an Instagram Direct Message thread by participant user IDs. |
get_thread_details | Get details and messages for a specific Instagram Direct Message thread by thread ID. |
get_user_id_from_username | Get the Instagram user ID for a given username. |
get_username_from_user_id | Get the Instagram username for a given user ID. |
get_user_info | Get information about a specific Instagram user by username. |
search_users | Search for Instagram users by username |
get_user_stories | Get recent stories from a specific Instagram user by username. |
like_media | Like or unlike a specific media post by media ID. |
get_user_followers | Get a list of followers for a specific Instagram user by username. |
get_user_following | Get a list of users that a specific Instagram user is following by username. |
get_user_posts | Get recent posts from a specific Instagram user by username. |
Instagram Login Hanging: The server now includes automatic session management to prevent login hangs. Session files (e.g., username_session.json
) are automatically created and reused to maintain authentication state between runs.
For additional Claude Desktop integration troubleshooting, see the MCP documentation. The documentation includes helpful tips for checking logs and resolving common issues.
Your feedback will be massively appreciated. Please tell us which features on that list you like to see next or request entirely new ones.
This project is licensed under the MIT License.
github python instagram marketing facebook ai mcp python3 llm instagram-message-bot instagram-message-sender mcp-server instagram-messenger
Readme
MIT license
Activity
Custom properties
87 stars
1 watching
16 forks
Report repository
No releases published
No packages published
Connect to any function, any language, across network boundaries using AgentRPC.
An AI voice toolkit with TTS, voice cloning, and video translation, now available as an MCP server for smarter agent integration.
Create and publish unlimited podcast shows and episodes with ELEMENT.FM
The official ElevenLabs MCP server
Network access with the ability to run commands like ping, traceroute, mtr, http, dns resolve.
AI personal assistant for email Inbox Zero
Interact with any other SaaS applications on behalf of your customers.
Integrates the LINE Messaging API to connect an AI Agent to the LINE Official Account.
Interact with Mailgun API.
Integrates with Mailtrap Email API.