Skip to main content
Glama
taskmaster-ai

Instagram DM MCP Server

Instagram DM MCP 服务器

一个用于 Instagram 私信功能的 MCP(模型消费者协议)服务器,由fastmcp和instagrapi构建。该服务器使 AI 助手能够读取和发送 Instagram 私信。

当前版本:1.3.5

特征

  • 阅读 Instagram 收件箱中最近的直接消息,其中包含全面的主题信息

  • 向 Instagram 用户发送直接消息

  • 简单的问候资源(示例功能)

  • 带有状态信息的健康检查端点

  • 正确记录到 stderr 以避免 JSON 解析问题

  • 支持各种身份验证方法,包括环境变量

Related MCP server: InstantGram

安装

作为 npm 包(推荐)

  1. 全局安装包:

npm install -g instagram-dm-mcp
  1. 运行安装脚本来安装 Python 依赖项:

instagram-dm-mcp-setup
  1. 使用 Claude Desktop 注册服务器并配置凭据:

instagram-dm-mcp install

系统会提示您粘贴 Instagram Cookie 信息。如果您不确定如何获取,请在 Chrome 浏览器中登录 Instagram,右键单击页面,然后选择“检查”。转到“应用程序”选项卡,然后点击左侧边栏中的“Cookie”。您应该会看到一个 Cookie 列表。复制sessionid 、 csrftoken和ds_user_id的值。

install命令会自动将 Instagram DM MCP 服务器注册到 Claude Desktop,并将其添加到您的 Claude Desktop 配置文件中。该命令会将服务器配置为使用npx方法,以便于维护。您也可以将相同的设置复制粘贴到 Claude 或任何其他 MCP 客户端。

您可以通过多种方式提供 Instagram 凭据:

  • 使用命令行参数:

    instagram-dm-mcp install --session-id YOUR_SESSION_ID --csrf-token YOUR_CSRF_TOKEN --ds-user-id YOUR_DS_USER_ID
  • 使用凭证文件:

    instagram-dm-mcp install --from-file /path/to/instagram_cookies.json
  • 使用环境变量(INSTAGRAM_SESSION_ID、INSTAGRAM_CSRF_TOKEN 和 INSTAGRAM_DS_USER_ID)

安装程序会将这些凭据作为环境变量添加到 Claude Desktop 配置文件中,创建如下配置:

"mcpServers": {
  // other servers...
  "InstagramDM": {
    "command": "npx",
    "args": [
      "-y",
      "instagram-dm-mcp",
      "start"
    ],
    "env": {
      "INSTAGRAM_SESSION_ID": "your-session-id",
      "INSTAGRAM_CSRF_TOKEN": "your-csrf-token",
      "INSTAGRAM_DS_USER_ID": "your-ds-user-id"
    }
  }
}

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to read, send, and manage Instagram direct messages, including viewing conversations, sending DMs to users, reacting to messages, and searching for users by username.
    10
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server that enables AI agents to interact with Instagram DMs by managing sessions, sending messages, and configuring webhooks through the InstantGram API.
    1
    MIT
  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables sending Instagram Direct Messages, including text, photos, and videos, and managing chats, messages, media downloads, users, stories, followers, following, and posts through MCP tool calls.
    -
  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables users to send and manage direct messages on Instagram, including text, photos, and videos, and to list chats/messages, search threads/users, download shared media, and perform related account interactions from an MCP-compatible client.
    -