Instagram数据获取服务

一个无需API密钥的MCP服务器,用于获取Instagram公开个人资料、帖子和图片。

  • by crewimia
  • Python
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 crewimia/mcp-instagram

使用说明

mcp instagram

获取公共Instagram个人资料、帖子和图像的MCP(模型上下文协议)服务器。无需API密钥-使用Instagram的移动API,通过TLS指纹绕过 curl_cffi.

工具

工具 说明
get_profile 个人资料信息:个人简介、关注者、个人资料图片(高清)、类别、验证状态
get_posts 最近发布的帖子,包括标题、点赞、评论、日期和完整的轮播支持
get_post_images 最近帖子中高清图像URL的简单列表(跳过视频)

所有工具都接受 用户名 (natgeo一 @手柄 (@natgeo),或a 完整URL (https://instagram.com/natgeo).

快速开始

安装

pip install mcp curl-cffi

或者使用紫外线:

uv pip install mcp curl-cffi

独立运行

python server.py

服务器通过以下方式进行通信 标准 使用MCP协议。

在Claude代码中配置

添加到您的 claude_desktop_config.json 或 .claude.json:

{
  "mcpServers": {
    "instagram": {
      "type": "stdio",
      "command": "python3",
      "args": ["/path/to/mcp-instagram/server.py"]
    }
  }
}

然后在Claude Code中使用:

> Get the profile of @natgeo
> Show me the latest posts from nike
> Get images from https://instagram.com/foodnetwork

输出示例

get_profile("natgeo")

{
  "username": "natgeo",
  "full_name": "National Geographic",
  "biography": "Experience the world through the eyes of National Geographic photographers.",
  "profile_pic_url_hd": "https://...",
  "followers": 283000000,
  "is_verified": true,
  "category": "Media/News Company"
}

get_post_images("natgeo", max_images=3)

{
  "username": "natgeo",
  "count": 3,
  "images": [
    "https://scontent-...",
    "https://scontent-...",
    "https://scontent-..."
  ]
}

运作原理

使用Instagram 移动API (i.instagram.com/api/v1/)使用Android用户代理和 curl_cffi 以匹配Chrome的TLS指纹。这避免了阻止标准HTTP客户端的基于浏览器的速率限制和指纹检测。

  • 无需认证
  • 不需要API密钥
  • 仅适用于公共配置文件
  • 价格受Instagram限制(请尊重)

依赖项

  • 主控程序 >=1.0.0——模型上下文协议SDK
  • curl-cffi >=0.7.0--具有TLS指纹模拟的HTTP客户端

许可证

麻省理工学院