Get the FREE Ultimate OpenClaw Setup Guide →

facebook

Facebook MCP server for automating posts, comment moderation, insights, and sentiment filtering.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hagaihen-facebook-mcp-server uv run --with mcp[cli] --with requests mcp run /path/to/facebook-mcp-server/server.py \
  --env FACEBOOK_PAGE_ID="your_page_id" \
  --env FACEBOOK_ACCESS_TOKEN="your_facebook_page_access_token"

How to use

This MCP server exposes a collection of Facebook-specific tools that let you automate posting, moderation, analytics, and audience insights for a Facebook Page. Tools include creating posts, replying to or deleting comments, retrieving posts and comments, counting engagement metrics, and filtering negative feedback. You can call these tools from Claude Desktop or any compatible agent by referencing the tool names in your prompts, enabling natural-language-driven social media management that directly interacts with the Facebook Graph API through the MCP layer.

To use the server, configure the MCP client to point at your Facebook MCP server instance and ensure the required environment variables (Facebook access token and page ID) are set. Once connected, you can issue tool calls such as post_to_facebook to publish updates, get_post_comments to fetch conversations, get_post_impressions to gauge reach, and filter_negative_comments to surface potentially problematic feedback for moderation. The suite also provides bulk operations for efficiency, like bulk_delete_comments and bulk_hide_comments, making it suitable for scale-driven moderation and analytics workflows.

How to install

Prerequisites:

  • Python installed on your system
  • Access to uv (Python package runner) installation, via the script provided in this project or available from astral.sh/uv

Step 1: Clone the repository

git clone https://github.com/your-org/facebook-mcp-server.git
cd facebook-mcp-server

Step 2: Install uv (if not already installed)

curl -Ls https://astral.sh/uv/install.sh | bash

Step 3: Install project dependencies using uv

uv pip install -r requirements.txt

Step 4: Set up environment variables Create a .env file in the repository root and add:

FACEBOOK_ACCESS_TOKEN=your_facebook_page_access_token
FACEBOOK_PAGE_ID=your_page_id

Step 5: Run the MCP server (example configuration)

uv run --with mcp[cli] --with requests mcp run /path/to/facebook-mcp-server/server.py

Note: Replace /path/to/facebook-mcp-server/server.py with the actual path to your server entry point. Ensure you have the correct permissions and network access for Facebook Graph API usage.

Additional notes

Environment variables: Ensure FACEBOOK_ACCESS_TOKEN has the necessary permissions for the page (pages_show_list, pages_read_engagement, pages_manage_posts, pages_manage_comments, etc.). Keep tokens secure and rotate periodically. If you encounter rate limits from the Graph API, consider implementing backoff strategies in your prompts or throttling calls. The MCP supports a variety of tools; if a tool is not behaving as expected, verify the Facebook Page ID and token scopes, as well as the token's expiry. For Claude integration, you can reference tools by their names defined in the Features table and compose prompts that chain multiple tool calls for complex workflows (e.g., post creation followed by engagement metrics retrieval).

Related MCP Servers

Sponsor this space

Reach thousands of developers