MCP server for Facebook Pages that allows creating, scheduling, and deleting posts, managing comments, and retrieving Page insights using the Facebook Graph API
About
MCP server for Facebook Pages that allows creating, scheduling, and deleting posts, managing comments, and retrieving Page insights using the Facebook Graph API.
README
MCP server for Facebook Pages — create posts, manage comments, and get insights via Claude Code/Desktop. Uses the Facebook Graph API v25.0 directly with no Facebook SDK dependency.
Requirements
- Node.js >= 18.0.0
- Facebook Page Access Token with the required permissions (see Setup)
Install
Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"facebook": {
"command": "npx",
"args": ["-y", "@m8lab/mcp-facebook"],
"env": {
"FACEBOOK_PAGE_ID": "your_page_id",
"FACEBOOK_PAGE_ACCESS_TOKEN": "your_page_access_token"
}
}
}
}
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"facebook": {
"command": "npx",
"args": ["-y", "@m8lab/mcp-facebook"],
"env": {
"FACEBOOK_PAGE_ID": "your_page_id",
"FACEBOOK_PAGE_ACCESS_TOKEN": "your_page_access_token"
}
}
}
}
Available Tools
| Tool | Description |
|---|---|
facebook_create_post |
Publish an immediate post (text, link, picture) |
facebook_schedule_post |
Schedule a post 10 min–6 months in the future |
facebook_delete_post |
Permanently delete a post by ID |
facebook_get_posts |
List recent Page feed posts (up to 100) |
facebook_get_comments |
List comments on a specific post (up to 100) |
facebook_reply_comment |
Reply to an existing comment |
facebook_hide_comment |
Hide or unhide a comment |
facebook_get_insights |
Retrieve Page-level analytics (views, fans, engagement) |
Environment Variables
| Variable | Description |
|---|---|
FACEBOOK_PAGE_ID |
Numeric ID of your Facebook Page (e.g. 123456789012345) |
FACEBOOK_PAGE_ACCESS_TOKEN |
Long-lived Page Access Token with the required permissions |
How to Get Your Page Access Token
- Go to Meta for Developers and create or open an App.
- Under Use Cases, add Pages and request the following permissions:
pages_manage_posts— create, schedule, delete postspages_read_engagement— read posts and commentspages_manage_engagement— reply to and hide commentspages_read_user_content— read commentsread_insights— access Page analytics
- In the Graph API Explorer:
- Select your App and your Page under User or Page.
- Click Generate Access Token and approve all required permissions.
- Use the token expander in Access Token Debugger to convert it to a long-lived token (~60 days) or generate a never-expiring System User token via Business Manager.
- Your Page ID is the number in your Page's About section or visible in the Graph API Explorer dropdown.
App Review Note: For a live app serving users other than yourself and your test users, Facebook requires App Review for
pages_manage_postsand related permissions. During development you can use the token for your own pages without review.
Development
# Clone the repo
git clone https://github.com/lmtNoLimit/mcp-facebook.git
cd mcp-facebook
# Install dependencies
npm install
# Type check
npm run typecheck
# Build
npm run build
# Watch mode
npm run dev
Copy .env.example to .env and fill in your credentials to run locally:
cp .env.example .env
# Edit .env with your FACEBOOK_PAGE_ID and FACEBOOK_PAGE_ACCESS_TOKEN
node dist/index.js
License
MIT — see LICENSE
Install Facebook in Claude Desktop, Claude Code & Cursor
unyly install mcp-facebookInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add mcp-facebook -- npx -y @m8lab/mcp-facebookFAQ
Is Facebook MCP free?
Yes, Facebook MCP is free — one-click install via Unyly at no cost.
Does Facebook need an API key?
No, Facebook runs without API keys or environment variables.
Is Facebook hosted or self-hosted?
A hosted option is available: Unyly runs the server in the cloud, no local setup required.
How do I install Facebook in Claude Desktop, Claude Code or Cursor?
Open Facebook on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Facebook with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
