Meta Graph API MCP Server
A Model Context Protocol (MCP) server for Meta Graph API - Facebook Pages, Instagram Business, content management, and analytics.
Features
- Facebook Pages: List pages, create/manage posts, moderate comments
- Instagram Business: Manage connected Instagram accounts, create posts, view insights
- Analytics: Page insights, post engagement metrics, Instagram statistics
- Media Upload: Upload photos to Facebook and Instagram
- OAuth 2.0: Automatic token exchange and long-lived token management
Quick Start
1. Create a Meta Developer App
- Go to Meta for Developers
- Click Create App and select Business app type
- Add the Facebook Login product
- Configure OAuth redirect URI:
http://localhost:3000/oauth/callback
- Note your App ID and App Secret
2. Configure Permissions
In your app's App Review section, request these permissions (all available with Standard access):
Pages:
pages_show_list - List managed pages
pages_read_engagement - Read posts, followers, metadata
pages_manage_posts - Create/edit/delete posts
pages_read_user_content - Read user comments on page
pages_manage_engagement - Reply to/delete comments
read_insights - Page and post analytics
Instagram:
instagram_basic - Read Instagram profile and media
instagram_content_publish - Create organic posts
instagram_manage_comments - Manage comments
instagram_manage_insights - Get Instagram insights
3. Install and Configure
# Clone the repository
git clone https://github.com/jordanburke/meta-graph-api-mcp-server.git
cd meta-graph-api-mcp-server
# Install dependencies
pnpm install
# Copy environment template
cp .env.example .env
# Edit .env with your credentials
4. Environment Variables
# Required
FACEBOOK_APP_ID=your_app_id
FACEBOOK_APP_SECRET=your_app_secret
# Server Configuration
TRANSPORT_TYPE=http # "http" for web/remote, "stdio" for Claude Desktop
PORT=3000
HOST=localhost
BASE_URL=http://localhost:3000
5. Run the Server
# Development (hot reload)
pnpm serve:dev
# Production
pnpm start
MCP Tools (20 total)
Connection & Pages
| Tool | Description |
|---|
test_connection | Test server connection |
get_my_pages | List all managed Facebook pages |
get_page | Get detailed page information |
Posts
| Tool | Description |
|---|
create_page_post | Create a post (text, link, or with photo) |
get_page_posts | List recent posts from a page |
get_post | Get a single post with engagement |
delete_post | Delete a post |
Comments
| Tool | Description |
|---|
get_post_comments | List comments on a post |
reply_to_comment | Reply to a comment |
delete_comment | Delete a comment |
Media
| Tool | Description |
|---|
upload_photo | Upload photo by URL |
Analytics
| Tool | Description |
|---|
get_page_insights | Page-level analytics (impressions, engagement, fans) |
get_post_insights | Post engagement metrics |
Instagram Business
| Tool | Description |
|---|
get_instagram_account | Get linked Instagram Business account |
get_instagram_media | List Instagram posts |
create_instagram_post | Create Instagram post (image + caption) |
get_instagram_comments | List comments on Instagram media |
reply_to_instagram_comment | Reply to Instagram comment |
get_instagram_insights | Instagram account analytics |
Claude Desktop / Claude Code Configuration
Option 1: npx (Recommended)
No installation required - runs directly from npm:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"meta-graph-api": {
"command": "npx",
"args": ["-y", "meta-graph-api-mcp-server"],
"env": {
"FACEBOOK_APP_ID": "your_app_id",
"FACEBOOK_APP_SECRET": "your_app_secret",
"TRANSPORT_TYPE": "stdio"
}
}
}
}
Claude Code (.mcp.json in your project):