Instagram DM MCP

v1.0.0Communicationstable

Instagram Direct messages MCP

aifacebookgithubinstagraminstagram-message-bot
Share:
167
Stars
0
Downloads
0
Weekly
0/5

What is Instagram DM MCP?

Instagram DM MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to instagram direct messages mcp

Instagram Direct messages MCP

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Instagram Direct messages MCP

Use Cases

Instagram Direct messages
Bot automation
Message management
trypeggy

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx instagram-dm-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Instagram DM MCP

Instagram DM MCP connects your AI assistant directly to Instagram Direct Messaging, letting you send text, photos, and videos, read and search message threads, and manage conversations programmatically. Built on the instagrapi library, it authenticates with your Instagram credentials and exposes 14 tools covering messaging, media download, user lookup, and post interaction. Teams and developers use it to build AI-powered Instagram outreach workflows, auto-reply bots, and social CRM integrations without maintaining separate scripts.

Prerequisites

  • Python 3.10 or higher installed
  • uv package manager or pip installed
  • An active Instagram account (username and password)
  • An MCP client such as Claude Desktop
1

Clone the repository

Clone the instagram_dm_mcp repository from GitHub and navigate into the project directory.

git clone https://github.com/trypeggy/instagram_dm_mcp.git
cd instagram_dm_mcp
2

Install Python dependencies

Install required packages using uv (recommended) or pip. The server depends on instagrapi and mcp packages.

uv sync
# or alternatively:
pip install -r requirements.txt
3

Configure Instagram credentials

Run the interactive setup script to create your .env file with Instagram credentials, or create it manually with INSTAGRAM_USERNAME and INSTAGRAM_PASSWORD.

python setup_env.py
# OR create .env manually:
# INSTAGRAM_USERNAME=your_username
# INSTAGRAM_PASSWORD=your_password
4

Add the server to Claude Desktop config

Edit claude_desktop_config.json to register the MCP server. Use the uv run command pointing to the cloned directory.

{
  "mcpServers": {
    "instagram-dm": {
      "command": "uv",
      "args": ["--directory", "/path/to/instagram_dm_mcp", "run", "main.py"],
      "env": {
        "INSTAGRAM_USERNAME": "your_instagram_username",
        "INSTAGRAM_PASSWORD": "your_instagram_password"
      }
    }
  }
}
5

Restart Claude Desktop and verify

Restart Claude Desktop to load the new server. You should see Instagram DM tools available in the tool list. Try listing your chats to confirm the connection works.

Instagram DM MCP Examples

Client configuration

Claude Desktop configuration for the Instagram DM MCP server using uv to run the Python server.

{
  "mcpServers": {
    "instagram-dm": {
      "command": "uv",
      "args": ["--directory", "/path/to/instagram_dm_mcp", "run", "main.py"],
      "env": {
        "INSTAGRAM_USERNAME": "your_instagram_username",
        "INSTAGRAM_PASSWORD": "your_instagram_password"
      }
    }
  }
}

Prompts to try

Example prompts to use once the Instagram DM MCP server is connected.

- "List my 10 most recent Instagram DM threads"
- "Send a message to @johndoe saying 'Hey, saw your post — great work!'"
- "Search my DM threads for conversations with the keyword 'collaboration'"
- "Get the last 20 messages from my thread with @janedoe"
- "Download the photo from the last message in my conversation with @partner_account"
- "Get recent posts from Instagram user @someinfluencer"

Troubleshooting Instagram DM MCP

Login fails with 'ChallengeRequired' or two-factor authentication error

Instagram may require a challenge verification. Run the server interactively once via 'python main.py' to complete the challenge in the terminal, then the session cookie will be cached for future MCP runs.

Messages send successfully but the recipient never receives them

Ensure the recipient's username is spelled exactly correctly. For new conversations, Instagram sometimes rate-limits new DM threads — wait a few minutes and try again. Avoid sending too many messages in quick succession to prevent account flags.

uv sync fails with dependency resolution errors

Make sure you are using Python 3.10 or higher. Try 'uv sync --reinstall' or fall back to 'pip install -r requirements.txt' in a fresh virtual environment created with 'python -m venv .venv && source .venv/bin/activate'.

Frequently Asked Questions about Instagram DM MCP

What is Instagram DM MCP?

Instagram DM MCP is a Model Context Protocol (MCP) server that instagram direct messages mcp It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Instagram DM MCP?

Follow the installation instructions on the Instagram DM MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Instagram DM MCP?

Instagram DM MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Instagram DM MCP free to use?

Yes, Instagram DM MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "instagram-dm-mcp": { "command": "npx", "args": ["-y", "instagram-dm-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Instagram DM MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides