Instagram DM MCP server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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.
https://github.com/user-attachments/assets/9c945f25-4484-4223-8d6b-5bf31243464c
> To get updates on this and other projects we work on enter your email here
---
Installation
Prerequisites
- Python 3.11+
- Anthropic Claude Desktop app (or Cursor)
- Pip (Python package manager), install with python -m pip install
- An instagram account
Steps
1. **Clone this repository**
2. **Install dependencies**
- Using uv (recommended):
- Using Pip:
3. **Configure Instagram credentials**
You have two options for providing your Instagram credentials:
**Option A: Environment Variables (Recommended)**
**Quick Setup (Recommended):**
Run the helper script:
This will interactively prompt you for your credentials and create the .env file securely.
**Manual Setup:**
Create a .env file in the project root:
Then edit .env with your actual credentials:
**Option B: Command Line Arguments**
You can still pass credentials as command line arguments (less secure).
4. **Connect to the MCP server**
**For Claude Desktop:**
Save this as claude_desktop_config.json in your Claude Desktop configuration directory at:
**For Cursor:**
Save this as mcp.json in your Cursor configuration directory at:
**Configuration with Environment Variables (Recommended):**
- Using uv
- Using Python
**Configuration with Command Line Arguments:**
5. **Restart Claude Desktop / Cursor**
Open Claude Desktop and you should now see the Instagram DM MCP as an available integration.
Or restart Cursor.
---
Usage
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. |