instagram-mcp — Instagram Graph API MCP server
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.
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-mcpWhat instagram-mcp 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.
What it helps with
- 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 for the agent
- 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?
How to install instagram-mcp
Platform CLI
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-mcpReplace <…> 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>
Platform CLI
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-mcpReplace <…> 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>
Config file
{
"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>
Config file
{
"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>
Platform CLI
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-mcpReplace <…> 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>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about instagram-mcp
How do I install instagram-mcp in Claude Code?
Run claude mcp add instagram-mcp -e INSTAGRAM_MCP_ACCESS_TOKEN=<INSTAGRAM_MCP_ACCESS_TOKEN> -- uvx adelaidasofia-instagram-mcp. To pass the account id as well, use the two---env form: `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`.
What does instagram-mcp do?
It connects an agent to the official Instagram Graph API: profile and media reads, publishing, insights, comments, hashtag search and mentions. All of it works across multiple Business or Creator accounts at once.
Why do the DM tools fail?
They need the instagram_manage_messages permission, and Meta hands that out only after App Review. Until the app is approved the tools return an error explaining this. Once approved, set INSTAGRAM_MCP_DM_ENABLED=1.