Social Analytics MCP Server
Provides tools for Facebook Page discovery, detailed page info, page-level and post-level insights, feed with engagement data, and access token validation via the Meta Graph API.
Provides tools for Instagram account discovery, profile insights, media engagement, stories, hashtag search, and content publishing limits via the Meta Graph API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Social Analytics MCP Serverget my Instagram account insights for last 7 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Social Analytics MCP Server
A Model Context Protocol (MCP) server for Instagram and Facebook analytics via the Meta Graph API.
Features
Account discovery and profile information
Account-level insights with demographic breakdowns
Media listing with engagement data
Per-post insights (images, videos, reels, carousels)
Stories retrieval
Hashtag search and media discovery
Content publishing rate limits
Mentioned/tagged media
Page discovery and detailed page info
Page-level insights (impressions, engagement, fans, views)
Post-level insights
Posts with inline metrics
Page feed with reactions/comments/shares
Known metrics reference
Access token validation
Shared
Pre-built analysis prompts for common workflows
Retry with exponential backoff on 429/5xx errors
Structured error handling across both platforms
Debug logging via
DEBUG=social-analytics-mcp
Quick Start
Install and build
git clone <repository-url> cd social-analytics-mcp npm install npm run buildGet an access token from the Graph API Explorer with permissions:
Instagram:
instagram_basic,instagram_manage_insights,pages_read_engagementFacebook:
read_insights,pages_read_engagement
Add to your MCP client (see configuration below)
Configuration
Variable | Required | Default | Description |
| For Instagram | — | Facebook User Access Token with Instagram permissions |
| No | Auto-detected | Instagram Business Account ID |
| No |
| Instagram Graph API version |
| For Facebook | — | Facebook User/Page Access Token |
| No | Use discovery tool | Facebook Page ID |
| No |
| Facebook Graph API version |
| No | — | Set to |
You only need to configure access tokens for the platforms you want to use. Account and page IDs can be discovered using the built-in tools.
MCP Client Setup
Claude Desktop
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"social-analytics": {
"command": "node",
"args": ["/absolute/path/to/social-analytics-mcp/dist/index.js"],
"env": {
"INSTAGRAM_ACCESS_TOKEN": "your_token_here",
"FACEBOOK_ACCESS_TOKEN": "your_token_here"
}
}
}
}Claude Code
claude mcp add social-analytics node /absolute/path/to/social-analytics-mcp/dist/index.js \
-e INSTAGRAM_ACCESS_TOKEN=your_token_here \
-e FACEBOOK_ACCESS_TOKEN=your_token_hereAvailable Tools
Instagram Tools
Tool | Description | Required Params |
| List available Instagram Business accounts | — |
| Get account profile info | — |
| Get account-level analytics |
|
| List recent media posts | — |
| Get details for a specific post |
|
| Get insights for a specific post |
|
| Get recent stories | — |
| Search for a hashtag ID |
|
| Get media for a hashtag |
|
| Check publishing rate limits | — |
| Get media where account is tagged | — |
Facebook Tools
Tool | Description | Required Params |
| List accessible Facebook Pages | — |
| Get page profile information | — |
| Get page-level insights |
|
| Get insights for a specific post |
|
| List posts with inline metrics |
|
| Get page feed with engagement data | — |
| List supported metrics reference | — |
| Validate an access token |
|
Common Parameters
Most Instagram tools accept an optional account_id parameter. If not provided, the account is auto-detected from the INSTAGRAM_ACCOUNT_ID environment variable or discovered automatically if only one account exists.
Most Facebook tools accept an optional page_id parameter with similar auto-detection behavior via FACEBOOK_PAGE_ID.
Available Prompts
Prompt | Description |
| Comprehensive Instagram account analysis |
| Comprehensive Facebook Page analysis |
| Compare recent posts on either platform |
| Audience demographic breakdown |
| Interactive setup guide |
Programmatic Usage
import { InstagramClient, FacebookClient, createServer } from 'social-analytics-mcp';
// Use clients directly
const instagram = new InstagramClient({
accessToken: 'your_token',
accountId: 'optional_account_id',
});
const profile = await instagram.getUserProfile();
// Or create an MCP server programmatically
const server = createServer();Troubleshooting
"Access token is invalid"
Ensure your token has the required permissions
Short-lived tokens expire in 1 hour — generate a long-lived token
"No Instagram Business account found"
Your Instagram account must be a Business or Creator account
It must be connected to a Facebook Page
"Unsupported metric"
Some metrics are media-type specific (e.g.,
avg_time_watchedonly works for videos/reels)Use
facebook_list_known_metricsto see supported Facebook metrics
Rate limits
Instagram: 200 calls/hour per user token
The server automatically retries on 429/5xx with exponential backoff
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT
Note: This is an unofficial tool and is not affiliated with Meta, Facebook, or Instagram.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BilalTariq01/instagram-analytics-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server