PagePilot MCP
Allows AI agents to manage a Facebook Fanpage through the official Graph API, including posting (text, photo, link), scheduling, comment moderation (reply, hide, delete, bulk operations), analytics (fan count, post insights, reactions), and token management.
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., "@PagePilot MCPshow me last week's post engagement statistics"
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.
π PagePilot MCP
π Language / NgΓ΄n ngα»―: English Β· TiαΊΏng Viα»t
An MCP server that lets AI agents manage a Facebook Fanpage through the official Graph API β safe, no scraping, and never touching private messages.
π Table of Contents
Related MCP server: Just Facebook MCP Server
π Introduction
PagePilot MCP is an MCP (Model Context Protocol) server written in Python that lets AI agents such as Claude Desktop, Cursor, or any MCP client directly manage a Facebook Fanpage through the official Facebook Graph API.
Instead of opening a browser and doing everything by hand, you simply give your AI agent instructions in natural language β and PagePilot takes care of the rest: publishing posts, scheduling, moderating comments, and analyzing performance.
π‘ Every action goes through a legitimate Page Access Token that you yourself grant. No cookies, no scraping, no hacks.
β¨ Key Features
π Versatile posting β text, photos, links; create / edit / delete posts and schedule posts for future publishing.
π¬ Smart comment moderation β reply, hide / unhide, delete, bulk operations, and automatic negative comment filtering.
π In-depth analytics β fan count, post insights, reactions, and like / share / comment counts.
π Token management β check Page status, debug tokens, and swap to a long-lived token (~60 days) with a single command.
π‘οΈ Robust Graph client β automatically handles network / Graph API errors, with a configurable timeout.
π§© 29 MCP tools, neatly organized into 4 clear groups.
π Why Is It Safe?
PagePilot is built on a "safety first" principle:
It uses only the official Facebook Graph API. No cookies, no HTML scraping, no browser automation. That means it does not violate Facebook's security mechanisms and carries no risk of getting banned for abnormal behavior.
It uses only a legitimate Page Access Token β a token that you (the Page admin) grant through Facebook's standard OAuth flow.
π« It DELIBERATELY excludes all messaging / Messenger / DM functionality. PagePilot does NOT read, send, or touch anyone's private messages. This tool does exactly one thing: manage a Page's public content β publishing posts, moderating comments, and analytics. User privacy is fully respected.
In short: PagePilot is a Page administration assistant, not a tool for spamming messages or tracking users.
π Requirements
Python 3.10+ (Python 3.12 recommended)
A Facebook Fanpage for which you are an admin
A Facebook App of type Business (to obtain a token and grant permissions)
Any MCP client (Claude Desktop, Cursor, etc.)
π Getting a Facebook Token
Follow these steps to obtain a Page Access Token and Page ID:
Go to developers.facebook.com β Create App β choose the Business type.
Open the Graph API Explorer (Tools β Graph API Explorer).
In the dropdown, select your Page (instead of User).
Grant the following permissions (scopes):
pages_manage_postsβ create / edit / delete postspages_read_engagementβ read engagement (likes, comments, shares)pages_manage_engagementβ moderate comments (hide, delete, reply)pages_read_user_contentβ read user-generated content on the Pageread_insightsβ read analytics (insights)
Click Generate Access Token β copy the Page Access Token.
Get your Page ID: go to the Page β About β Page transparency, or use the
page_statustool itself once configured.
β³ Recommended: The default token from the Explorer only lasts a few hours. Swap it for a long-lived token (~60 days) using the
exchange_long_lived_tokentool (requiresFB_APP_IDandFB_APP_SECRET).
βοΈ Installation & Running
# 1. Clone the project
git clone https://github.com/Thangterter-Pipo/pagepilot-mcp.git
cd pagepilot-mcp
# 2. Create a virtual environment (pick one)
python -m venv .venv # the standard way
# or
uv venv # if you use uv (faster)
# Activate the venv
source .venv/bin/activate # Linux / macOS
.venv\Scripts\activate # Windows
# 3. Install dependencies
pip install -r requirements.txt
# 4. Create a .env file from the template and fill in your token
cp .env.example .env
# Open .env and fill in FB_PAGE_ACCESS_TOKEN, FB_PAGE_ID...
# 5. Run the MCP server
python -m pagepilot.serverπ§© MCP Client Configuration
Example configuration for Claude Desktop (the claude_desktop_config.json file):
{
"mcpServers": {
"pagepilot": {
"command": "python",
"args": ["-m", "pagepilot.server"],
"cwd": "/path/to/pagepilot-mcp",
"env": {
"FB_PAGE_ACCESS_TOKEN": "EAAB...your-token",
"FB_PAGE_ID": "1234567890",
"FB_APP_ID": "optional",
"FB_APP_SECRET": "optional",
"FB_GRAPH_VERSION": "v22.0",
"FB_REQUEST_TIMEOUT": "30"
}
}
}
}π‘ If you use a virtualenv, point
commandto the Python inside the venv (e.g./path/to/pagepilot-mcp/.venv/bin/pythonor...\.venv\Scripts\python.exe) to make sure dependencies are loaded correctly.
After saving the config, restart your MCP client β you'll see PagePilot's 29 tools ready for your AI agent to call.
π οΈ The 29 Tools
PagePilot provides 29 MCP tools, organized into 4 groups:
1οΈβ£ Status & Token
page_statusβ Check the connection status and current Page information.debug_tokenβ Inspect token details: expiry, scopes, app ID (requiresFB_APP_ID/FB_APP_SECRET).exchange_long_lived_tokenβ Swap a short-lived token for a long-lived one (~60 days).
2οΈβ£ Posting
create_postβ Publish a text post to the Page.create_photo_postβ Publish a post with a photo.create_link_postβ Publish a post with a link (includes a preview).update_postβ Update the content of an existing post.delete_postβ Delete a post.schedule_postβ Schedule a post for a future time.get_scheduled_postsβ List posts that are pending scheduled publishing.
3οΈβ£ Reading Posts & Comments / Moderation
list_postsβ List the posts on the Page.get_postβ Get the details of a single post.get_post_permalinkβ Get the public link (permalink) of a post.list_commentsβ List the comments on a post.get_comment_repliesβ Get the replies to a comment.reply_to_commentβ Reply to a comment.delete_commentβ Delete a comment.hide_commentβ Hide a comment.unhide_commentβ Unhide a comment.bulk_delete_commentsβ Delete multiple comments at once.bulk_hide_commentsβ Hide multiple comments at once.filter_negative_commentsβ Filter / detect negative comments.
4οΈβ£ Analytics
get_page_infoβ Get an overview of the Page.get_fan_countβ The number of fans (followers) of the Page.get_post_insightsβ Detailed insights for a single post.get_post_reactionsβ Reaction statistics for a post.get_comment_countβ Count the comments on a post.get_like_countβ Count the likes on a post.get_share_countβ Count the shares of a post.
π Project Structure
pagepilot-mcp/
βββ pagepilot/
β βββ __init__.py
β βββ config.py # Read & validate environment variables (.env)
β βββ graph_client.py # Robust Graph API client: auto-handles network/Graph errors,
β β # supports debug_token + long-lived token exchange
β βββ manager.py # Business logic for all the tools
β βββ server.py # FastMCP entry point (run: python -m pagepilot.server)
βββ requirements.txt
βββ .env.example
βββ LICENSE
βββ README.mdπ§ Environment Variables
Set these in your .env file (copy from .env.example):
FB_PAGE_ACCESS_TOKENβ (required) Page Access Token.FB_PAGE_IDβ (required) The Fanpage's ID.FB_APP_IDβ (optional) App ID β only needed fordebug_tokenor long-lived token exchange.FB_APP_SECRETβ (optional) App Secret β only needed fordebug_tokenor long-lived token exchange.FB_GRAPH_VERSIONβ (optional) Graph API version, defaults tov22.0.FB_REQUEST_TIMEOUTβ (optional) Per-request timeout (seconds), defaults to30.
Example .env:
FB_PAGE_ACCESS_TOKEN=EAAB...your-token-here
FB_PAGE_ID=1234567890
FB_APP_ID=
FB_APP_SECRET=
FB_GRAPH_VERSION=v22.0
FB_REQUEST_TIMEOUT=30β οΈ Disclaimer
PagePilot is intended only for managing Fanpages that you own or have administrative rights to.
You are responsible for complying with Facebook / Meta's Terms of Service (ToS) and Platform Policies when using this tool.
This tool does not support and does not encourage spam, engagement manipulation, or any policy-violating behavior.
The author is not responsible for misuse. Please use it responsibly. π
π License
This project is released under the MIT License. You are free to use, modify, and distribute it.
π€ Author
Thangterter-Pipo π GitHub: github.com/Thangterter-Pipo
If PagePilot is useful to you, please β star the repo to show your support! All issues and pull requests are welcome. π
This server cannot be installed
Maintenance
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/Thangterter-Pipo/pagepilot-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server