home / mcp / facebook mcp server
Facebook MCP server for automating posts, comment moderation, insights, and sentiment filtering.
Configuration
View docs{
"mcpServers": {
"hagaihen-facebook-mcp-server": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with",
"requests",
"mcp",
"run",
"/path/to/facebook-mcp-server/server.py"
],
"env": {
"FACEBOOK_PAGE_ID": "YOUR_FACEBOOK_PAGE_ID",
"FACEBOOK_ACCESS_TOKEN": "YOUR_FACEBOOK_PAGE_ACCESS_TOKEN"
}
}
}
}You can automate Facebook Page interactions by running an MCP server that exposes AI-callable tools to create posts, moderate comments, fetch analytics, and filter negative feedback. It integrates withClaude Desktop or other agent clients, letting you control your Facebook presence through natural language prompts.
You run the MCP server locally and connect your MCP client (such as Claude Desktop or any compatible agent) to access a suite of Facebook-focused tools. Use the client to issue natural-language requests like creating posts, replying to comments, retrieving post statistics, or filtering negative feedback. The MCP maps your prompts to concrete Facebook Graph API operations under the hood, so you don’t have to manage API calls directly.
git clone https://github.com/your-org/facebook-mcp-server.git
cd facebook-mcp-server
```
```
curl -Ls https://astral.sh/uv/install.sh | bash
```
```
uv pip install -r requirements.txt
```
```
FACEBOOK_ACCESS_TOKEN=your_facebook_page_access_token
FACEBOOK_PAGE_ID=your_page_id
```
You should store these in a .env file at the project root with the following keys:
- FACEBOOK_ACCESS_TOKEN
- FACEBOOK_PAGE_ID
```json
{
"FACEBOOK_ACCESS_TOKEN": "your_facebook_page_access_token",
"FACEBOOK_PAGE_ID": "your_page_id"
}Configuration and running the MCP server relies on a local runtime. You’ll install the runtime if needed, set environment variables for your Facebook credentials, and start the server using the provided CLI integration.
Environment variables that you need to configure: - FACEBOOK_ACCESS_TOKEN: your Facebook Page access token - FACEBOOK_PAGE_ID: your Facebook Page ID These values enable the MCP to perform actions on your Page through the Graph API.
Integrating with Claude Desktop involves feeding the MCP’s run command into the client configuration. A sample integration entry is shown here to start the MCP via uv with the necessary modules and the server script.
"FacebookMCP": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with",
"requests",
"mcp",
"run",
"/path/to/facebook-mcp-server/server.py"
]
}Create a new Facebook post with a message.
Reply to a specific comment on a post.
Retrieve recent posts from the Page.
Fetch comments on a given post.
Delete a specific post by ID.
Delete a specific comment by ID.
Hide a comment from public view.
Unhide a previously hidden comment.
Alias for deleting a comment from a specific post.
Filter out comments with negative sentiment keywords.
Count the number of comments on a post.
Count the number of likes on a post.
Get total impressions on a post.
Get number of unique users who saw the post.
Get number of paid impressions on the post.
Get number of organic impressions on the post.
Get number of users who engaged with the post.
Get number of clicks on the post.
Get total number of 'Like' reactions.
Get the top commenters on a post.
Post an image with a caption to the Facebook page.
Send a direct message to a user.
Update an existing post's message.
Schedule a post for future publication.
Retrieve the total number of Page fans.
Get the number of shares on a post.
Get all reaction counts for a post in one call.
Delete multiple comments by ID.
Hide multiple comments by ID.