Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

instagram-mcp

License: MIT Python 3.10+ MCP

An MCP server that exposes public Instagram profiles and posts to Claude (and any MCP-compatible agent). No API key, no OAuth — fetches the same public data the Instagram mobile app sees, using curl_cffi to mimic a real Chrome TLS fingerprint.

Built originally as a building block for Digizap (vitrines digitales générées depuis le compte Instagram d'un commerce), so the tools are shaped around "get me the profile + the photos worth showing" rather than full crawling.


Tools

Tool What it returns
get_profile(username) Display name, bio, profile picture (HD), followers / following / posts counts, business / verified flags, category, external URL
get_posts(username, limit=12) Up to 12 recent posts with images, captions, likes, comments, dates. Handles carousels and video posts
get_post_images(username, max_images=6) Flat list of HD image URLs from recent posts — skips videos. The fast path when you only need media

Accepts a bare username, @username, or a full instagram.com/username/ URL — the server cleans it.


Quick start

git clone https://github.com/IamOrbitDev/instagram-mcp.git
cd instagram-mcp
python3 -m venv venv
source venv/bin/activate          # Windows: venv\Scripts\activate
pip install -r requirements.txt
python server.py                  # serves over stdio

Wire it to Claude Code / Desktop

{
  "mcpServers": {
    "instagram": {
      "command": "/absolute/path/to/instagram-mcp/venv/bin/python",
      "args": ["/absolute/path/to/instagram-mcp/server.py"]
    }
  }
}

For Claude Code, drop this into ~/.claude.json (or your project's .mcp.json). For Claude Desktop, into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows).

Restart Claude. Then ask:

"Fetch the @anthropicai profile and list the last 3 post images."


How it works

Instagram blocks plain requests.get(...) against its mobile API endpoint based on TLS fingerprinting — the Go-based middleware sees python-requests/2.x handshakes and 403s them. curl_cffi (via impersonate="chrome") presents a Chrome cipher suite + extension ordering, so the request looks like the official Android Instagram client. Combined with the right X-IG-App-ID header, the mobile web_profile_info endpoint returns the same JSON the app receives.

The server is a single ~170-line file. No state, no cache, no rate-limiting middleware — curl_cffi does the heavy lifting and Instagram's own throttling kicks in if you abuse it.


Caveats

  • Public profiles only. Private accounts return empty payloads. There's no login flow.
  • Instagram changes its API. The endpoint and field names are stable enough for now (used in production since March 2026), but if Meta tweaks the response shape this server will need updating. If you hit a KeyError, dump _fetch_user_data(username) first.
  • Respect platform rules. Don't hammer this in a loop. Instagram's TOS allow incidental scraping of public profiles for personal use, but mass extraction or commercial reuse may not be — that's between you and your legal team.

License

MIT. See LICENSE.

About

MCP server exposing public Instagram profiles and posts to Claude. No API key TLS-fingerprint bypass via curl_cffi.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages