Back to MCP directory
publicPublicdnsLocal runtime

mcp-instagram

Instagram MCP服务器,提供通过非官方API访问Instagram的功能,包括查看个人资料、时间线、故事、点赞、评论、关注和搜索等操作,支持Claude Desktop和Cursor IDE等MCP客户端集成。

article

README

🚀 Insta MCP Server

Insta MCP Server 是一个用于集成 Instagram 的 MCP(Model Context Protocol)服务器,它能让你通过 MCP 客户端全面访问 Instagram 的各类功能,实现便捷的互动操作。

✨ 主要特性

  • 全面访问:可查看用户资料、时间线、故事以及详细的帖子信息。
  • 智能互动:能直接在 MCP 客户端对帖子点赞、评论,还可关注用户。
  • 搜索与发现:具备强大的搜索功能,能查找账号并探索内容。
  • 安全认证:拥有强大的登录处理机制,支持双因素认证(2FA)。
  • 开发者友好:可与 Claude Desktop、Cursor 等 MCP 兼容工具无缝集成。

📦 安装指南

此 MCP 服务器可与 Claude Desktop 和 Cursor IDE 等 MCP 兼容客户端配合使用。按照以下说明在客户端中配置服务器。

前提条件

  • 已安装 Node.js 18+ 或 20+
  • 拥有 Instagram 账号凭证(IG_USERNAMEIG_PASSWORD

针对 Claude Desktop

  1. 找到 Claude Desktop 配置文件
    • macOS~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows%APPDATA%\Claude\claude_desktop_config.json
    • Linux~/.config/Claude/claude_desktop_config.json
  2. 打开配置文件(若文件不存在则创建),并在 mcpServers 部分添加以下内容:
{
  "mcpServers": {
    "mcp-instagram": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-instagram"
      ],
      "env": {
        "IG_USERNAME": "your_instagram_username",
        "IG_PASSWORD": "your_instagram_password"
      }
    }
  }
}
  1. 替换凭证
    • your_instagram_username 替换为你的 Instagram 用户名。
    • your_instagram_password 替换为你的 Instagram 密码。
  2. 重启 Claude Desktop 使更改生效。之后你应该能在可用工具列表中看到 Instagram MCP 服务器。

针对 Cursor IDE

  1. 找到 Cursor MCP 配置文件
    • 工作区配置:.cursor/mcp.json(在项目根目录)
    • 全局配置:~/.cursor/mcp.json
  2. 打开配置文件(若文件不存在则创建),并在 mcpServers 部分添加以下内容:
{
  "mcpServers": {
    "mcp-instagram": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-instagram"
      ],
      "env": {
        "IG_USERNAME": "your_instagram_username",
        "IG_PASSWORD": "your_instagram_password"
      }
    }
  }
}
  1. 替换凭证
    • your_instagram_username 替换为你的 Instagram 用户名。
    • your_instagram_password 替换为你的 Instagram 密码。
  2. 重启 Cursor 使更改生效。

替代方法:使用本地安装

如果你已将仓库克隆到本地,可以使用绝对路径:

{
  "mcpServers": {
    "mcp-instagram": {
      "command": "npx",
      "args": [
        "-y",
        "/absolute/path/to/mcp-instagram"
      ],
      "env": {
        "IG_USERNAME": "your_instagram_username",
        "IG_PASSWORD": "your_instagram_password"
      }
    }
  }
}

注意:将 /absolute/path/to/mcp-instagram 替换为你克隆仓库的实际绝对路径。

安全注意事项

  • 切勿将凭证提交到版本控制
  • 建议在 MCP 配置的 env 部分提供凭证。
  • 不会从大语言模型(LLM)请求凭证,必须通过环境变量提供。
  • 若你的 Instagram 账号启用了 2FA,首次登录后需使用 instagram_complete_2fa 工具完成 2FA 流程。

验证安装

重启 MCP 客户端后,你应能在可用服务器列表中看到 Instagram MCP 服务器。你可以通过要求 AI 助手使用以下 Instagram 工具来验证其是否正常工作:

认证

  • instagram_login - 登录 Instagram 账号
  • instagram_complete_2fa - 完成双因素认证
  • instagram_logout - 从 Instagram 注销

资料与内容查看

  • instagram_search_accounts - 搜索 Instagram 账号
  • instagram_get_user_profile - 通过 ID 或用户名获取用户资料信息
  • instagram_get_current_user_profile - 获取已认证用户自己的资料
  • instagram_get_user_posts - 获取用户帖子的分页动态
  • instagram_get_post_details - 获取特定帖子的详细信息
  • instagram_get_user_stories - 获取用户的活跃故事
  • instagram_get_timeline_feed - 获取主页动态(关注账号的帖子)

互动操作

  • instagram_like_post - 点赞帖子或视频
  • instagram_like_comment - 点赞评论
  • instagram_comment_on_post - 对帖子添加评论或回复评论
  • instagram_get_post_comments - 获取帖子的评论

社交操作

  • instagram_follow_user - 关注 Instagram 用户

⚠️ 法律免责声明和风险

重要提示:使用前请阅读

本软件使用非官方的 Instagram API 访问方法,与 Meta Platforms, Inc.(Instagram)没有关联、未得到其认可或支持。使用此 MCP 服务器即表示你承认并同意以下内容:

风险和限制

  1. 账号限制:使用本软件可能导致你的 Instagram 账号因可疑或自动化活动被标记。Instagram 可能会发出警告、暂时限制账号功能,或永久停用或删除你的账号。
  2. 无保证:本软件的功能不保证持续可用,可能因 Instagram 平台、安全措施或政策的更改而随时失效。

责任限制

本软件的作者和贡献者按“原样”提供软件,不提供任何形式的明示或暗示保证。在任何情况下,作者均不对因软件或软件使用而产生的任何索赔、损害或其他责任负责,包括但不限于:

  • Instagram 账号停用、限制或删除
  • 数据、内容丢失或无法访问 Instagram 服务
  • 任何直接、间接、偶然、特殊、后果性或惩罚性损害

使用本软件即表示你对其使用可能产生的任何后果承担全部责任。请自行承担使用风险。

建议

  • 使用备用或测试 Instagram 账号,而非主账号。
  • 监控账号是否有警告或异常活动。
  • 实施合理的速率限制和使用模式,以降低被检测到的风险。
  • 定期查看 Instagram 的服务条款,并遵守所有适用的法律法规。

简而言之:这是常识问题。不要在一小时内点赞 10000 个帖子或关注所有人。Instagram 不喜欢假装成人类的机器人。保持冷静,不要过度使用,你可能就没问题。也许吧。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client