MCP server from tiroshanm/facebook-mcp-server
claude mcp add --transport stdio tiroshanm-facebook-mcp-server uv --directory /path/to/facebook-mcp-server run facebook-mcp-server \ --env FACEBOOK_PAGE_ID="Your Facebook Page ID" \ --env FACEBOOK_PAGE_ACCESS_TOKEN="Your Facebook Page access token"
How to use
This Facebook MCP Server provides a set of tools to automate common Facebook Page interactions within the MCP (Model Context Protocol) framework. The available tools include posting content to the Page, replying to comments on posts, retrieving posts and comments, filtering negative comments by keywords, and managing content by deleting posts or comments. Use these capabilities to automate workflows such as scheduled posts, moderation pipelines, or content retrieval for analysis. When integrated with an MCP client, you can call these tools by specifying the appropriate input fields (e.g., message, post_id, comment_id) and handling the responses returned by the server.
To interact with the server, authenticate by supplying a valid Facebook Page access token and specify the target Page ID in the environment configuration. Typical usage involves invoking post_to_facebook to publish updates, using get_page_posts or get_post_comments to fetch content for moderation or analytics, and applying filter_negative_comments to identify potentially problematic content before taking action with delete_post or delete_comment. The tools are designed to be composable within automated workflows, enabling robust moderation and content management pipelines for your Facebook Page.
How to install
Prerequisites:
- A Facebook Page to manage with a corresponding Page Access Token and Page ID.
- A machine with Python and UV (or your preferred MCP runtime) installed.
- Access to the project repository containing the Facebook MCP Server files.
Install steps:
-
Clone the MCP server repository or download the package: git clone https://github.com/tiroshanm-facebook-mcp-server.git cd tiroshanm-facebook-mcp-server
-
Create a .env file with your Facebook credentials: FACEBOOK_PAGE_ACCESS_TOKEN=YOUR_PAGE_ACCESS_TOKEN FACEBOOK_PAGE_ID=YOUR_PAGE_ID
-
Install required dependencies (example using Python/uv setup):
If using a Python package, install with your package manager
pip install -r requirements.txt
-
Start the MCP server (as described in the README example, using uv): uv --directory /path/to/facebook-mcp-server run facebook-mcp-server
-
Verify the server is running by checking logs and ensuring you can call the available tools via your MCP client.
Notes:
- Ensure .env is added to your .gitignore to avoid committing sensitive credentials.
- Adjust the directory path in the startup command to point to your actual server location.
- If using a different runtime (e.g., Docker or Node), adapt the commands accordingly.
Additional notes
Environment variables:
- FACEBOOK_PAGE_ACCESS_TOKEN: Required. Used to authenticate API requests to the Facebook Graph API for the Page.
- FACEBOOK_PAGE_ID: Required. The numeric ID of the Facebook Page to manage.
Common issues:
- Invalid or expired Page Access Token: Renew tokens and update the .env file.
- Insufficient permissions: Ensure the token has the required permissions (pages_manage_posts, pages_read_engagement, pages_show_list, etc.).
- Rate limits or API changes: Facebook Graph API may impose rate limits; implement backoff retries in automated workflows.
Configuration tips:
- Keep sensitive credentials out of version control by using environment files or secret management in your deployment environment.
- When using Claude Desktop or another MCP client, ensure the client is configured to connect to the correct server name (e.g., facebook) and path.
- Regularly test each tool (post_to_facebook, get_page_posts, etc.) with sample data to validate behavior before running in production.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP