instagram-analytics
A Model Context Protocol (MCP) server that provides access to Instagram analytics and insights using the Instagram Graph API. This server allows you to retrieve account-level insights, media insights, and profile information programmatically.
claude mcp add --transport stdio bilaltariq01-instagram-analytics-mcp node /absolute/path/to/instagram-analytics-mcp/dist/index.js \ --env FACEBOOK_ACCESS_TOKEN="your_facebook_token_here" \ --env INSTAGRAM_ACCESS_TOKEN="your_instagram_token_here"
How to use
This MCP server provides unified access to Instagram and Facebook analytics via the Meta Graph API. It exposes a set of tools for discovering accounts/pages, retrieving profile and page details, and pulling a variety of insights and media data. You can use the available Instagram tools (such as instagram_list_accounts, instagram_get_profile, instagram_get_account_insights, instagram_list_media, instagram_get_media_details, instagram_get_media_insights, instagram_get_stories, instagram_get_hashtag_search, instagram_get_hashtag_media, instagram_get_content_publishing_limit, instagram_get_mentioned_media) as well as Facebook tools (facebook_list_pages, facebook_get_page_details, facebook_get_page_insights, facebook_get_post_insights, facebook_list_posts_with_insights, facebook_get_page_feed, facebook_list_known_metrics, facebook_validate_token). Most tools accept optional account_id or page_id parameters and will auto-detect when possible using the configured environment variables or discovery features. To run the server, configure your access tokens in the environment, start the MCP server, and then call the tools through your MCP client. You can also leverage the programmatic usage example to instantiate InstagramClient and FacebookClient or to create the MCP server instance for integration into your workflow.
How to install
Prerequisites:
- Node.js (14.x or newer) and npm installed
- Access tokens for Instagram and Facebook with the required permissions
Installation steps:
- Clone the repository: git clone <repository-url>
- Navigate to the project directory: cd instagram-analytics-mcp
- Install dependencies: npm install
- Build the project (if a build step is provided): npm run build
- Run the MCP server (adjust PATH to your environment): npm start
- Set up credentials (environment variables) for runtime:
- INSTAGRAM_ACCESS_TOKEN: Your Instagram User/Business token
- FACEBOOK_ACCESS_TOKEN: Your Facebook User/Page token
Usage example (from MCP client):
- In your MCP client configuration, reference the server as: { "mcpServers": { "instagram-analytics": { "command": "node", "args": ["/absolute/path/to/instagram-analytics-mcp/dist/index.js"], "env": { "INSTAGRAM_ACCESS_TOKEN": "your_instagram_token_here", "FACEBOOK_ACCESS_TOKEN": "your_facebook_token_here" } } } }
Additional notes
Tips and caveats:
- Tokens can expire; consider using long-lived tokens where possible and handle re-authentication in your client.
- The server supports exponential backoff on 429 and 5xx errors to help with rate limits.
- Debug logging can be enabled by setting DEBUG=social-analytics-mcp in the environment for verbose output.
- Some metrics may be limited by the API type or media type; consult facebook_list_known_metrics for supported options.
- Account/Page auto-detection relies on environment variables (INSTAGRAM_ACCOUNT_ID, FACEBOOK_PAGE_ID) or discovery tools; provide explicit IDs if needed to avoid ambiguity.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
MiniMax -JS
Official MiniMax Model Context Protocol (MCP) JavaScript implementation that provides seamless integration with MiniMax's powerful AI capabilities including image generation, video generation, text-to-speech, and voice cloning APIs.
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
akyn-sdk
Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.
promptboard
The Shared Whiteboard for Your AI Agents via MCP. Paste screenshots, mark them up, and share with AI.