SuperAPI AI Directory

instagram_dm_mcp

instagram_dm_mcp is a server based on the Model Context Protocol (MCP) for sending Direct Messages from a user's own Instagram account. It can be connected to Claude Desktop or Cursor, allowing an AI assistant to send Instagram Direct Messages through MCP tool calls. The project is written in Python, offers two dependency installation methods, uv and pip, supports configuring Instagram account credentials via environment variables or command-line arguments, and includes automatic session management to reduce login hang issues. Currently, public information mainly describes the capability of sending Direct Messages, with more features marked as coming soon.

Open website

About this tool

Purpose: instagram_dm_mcp is a Model Context Protocol (MCP) server whose goal is to connect Instagram Direct Message sending capabilities to AI clients that support MCP, such as the Anthropic Claude Desktop application or Cursor. Once connected, users can call the tools provided by this server in conversations with the AI assistant to send Direct Messages from their own Instagram account.

Main capabilities: According to existing information, the project's current core capability is sending Instagram Direct Messages; the repository description states that "more capabilities are coming soon," but does not list a specific feature list. The information mentions that the server includes automatic session management, creating and reusing session files (for example, username_session.json) between runs to maintain authentication status and prevent login hangs.

Usage: Before use, you need to prepare the Anthropic Claude Desktop application (or Cursor), the Python package manager pip (installed via python -m pip install), and an Instagram account. The installation steps are: clone the repository git clone https://github.com/trypeggy/instagram_dm_mcp.git,进入目录 cd instagram_dm_mcp, then install dependencies: use uv (recommended) to run uv sync, or use Pip to run pip install -r requirements.txt.

There are two ways to configure credentials. Method A (recommended) is environment variables: you can run the helper script python setup_env.py to interactively create a .env file, or manually run cp env.example .env and then edit .env to fill in INSTAGRAM_USERNAME and INSTAGRAM_PASSWORD. Method B is command-line arguments, passing --username and --password directly; the information notes that this method is less secure.

When connecting to the MCP server, the Claude Desktop configuration file is saved as ~/Library/Application Support/Claude/claude_desktop_config.json; the Cursor configuration file is saved as ~/.cursor/mcp.json. When using environment variable configuration, you can use the uv method (command is uv, args include run, --directory, the project path, python, src/mcp_server.py) or the Python method (command is python, args point to src/mcp_server.py). When using command-line argument configuration, append --username and --password to args. After configuration is complete, restart Claude Desktop or Cursor, and you will see Instagram DM MCP as an available integration.

Applicable scenarios: Suitable for users who need to send Instagram Direct Messages through MCP tool calls in Claude Desktop or Cursor, for example, having an AI assistant help draft and send Direct Messages.

Limitations and notes: The information does not provide a specific tool list other than sending Direct Messages, rate limits, account security policies, or platform compatibility details; passing credentials via command-line arguments is marked as less secure, and environment variables are recommended. The project uses the MIT License.