Instagram MCP serverand Python AI tasks
qbash hosts a Instagram MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse. Developers use qbash Tasks to write cloud-hosted Python functions that pair Instagram with models such as Claude and GPT.
Add the qbash MCP
Use Instagram from Claude Code, Codex, Cursor and other MCP clients. Connect Instagram in qbash, and your agent can work with its data and build Tasks that call it.
claude mcp add --transport http qbash https://mcp.qbash.com/mcp
Then run /mcp in Claude Code and sign in with qbash.
- Read the account's username, account type, follower count and media count
- List the account's posts, reels and carousels with caption, likes, comment count and permalink
- Read one post with its caption, media type, media URL and counts
- List the stories the account has live now
- Upload an image, reel, story or carousel item from a public URL, ready to publish
- Check whether an uploaded video container has finished processing
Write a Instagram task in Python
A qbash Task is a Python function hosted in the cloud. Python is the runtime and defines the process, and built-in inline prompts run on leading models such as Claude, GPT, Gemini and Grok.
Run a Task on a schedule, from an HTTP request or when a connected app sends an event. Your agents and chat tools call it over MCP.
Each run is logged with its inputs and results, and you can turn data logging off for any Task. Every Task has version control, and each run is locked to the version it ran.
Compare last month's Instagram posts by engagement
list_media reads last month's posts with their captions, likes and comment counts. An inline prompt ranks them and says what the best performers have in common.
media = qbash.integrations.instagram.list_media(
since="2026-10-01",
until="2026-10-31",
fields=["id", "caption", "media_type", "media_product_type", "like_count", "comments_count", "timestamp", "permalink"],
limit=100,
)
posts = media["data"]
if posts:
review = qbash.ai.run_prompt(
slug="instagram-post-review",
variables={"posts": json.dumps(posts)},
)
qbash.output(review)
else:
qbash.output("The account published nothing between those dates.")
Sample list_media response
{
"status": "success",
"data": [
{
"id": "18034567890123456",
"caption": "Behind the scenes at the roastery, batch 212 going in.",
"media_type": "VIDEO",
"media_product_type": "REELS",
"like_count": 1284,
"comments_count": 73,
"timestamp": "2026-10-28T15:02:11+0000",
"permalink": "https://www.instagram.com/reel/EXAMPLE1/"
},
{
"id": "18034567890123457",
"caption": "New single origin from Huila is in. Tasting notes in the comments.",
"media_type": "CAROUSEL_ALBUM",
"media_product_type": "FEED",
"like_count": 412,
"comments_count": 38,
"timestamp": "2026-10-21T13:30:00+0000",
"permalink": "https://www.instagram.com/p/EXAMPLE2/"
},
{
"id": "18034567890123458",
"caption": "Closed Monday for the holiday.",
"media_type": "IMAGE",
"media_product_type": "FEED",
"like_count": 96,
"comments_count": 4,
"timestamp": "2026-10-10T09:00:00+0000",
"permalink": "https://www.instagram.com/p/EXAMPLE3/"
}
],
"paging": {
"cursors": {
"before": "QVFIUk1",
"after": "QVFIUm9"
}
}
}
Custom MCP server
Build a custom MCP server with Instagram
Create a hosted MCP server that combines Instagram tools with your other connectors, Tasks and memory folders. You choose each tool it exposes, so a server can share Instagram reads with write tools left off.
Share the server with your team, and each person adds it to the client they already use.
Instagram MCP questions
Does Instagram have an official MCP server?
Meta's MCP documentation index lists an Instagram Business MCP server that reads profiles and media and publishes posts, Reels, Stories and carousels. As of November 2026 its page gives no endpoint or setup steps, and Meta's table of available servers leaves it out. The qbash server covers posts, comments and insights on one URL with your other connectors, and the same methods run in Python Tasks.
Does the Instagram connector work with personal accounts?
It works with professional accounts only, business or creator. Instagram's API does not serve personal accounts, and you can switch one to a professional account for free in the Instagram app settings.
What does the Instagram connector need to connect?
An Instagram sign-in to the professional account, with no Facebook Page needed. It grants instagram_business_basic for reading, instagram_business_content_publish for publishing, instagram_business_manage_comments for replies and moderation, and instagram_business_manage_insights for insights.
Can the Instagram MCP server publish posts?
Publishing takes two calls: create_media_container uploads the image or video from a public URL, and publish_media puts it live. Instagram caps how many posts an account can publish through the API in 24 hours, and get_publishing_limit reads the current count.
Related marketing connectors
Build a Instagram task
Write it in Python with AI steps, or describe it to your coding agent through the qbash MCP.