facebook-mcp
Allows managing Facebook Pages, including publishing and scheduling posts, creating photo posts, moderating and replying to comments, and reading Page and post analytics.
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., "@facebook-mcp Schedule tomorrow's 9am post on Acme Coffee announcing the new menu."
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.
facebook-mcp
An open-source Model Context Protocol server that lets AI assistants manage your Facebook Pages: publish and schedule posts, moderate comments, and read analytics. It's built on FastMCP and works with Claude Desktop, Claude Code, ChatGPT, Gemini CLI, Cursor, VS Code and any other MCP client.
"Schedule tomorrow's 9am post on Acme Coffee announcing the new menu, then hide any spam comments on yesterday's post."
Features
Multi-page: give it one user token and it finds every Page you manage. Each Page uses its own Page token automatically.
16 tools covering posts, scheduling, photos, Reels, comments, moderation and insights.
Safe by default: tools are labelled read-only or destructive (MCP annotations), a
--read-onlymode hides write tools, requests are signed withappsecret_proof, and tokens never appear in URLs or logs.Runs anywhere: stdio for desktop clients, streamable HTTP (with optional bearer auth) for remote clients, or the Docker image.
Production-quality code: typed (
mypy --strict), layered architecture, and over 95% test coverage against a mocked Graph API.
Related MCP server: Facebook MCP Server
Quick start
1. Get a token. Create a Meta app and generate an access token with the Page permissions listed in docs/setup-meta-app.md. This takes about 5 minutes.
2. Add the server to your MCP client. You'll need uv.
For example, in Claude Desktop's claude_desktop_config.json:
{
"mcpServers": {
"facebook": {
"command": "uvx",
"args": ["facebook-mcp"],
"env": {
"FB_USER_ACCESS_TOKEN": "your-long-lived-user-token",
"FB_APP_SECRET": "your-app-secret"
}
}
}
}Config for every other client (Claude Code, ChatGPT, Gemini CLI, Cursor, VS Code, Docker) is in docs/clients.md.
3. Ask your assistant something like "Which Facebook Pages can you manage?"
Tools
Every tool except list_pages accepts an optional page (a Page id or exact
name). Leave it out and the server uses the default Page. For post ids, it uses
the Page that owns the post.
Tool | Type | Description |
| read | Pages this server can manage |
| read | Name, category, about, link, fans and followers |
| read | Published posts with reaction, comment and share counts (paginated) |
| read | Scheduled, not-yet-published posts |
| read | One post with engagement counts |
| write | Publish or schedule a text/link post |
| write | Publish a photo from a public URL |
| write | Upload a local video and publish or schedule it as a Reel |
| write | Edit a post's text |
| destructive | Delete a post |
| read | Comments on a post, or replies to a comment (paginated) |
| write | Comment as the Page, or reply to a comment |
| write | Hide or unhide a comment |
| destructive | Delete a comment |
| read | Page analytics over a period or date range |
| read | Analytics for one post |
Configuration
Settings come from environment variables, or from a .env file in the working
directory (see .env.example).
Variable | Default | Description |
| Multi-page mode. A long-lived user token; every Page you manage is discovered. | |
| Single-page mode. Use instead of the user token. | |
| Page id or name to use when a tool call doesn't name one | |
| Your app secret. Turns on | |
|
| Graph API version |
|
| Graph request timeout, in seconds |
|
| Timeout for sending and confirming video/file uploads, in seconds |
|
|
|
|
| HTTP transport only |
| HTTP only: require | |
|
| Hide every write tool |
|
| Log level (logs go to stderr) |
CLI flags override environment variables:
facebook-mcp --transport http --port 8000 --read-only
facebook-mcp exchange-token --app-id 123 --token SHORT_LIVED_TOKEN # reads FB_APP_SECRETSecurity
Use
--read-onlyuntil you trust your setup.Always set
MCP_AUTH_TOKENwhen serving over HTTP, and never expose an unauthenticated server to the internet.Turn on Require App Secret in your Meta app's advanced settings, so a leaked token can't be used without your app secret.
Never commit tokens.
.envis git-ignored.
To report a vulnerability, see SECURITY.md.
Documentation
Contributing
Contributions are welcome. See CONTRIBUTING.md for the dev
setup and guidelines. In short: uv sync, then uv run pytest.
License
MIT © Salinda Hulangamuwa
This is an independent project. It is not affiliated with, endorsed by, or sponsored by Meta Platforms, Inc. Facebook is a trademark of Meta Platforms, Inc.
Available Tools
16 toolsadd_commentAdd CommentA
Comment as the Page on a post, or reply to a comment by passing its id.
Optionally attach a local image (photo comment).
Inputs: message (required), object_id (required), page, image_path. Returns: Result of a create call. Photo posts return both a photo id and a post id.
create_photo_postCreate Photo PostA
Publish (or schedule) a photo post from a public URL or a local image file.
Inputs: page, caption, image_url, image_path, +1 more. Returns: Result of a create call. Photo posts return both a photo id and a post id.
create_postCreate PostA
Publish (or schedule) a text/link post on a Page. Needs a message, a link, or both.
Inputs: link, page, message, scheduled_time. Returns: Result of a create call. Photo posts return both a photo id and a post id.
create_reelCreate ReelA
Upload a local video and publish (or schedule) it as a Reel on a Page.
Large videos can take several minutes; upload progress is reported to the client.
Inputs: video_path (required), page, description, scheduled_time. Returns: Result of a create call. Photo posts return both a photo id and a post id.
delete_commentDelete CommentADestructiveIdempotent
Permanently delete a comment. This cannot be undone.
Inputs: comment_id (required), page. Returns: id, success
delete_postDelete PostBDestructiveIdempotent
Permanently delete a Page post. This cannot be undone.
Inputs: post_id (required), page. Returns: id, success
get_page_infoGet Page InfoBRead-onlyIdempotent
Get a Page's profile: name, category, about, link and audience size.
Inputs: page. Returns: id, link, name, about, +3 more
get_page_insightsGet Page InsightsARead-onlyIdempotent
Get Page-level analytics (default: post engagements) for a period and date range.
Inputs: page, since, until, period, +1 more. Returns: result
get_postGet PostBRead-onlyIdempotent
Get a single post with its message, permalink and engagement counts.
Inputs: post_id (required), page. Returns: id, message, share_count, created_time, +5 more
get_post_insightsGet Post InsightsBRead-onlyIdempotent
Get analytics for one post (default: reactions by type and clicks).
Inputs: post_id (required), page, metrics. Returns: result
list_commentsList CommentsARead-onlyIdempotent
List comments on a post, or replies to a comment.
Inputs: object_id (required), page, after, limit, +1 more. Returns: items, next_cursor
list_pagesList PagesARead-onlyIdempotent
List the Facebook Pages this server can manage (id and name).
Inputs: no named parameters. Returns: result
list_postsList PostsARead-onlyIdempotent
List a Page's published posts, newest first, with engagement counts.
Inputs: page, after, limit. Returns: items, next_cursor
list_scheduled_postsList Scheduled PostsBRead-onlyIdempotent
List a Page's posts that are scheduled but not yet published.
Inputs: page, after, limit. Returns: items, next_cursor
update_postUpdate PostBDestructiveIdempotent
Replace the text of an existing Page post.
Inputs: message (required), post_id (required), page. Returns: id, success
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct resource and action across pages, posts, comments, and insights, so an agent can select the right one. The only mild overlap is among create_post, create_photo_post, and create_reel, but their media-type descriptions make the boundaries clear.
All tool names use snake_case with a verb-first pattern (list_, get_, create_, update_, delete_, add_, set_). Minor compound names like set_comment_hidden and create_photo_post still follow a predictable verb-entity structure.
With 16 tools, the set is slightly above the ideal 3-15 range, but each tool maps to a meaningful Page-management operation. The count is reasonable for covering posts, scheduling, comments, pages, and insights.
Core lifecycle operations are covered for posts, comments, pages, and insights, including scheduling and moderation. Minor gaps remain, such as editing comments or media-specific update/delete operations, but most workflows have workarounds.
Maintenance
Related MCP Connectors
Publish and schedule Facebook Page posts from your AI assistant.
Instagram and Facebook Pages for AI agents: publish, comments, DM by keyword, inbox, insights.
Read the Facebook Content radar and schedule posts to your Pages from your AI assistant.
Social media API for AI agents: publish, DMs, comments, Meta ads and leads.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage a Facebook Fanpage via the official Graph API, supporting posting, scheduling, comment moderation, and analytics, without scraping or accessing private messages.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to automate Facebook Page management including posting, commenting, and analytics via the Facebook Graph API.MIT
- AlicenseNot gradedqualityDmaintenanceEnables managing Facebook Pages via the Graph API, including posting, comment moderation, and post insights through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceEnables automating and managing Facebook Page interactions through the Graph API, including posting, comment moderation, engagement analytics, scheduling, and direct messaging from natural language.MIT