Skip to main content
Glama

Built with Knit

Glim is an open-source MCP server that lets Claude, Cursor and other AI agents run an Instagram Business or Creator account. Ask for last week's reach, draft and publish a reel, clear spam comments or answer DMs in plain language. It only uses Meta's official Graph API, so there's no password sharing and no scraping.

Why Glim

🧾 Nothing goes public by accident

Publishing takes two steps. ig_prepare_post uploads a private draft and shows a preview, and ig_publish_post runs only after you confirm.

🔐 Your token stays yours

Glim runs on your machine, reads the token from an env variable and sends it only to Meta in a request header. No tool returns it, and it's removed from error text.

🧪 Try it with no account

Without a token, Glim answers from a built-in fictional bakery account (demo mode), so every tool works out of the box.

🧭 Errors that say what to do

Expired token, missing permission, the 24-hour DM window, publishing quota: each error explains the fix instead of dumping a code.

📏 Checks before it calls

Caption length, 30-hashtag and 20-mention limits, public https:// media URLs and DM byte limits are all checked before anything reaches Instagram.

Related MCP server: Instagram MCP Server

How it works

Quick start

Needs Node.js 20+. Leave out the token to start in demo mode.

Settings → Developer → Edit Config, add this to claude_desktop_config.json, then restart Claude:

{
  "mcpServers": {
    "glim": {
      "command": "npx",
      "args": ["-y", "glim-mcp"],
      "env": { "INSTAGRAM_ACCESS_TOKEN": "IGAA...your token..." }
    }
  }
}
claude mcp add glim -e INSTAGRAM_ACCESS_TOKEN=IGAA... -- npx -y glim-mcp

Add the same JSON as Claude Desktop to ~/.cursor/mcp.json (or .cursor/mcp.json in a project).

Then ask: "Show my Instagram profile." The first line of the answer says whether you're in demo or live mode.

Tools

Group

Tool

What it does

Profile & posts

ig_get_profile

Account, followers, bio, demo or live mode

ig_list_media

Posts, reels and carousels, newest first, cursor paging

ig_get_media

One post: full caption, media URL, carousel slides

Insights

ig_get_account_insights

Views, reach, accounts engaged, interactions, follows over 1–30 days

ig_get_audience

Followers or engaged audience by country, city, age or gender

ig_get_media_insights

Per post; picks the right metrics per type, reels get average watch time

Publishing

ig_prepare_post

Step 1: photo, carousel (2–10), reel or story as a private draft plus preview

ig_publish_post

Step 2: publish the confirmed draft, returns the link

ig_get_publishing_limit

Posts used out of the 24-hour API quota

Comments

ig_list_comments

Comments with replies, likes and hidden state

ig_reply_to_comment

Reply under a comment, or comment on a post

ig_hide_comment

Hide or unhide (reversible)

ig_delete_comment

Delete; marked destructive so clients ask first

Direct messages

ig_list_conversations

Inbox, most recent first

ig_get_messages

Latest 20 messages, and whether you can still reply

ig_send_message

Text reply inside Instagram's 24-hour window

Hashtags

ig_search_hashtag

Top or recent public posts for a hashtag

Read tools support response_format: "json" for structured output. Every tool has MCP annotations (read-only, destructive, idempotent) so clients can auto-approve reads and confirm writes.

Get an access token

  1. Switch your Instagram account to Professional (Business or Creator) in the Instagram app.

  2. Create an app at developers.facebook.com/apps and add Instagram → API setup with Instagram Login.

  3. Under Generate access tokens, add your account and grant: instagram_business_basic, instagram_business_content_publish, instagram_business_manage_comments, instagram_business_manage_messages, instagram_business_manage_insights.

  4. Put the long-lived token (starts with IG, valid 60 days) in INSTAGRAM_ACCESS_TOKEN.

Variable

Needed

Meaning

INSTAGRAM_ACCESS_TOKEN

for live mode

IG… = Instagram Login (graph.instagram.com) · EAA… = Facebook Login (graph.facebook.com)

INSTAGRAM_USER_ID

sometimes

Your professional account ID; set it with Facebook Login if you have several Pages

INSTAGRAM_API_VERSION

no

Defaults to v26.0

  • Hashtag search exists only on the Facebook Login API, with the Instagram Public Content Access feature, for 30 unique hashtags per 7 days. With an IG… token the tool says so.

  • DMs can be sent only within 24 hours of the person's last message. Managing accounts you don't own needs Advanced Access through App Review.

  • Publishing: media must be at a public https:// URL (Instagram downloads it); photos must be JPEG; about 100 API posts per 24 hours.

  • Insights can lag up to 48 hours; demographics need 100+ followers. impressions was retired in 2025, so Glim uses views.

  • Personal (non-professional) accounts aren't supported by Meta's API.

Screenshots

Develop

npm install
npm run build       # compile to dist/
npm test            # 43 unit and tool-flow tests (vitest)
npm run smoke       # starts the built server over stdio and calls real tools
npm run inspect     # opens the MCP Inspector against the built server
  • src/graph.ts: Graph API client with token-type host detection and recovery-focused error messages

  • src/demo.ts: in-process fake Graph API used by demo mode and the tests (same paths, same error codes)

  • src/tools/: one file per tool group · site/: the landing page (static, deployed on Vercel)

  • README media: node docs/readme/make-svgs.mjs and, with the site served on port 5190, node docs/readme/capture.mjs

Disclaimer

Glim is an independent open-source project. It isn't affiliated with, endorsed by or sponsored by Meta Platforms or Instagram. Instagram is a trademark of Meta Platforms, Inc. Follow Meta's Platform Terms and Instagram's community guidelines when using it.

MIT © Jagdish Patil

Available Tools

17 tools
ig_delete_commentDelete a commentA
DestructiveIdempotent

Permanently delete a comment on the account's own post. Can't be undone; confirm with the user first, and consider ig_hide_comment instead.

Inputs: comment_id (required).

ig_get_account_insightsAccount insightsA
Read-onlyIdempotent

Account-level totals over the last N days (1-30): views, reach, accounts engaged, interactions, likes, comments, shares, saves, follows and link taps. 'views' replaced the retired 'impressions' metric. Data can lag up to 48 hours. For audience age/gender/location use ig_get_audience.

Inputs: days, metrics, response_format.

ig_get_audienceAudience demographicsA
Read-onlyIdempotent

Who follows or engages with the account, broken down by country, city, age or gender. Needs at least 100 followers on a live account. 'followers' = follower demographics; 'engaged' = people who interacted with content in the timeframe.

Inputs: audience, breakdown, timeframe, response_format.

ig_get_mediaGet one postA
Read-onlyIdempotent

Get one post, reel or carousel by ID: full caption, type, media URL, permalink, likes, comment count and carousel slides. IDs come from ig_list_media.

Inputs: media_id (required), response_format.

ig_get_media_insightsPost insightsA
Read-onlyIdempotent

Views, reach, likes, comments, shares, saves and interactions for one post, reel or story. Reels also get average watch time. Picks the right metrics for the post type automatically; pass 'metrics' to choose your own. IDs come from ig_list_media.

Inputs: media_id (required), metrics, response_format.

ig_get_messagesRead DM messagesA
Read-onlyIdempotent

Read the latest messages (up to 20, Instagram's limit) in one DM conversation, newest first. Get conversation IDs from ig_list_conversations.

Inputs: conversation_id (required), limit, response_format.

ig_get_profileGet Instagram profileA
Read-onlyIdempotent

Get the connected Instagram professional account: username, name, bio, website, followers, following and post count. Also says whether Glim is in demo mode (fictional sample account) or live. Call this first to check the connection.

Inputs: response_format.

ig_get_publishing_limitPublishing quotaA
Read-onlyIdempotent

How many posts the account has published through the API in the last 24 hours, and the limit (usually 100; carousels count as one).

Inputs: no named parameters.

ig_hide_commentHide or unhide a commentA
Idempotent

Hide a comment (e.g. spam or abuse) so only its author still sees it, or unhide it. Reversible; prefer this over deleting.

Inputs: comment_id (required), hide.

ig_list_commentsList commentsA
Read-onlyIdempotent

List comments on one of the account's posts, newest first, with replies, likes and hidden state. Use comment IDs with ig_reply_to_comment, ig_hide_comment or ig_delete_comment. Get media IDs from ig_list_media.

Inputs: media_id (required), after, limit, response_format.

ig_list_conversationsList DM conversationsA
Read-onlyIdempotent

List the account's Instagram DM conversations, most recent first, with who they're with. Returns conversation IDs for ig_get_messages and the other person's ID (IGSID) for ig_send_message. Needs instagram_business_manage_messages.

Inputs: after, limit, response_format.

ig_list_mediaList postsA
Read-onlyIdempotent

List the account's posts, reels and carousels, newest first, with likes and comment counts. Returns a page; when more exist the result gives an 'after' cursor to pass back for the next page. Use ig_get_media for one post's full details, ig_get_media_insights for its views and reach.

Inputs: after, limit, response_format.

ig_prepare_postPrepare a post (step 1 of 2)A

Step 1 of publishing: upload media to Instagram as an unpublished draft and return a preview with a container_id. Nothing is public yet. Show the preview to the user and get a clear yes, then call ig_publish_post with the container_id. Drafts expire after 24 hours. Media must be at a public https:// URL (Instagram downloads it). Photos must be JPEG. Reels: MP4/MOV, 3 s to 15 min. Types: 'image' (one photo), 'carousel' (2-10 photos/videos), 'reel' (one video), 'story' (one photo or video, no caption). Example: "Post this photo with caption X" -> type='image', media_url='https://.../photo.jpg', caption='X'.

Inputs: type (required), items, caption, alt_text, +4 more.

ig_publish_postPublish a prepared post (step 2 of 2)A

Step 2 of publishing: make a draft from ig_prepare_post public on the account. This can't be undone through the API. Only call after the user has seen the ig_prepare_post preview and confirmed. Returns the new post's ID and link.

Inputs: container_id (required).

ig_reply_to_commentReply to a commentA

Post a public reply. Give comment_id to reply under a comment, or media_id to add a new top-level comment on a post. Replies are public and appear as the account. Instagram only allows replies to top-level comments.

Inputs: message (required), media_id, comment_id.

ig_search_hashtagSearch a hashtagA
Read-onlyIdempotent

Find public posts for a hashtag: 'top' (most popular) or 'recent' (last 24 hours only). Meta limits this to 30 unique hashtags per 7 days per account, and it needs a Facebook Login token with Instagram Public Content Access. Example: "What's trending under #punefood?" -> hashtag='punefood', kind='top'.

Inputs: hashtag (required), kind, limit, response_format.

ig_send_messageSend a DMA

Send a text DM as the account. Instagram allows this only within 24 hours of the person's last message to you. recipient_id is the person's Instagram-scoped ID from ig_list_conversations or ig_get_messages. Max 1000 bytes. Confirm the text with the user first.

Inputs: text (required), recipient_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 17 tools

    Disambiguation5/5

    Each tool targets a clearly distinct resource and action: comments, DMs, media, publishing, hashtag search, and insights are well separated. The closest overlaps, such as ig_get_media versus ig_get_media_insights, are clarified by descriptions and do not create real selection ambiguity.

    Naming Consistency5/5

    All tools use a consistent ig_ prefix followed by snake_case verb_noun phrasing, such as ig_list_media, ig_get_profile, and ig_send_message. The publishing pair ig_prepare_post / ig_publish_post is especially coherent.

    Tool Count4/5

    At 17 tools, the surface is slightly above the typical 3-15 range but remains reasonable given the breadth of Instagram account management. Each tool appears to earn its place, though the set could potentially consolidate a few read/insight operations.

    Completeness4/5

    The set covers the core lifecycle well: profile and media reads, comment moderation, DMs, publishing, and account/media insights. Minor gaps remain, such as no explicit story listing/discovery and no published-post deletion or caption editing, but agents can work around most of these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Connects Claude to Instagram through Meta's official API, enabling users to retrieve account insights, analyze professional profiles, publish photos/carousels/reels/stories, manage comments, read and respond to Direct messages, and call any Graph API endpoint.
      40 npm
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI applications to programmatically interact with Instagram Business accounts through the Graph API, covering profile and media retrieval, engagement insights, publishing images and videos, and reading or replying to direct messages. It exposes these capabilities as tools, resources, and prompts so clients can manage content and analyze performance through natural language.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI applications to interact with Instagram Business accounts through Meta's Graph API, including profile retrieval, media publishing, insights, comments, conversations, and direct messaging.
      -