mcp-facebook
Allows managing Facebook Pages: create, schedule, and delete posts; read and reply to comments; hide/unhide comments; and retrieve page analytics (views, fans, engagement).
Click on "Deploy 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., "@mcp-facebook create a post with text 'Hello World'"
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.
@m8lab/mcp-facebook
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)
Related MCP server: Facebook MCP Server
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 |
| Publish an immediate post (text, link, picture) |
| Schedule a post 10 min–6 months in the future |
| Permanently delete a post by ID |
| List recent Page feed posts (up to 100) |
| List comments on a specific post (up to 100) |
| Reply to an existing comment |
| Hide or unhide a comment |
| Retrieve Page-level analytics (views, fans, engagement) |
Environment Variables
Variable | Description |
| Numeric ID of your Facebook Page (e.g. |
| 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 devCopy .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.jsLicense
MIT — see LICENSE
Available Tools
8 toolsfacebook_create_postA
Create and publish an immediate post on the Facebook Page. Supports text, link, and picture attachments.
Inputs: message (required), link, picture.
facebook_delete_postA
Permanently delete a post from the Facebook Page by its post ID.
Inputs: post_id (required).
facebook_get_commentsA
Retrieve comments on a specific Facebook post. Returns comment ID, message, author name, and creation time.
Inputs: post_id (required), limit.
facebook_get_insightsB
Retrieve Page-level analytics insights from Facebook. Choose a metric, aggregation period, and optional date preset.
Inputs: metric, period, date_preset.
facebook_get_postsB
Retrieve recent posts from the Facebook Page feed. Returns post ID, message, creation time, and story.
Inputs: limit.
facebook_hide_commentB
Hide or unhide a comment on a Facebook Page post. Hidden comments are still visible to the commenter but not to others.
Inputs: hide (required), comment_id (required).
facebook_reply_commentC
Reply to an existing comment on a Facebook post by posting a sub-comment.
Inputs: message (required), comment_id (required).
facebook_schedule_postB
Schedule a Facebook Page post for a future time. The scheduled_time must be between 10 minutes and 6 months from now (ISO 8601 format).
Inputs: message (required), scheduled_time (required), link.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct resource and action: post CRUD, comment interactions, and insights. The boundaries between immediate posting (facebook_create_post) and scheduling (facebook_schedule_post) are clearly described, leaving no room for misselection.
All tool names follow the consistent facebook_verb_noun pattern in snake_case (e.g., facebook_get_posts, facebook_create_post, facebook_reply_comment). Verb choices are predictable and resource nouns are clear.
Eight tools is a well-scoped set for a Facebook Page management server. Each tool serves a unique purpose, and there is no redundant or bloat functionality.
The toolset covers core post operations (create, read, schedule, delete), comment management (read, reply, hide), and insights retrieval. However, missing post editing/update and comment deletion are minor gaps that agents can work around.
Maintenance
Related MCP Connectors
Hosted Facebook Pages MCP server, with each action switched on or off per account.
Meta Ads MCP server: run Facebook and Instagram campaigns, ad sets, ads and reports from AI.
Hosted LinkedIn Pages MCP server, with each action switched on or off per account.
Create, schedule, and publish social posts, manage accounts, and read analytics as MCP tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceFacebook MCP server for automating posts, comment moderation, insights, and sentiment filtering.235PythonMIT
- FlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server implementation that provides Facebook Page interaction and management capabilities. This server enables automated posting, comment moderation, and content retrieval.777-
- AlicenseNot gradedqualityDmaintenanceMCP server for interacting with Facebook Messenger API, enabling message sending, receiving, and management through natural language.2MIT
- AlicenseAqualityBmaintenanceA TypeScript MCP server for the Meta Graph API focused on Facebook Pages, enabling publishing, reading, insights, and moderation tasks.53383 npm2MIT