instagram-personal-mcp

instagram-personal-mcp

An MCP server that wraps instagrapi to read, engage, and send DMs from a personal Instagram account, supporting 24 tools for auth, profile, engagement, and messages.

Category
访问服务器

README

instagram-personal-mcp

Demo

A Model Context Protocol server that wraps instagrapi so Claude (or any MCP client) can read, engage, and DM from a personal Instagram account — no Business/Creator switch, no Meta app review.

⚠️ Unofficial private API. This server uses Instagram's reverse-engineered mobile API (via instagrapi). It is not affiliated with or endorsed by Meta. Accounts driving private-API traffic can be rate-limited, challenged, or permanently disabled. Use a burner account until you trust your setup, keep activity natural, and don't connect over VPNs / datacenter IPs.

24 tools across auth, profile/read, engagement, and DMs.

Quick start

git clone https://github.com/AleemHaider/instagram-personal-mcp
cd instagram-personal-mcp
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Drop your creds in a .env:

cp .env.example .env
# edit: IG_USERNAME, IG_PASSWORD

Then run it:

instagram-personal-mcp

The first call (e.g. instagram_session_status or instagram_login) will authenticate and save a session file to ~/.config/instagram-personal-mcp/session.json. Subsequent runs reuse it.

Connect to Claude Desktop

Edit ~/.config/Claude/claude_desktop_config.json (Linux) / ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "instagram-personal": {
      "command": "instagram-personal-mcp",
      "env": {
        "IG_USERNAME": "your_username",
        "IG_PASSWORD": "your_password"
      }
    }
  }
}

Restart Claude Desktop.

Tools

Auth

Tool What it does
instagram_login Log in. Pass verification_code if 2FA is on.
instagram_logout Log out and delete the saved session.
instagram_session_status Report whether a usable session is loaded.

Profile & read

Tool What it does
instagram_get_my_profile Profile of the logged-in account.
instagram_get_user_profile Public profile of another user.
instagram_search_users Search users by keyword.
instagram_get_user_posts Recent posts by a user.
instagram_get_post Details of a single post (URL or media pk).
instagram_get_post_comments Comments on a post.
instagram_get_post_likers Users who liked a post.
instagram_get_followers List a user's followers.
instagram_get_following List who a user follows.
instagram_get_timeline Home feed.
instagram_get_user_stories Active stories from a user.

Engagement

Tool What it does
instagram_like_post Like a post.
instagram_unlike_post Unlike a post.
instagram_comment_on_post Comment on a post.
instagram_follow_user Follow a user.
instagram_unfollow_user Unfollow a user.
instagram_save_post Save a post to your collection.
instagram_unsave_post Remove a post from your saved collection.

Direct messages

Tool What it does
instagram_list_dm_threads List DM threads.
instagram_get_dm_thread Messages in a thread.
instagram_send_dm Send a DM (comma-separated usernames for group).

2FA flow

  1. Call instagram_login (no code) — if 2FA is required you'll get {"error": true, "code": "2FA_REQUIRED", ...}.
  2. Get the code from your authenticator / SMS.
  3. Call instagram_login again with verification_code="123456".

Errors

Tools return structured errors instead of raising. Look for error: true and a machine-readable code:

  • NOT_LOGGED_IN — call instagram_login first.
  • LOGIN_REQUIRED — saved session was rejected; log in again.
  • 2FA_REQUIRED — call instagram_login again with verification_code.
  • CHALLENGE_REQUIRED — Instagram wants a security challenge solved; log in from the IG app / web once to clear it.
  • RATE_LIMITED — PleaseWaitFewMinutes from upstream; back off.
  • USER_NOT_FOUND / MEDIA_NOT_FOUND — bad input or removed content.

Development

pip install -e ".[dev]"
pytest

Why a separate project from instagram-mcp?

The sibling instagram-mcp wraps the official Instagram Graph API — Business/Creator accounts only, requires a Meta app and tokens, fully ToS-compliant. This project wraps the unofficial private API for personal accounts and carries the risks above. They're kept separate so the official one stays clean and reviewable.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选