instagram_dm_mcp

作者 trypeggy已验证

Instagram Direct messages MCP

178
Stars
37
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/trypeggy/instagram_dm_mcp

快速入门

使用 instagram_dm_mcp 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Instagram DM MCP server

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

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

  • Using uv (recommended):
    uv sync
    
  • Using Pip:
    pip install -r requirements.txt
    
  1. Configure Instagram credentials

    You have two options for providing your Instagram credentials:

    Option A: Environment Variables (Recommended)

    Quick Setup (Recommended):

    Run the helper script:

    python setup_env.py
    

    This will interactively prompt you for your credentials and create the .env file securely.

    Manual Setup:

    Create a .env file in the project root:

    cp env.example .env
    

    Then edit .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):

    • Using uv
    {
      "mcpServers": {
        "instagram_dms": {
            "command": "uv",
            "args": [
              "run",
              "--directory",
              "PATH/TO/instagram_dm_mcp",
              "python",
              "src/mcp_server.py"
            ]
         }
       }
     }
    
    • Using Python
    {
      "mcpServers": {
        "instagram_dms": {
          "command": "python",
          "args": [
            "{{PATH_TO_SRC}}/instagram_dm_mcp/src/ mcp_server.py"
          ]
        }
      }
    }
    

    Configuration with Command Line Arguments:

    {
      "mcpServers": {
        "instagram_dms": {
          "command": "python",
          "args": [
            "{{PATH_TO_SRC}}/instagram_dm_mcp/src/mcp_server.py",
            "--username",
            "{{YOUR_INSTAGRAM_USERNAME}}",
           "--password",
           "{{YOUR_INSTAGRAM_PASSWORD}}"
          ]
        }
      }
    }
    
  3. 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 NameDescription
send_messageSend an Instagram direct message to a user by username.
send_photo_messageSend a photo as an Instagram direct message to a user by username.
send_video_messageSend a video as an Instagram direct message to a user by username.
list_chatsGet Instagram Direct Message threads (chats) from your account, with optional filters/limits.
list_messagesGet 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_messageDownload a direct-uploaded photo or video from a DM message (not for shared posts/reels/clips).
download_shared_post_from_messageDownload media from a shared post, reel, or clip in a DM message (not for direct uploads).
list_media_messagesList all messages containing direct-uploaded media (photo/video) in a DM thread.
mark_message_seenMark a specific message in an Instagram Direct Message thread as seen.
list_pending_chatsGet Instagram Direct Message threads from your pending inbox.
search_threadsSearch Instagram Direct Message threads by username or keyword.
get_thread_by_participantsGet an Instagram Direct Message thread by participant user IDs.
get_thread_detailsGet details and messages for a specific Instagram Direct Message thread by thread ID.
get_user_id_from_usernameGet the Instagram user ID for a given username.
get_username_from_user_idGet the Instagram username for a given user ID.
get_user_infoGet information about a specific Instagram user by username.
search_usersSearch for Instagram users by username
get_user_storiesGet recent stories from a specific Instagram user by username.
like_mediaLike or unlike a specific media post by media ID.
get_user_followersGet a list of followers for a specific Instagram user by username.
get_user_followingGet a list of users that a specific Instagram user is following by username.
get_user_postsGet recent posts from a specific Instagram user by username.

Troubleshooting

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.


Feedback

Your feedback will be massively appreciated. Please tell us which features on that list you like to see next or request entirely new ones.


License

This project is licensed under the MIT License.

License Python

常见问题

What is instagram_dm_mcp?

instagram_dm_mcp is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by trypeggy. Instagram Direct messages MCP. It has 178 GitHub stars.

Is instagram_dm_mcp safe to use?

Yes. instagram_dm_mcp passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install instagram_dm_mcp?

Clone the repository with "git clone https://github.com/trypeggy/instagram_dm_mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is instagram_dm_mcp written in?

instagram_dm_mcp is primarily written in Python. It is open-source under trypeggy on GitHub, so you can review or fork the full source.

Are there alternatives to instagram_dm_mcp?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh instagram_dm_mcp against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情