# instagram-mcp

Hooks an agent up to the official Instagram Graph API: publishing, insights, comments and DMs across several Business accounts. No private API, no password login.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 11
- Author: adelaidasofia
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/adelaidasofia/instagram-mcp
- Updated: 2026-10-18
- HTML: https://affpapa.org/en/nevibecode/mcp/instagram-mcp

## What it does

Everything runs on the official Graph API, so there is no ban risk from scraping or reverse-engineered endpoints. The server ships 29 tools covering accounts, profile and media reads, publishing for images, videos, reels, carousels and stories, account and per-post insights, follower demographics, comments, hashtag search, mentions and business discovery of any public Professional account. Publishing only accepts public https media URLs, because Instagram downloads the bytes itself — the file has to sit on a reachable CDN.

Multi-account support is built in from the start. One server handles your own account, a brand's and a client's, each with its own token; `add_account` stores tokens in the macOS keychain or a `chmod 600` file. No tool ever returns them.

Before you start you need a Professional account (Business or Creator) linked to a Facebook Page, a long-lived token carrying `instagram_basic`, `instagram_content_publish`, `instagram_manage_comments` and `instagram_manage_insights`, plus the numeric business account id. Python 3.10 or newer as well. A personal account simply cannot reach the Graph API. The DM tools need `instagram_manage_messages`, which Meta only grants through App Review — until approval they fail loudly instead of doing nothing.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `INSTAGRAM_MCP_ACCESS_TOKEN`, `INSTAGRAM_MCP_IG_USER_ID` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env INSTAGRAM_MCP_ACCESS_TOKEN=<INSTAGRAM_MCP_ACCESS_TOKEN> --env INSTAGRAM_MCP_IG_USER_ID=<INSTAGRAM_MCP_IG_USER_ID> --transport stdio instagram-mcp -- uvx adelaidasofia-instagram-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from adelaidasofia-instagram-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add instagram-mcp --env INSTAGRAM_MCP_ACCESS_TOKEN=<INSTAGRAM_MCP_ACCESS_TOKEN> --env INSTAGRAM_MCP_IG_USER_ID=<INSTAGRAM_MCP_IG_USER_ID> -- uvx adelaidasofia-instagram-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from adelaidasofia-instagram-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "instagram-mcp": {
            "command": "uvx",
            "args": [
                "adelaidasofia-instagram-mcp"
            ],
            "env": {
                "INSTAGRAM_MCP_ACCESS_TOKEN": "<INSTAGRAM_MCP_ACCESS_TOKEN>",
                "INSTAGRAM_MCP_IG_USER_ID": "<INSTAGRAM_MCP_IG_USER_ID>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from adelaidasofia-instagram-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "instagram-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "adelaidasofia-instagram-mcp"
            ],
            "env": {
                "INSTAGRAM_MCP_ACCESS_TOKEN": "<INSTAGRAM_MCP_ACCESS_TOKEN>",
                "INSTAGRAM_MCP_IG_USER_ID": "<INSTAGRAM_MCP_IG_USER_ID>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from adelaidasofia-instagram-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e INSTAGRAM_MCP_ACCESS_TOKEN=<INSTAGRAM_MCP_ACCESS_TOKEN> -e INSTAGRAM_MCP_IG_USER_ID=<INSTAGRAM_MCP_IG_USER_ID> instagram-mcp uvx adelaidasofia-instagram-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from adelaidasofia-instagram-mcp <command>

## When to use it
- publish an image, reel or carousel from a media URL
- pull reach, saves and shares for one post
- check follower demographics by age and city
- reply to or hide a comment
- run several brand accounts from one session

## Example prompts
- Publish a carousel from these three URLs to brand-a
- Show reach and saves for the latest reel
- What do our followers look like by city?

## Similar
- [labelhead-artist-momentum](https://affpapa.org/en/nevibecode/mcp/labelhead-artist-momentum.md) — MCP server · ★ 107423
- [openshorts](https://affpapa.org/en/nevibecode/mcp/openshorts.md) — MCP server · ★ 7049
- [OpenScreen](https://affpapa.org/en/nevibecode/mcp/openscreen.md) — MCP server · ★ 4863
- [Usertour MCP Server](https://affpapa.org/en/nevibecode/mcp/usertour-mcp-server.md) — MCP server · ★ 2326
- [Appllama](https://affpapa.org/en/nevibecode/mcp/appllama.md) — MCP server · ★ 3046
- [obsei](https://affpapa.org/en/nevibecode/mcp/obsei.md) — MCP server · ★ 1441

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
