This MCP server provides a comprehensive interface for automating and managing Facebook Page interactions through the Facebook Graph API. It allows you to create posts, moderate comments, fetch analytics, and more using a set of AI-callable tools.
The Facebook MCP Server acts as a bridge between LLMs (like Claude) and your Facebook Page, offering over 20 specialized tools that make it easy to manage your social media presence programmatically. These tools handle everything from content creation and moderation to detailed analytics retrieval.
git clone https://github.com/your-org/facebook-mcp-server.git
cd facebook-mcp-server
First, install uv if you don't have it:
curl -Ls https://astral.sh/uv/install.sh | bash
Then install project dependencies:
uv pip install -r requirements.txt
Create a .env
file in the root directory with your Facebook credentials:
FACEBOOK_ACCESS_TOKEN=your_facebook_page_access_token
FACEBOOK_PAGE_ID=your_page_id
You can obtain these credentials from the Facebook Graph API Explorer.
To use the Facebook MCP Server with Claude:
"FacebookMCP": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with",
"requests",
"mcp",
"run",
"/path/to/facebook-mcp-server/server.py"
]
}
Make sure to replace /path/to/facebook-mcp-server/
with the actual path to your installation.
post_to_facebook
- Create a new text postpost_image_to_facebook
- Post an image with captionupdate_post
- Edit an existing postschedule_post
- Schedule a post for future publicationreply_to_comment
- Reply to a specific commentsend_dm_to_user
- Send a direct message to a userdelete_comment
- Remove a specific commentfilter_negative_comments
- Identify comments with negative sentimentget_page_posts
- Fetch recent postsget_post_comments
- Get comments on a specific postget_number_of_comments
- Count comments on a postget_post_top_commenters
- Identify most active commentersget_number_of_likes
- Count post likesget_post_impressions
- Get total impressionsget_post_impressions_unique
- Count unique viewersget_post_impressions_paid
- Count paid impressionsget_post_impressions_organic
- Count organic impressionsget_post_engaged_users
- Count user engagementsget_post_clicks
- Count clicks on a postget_post_share_count
- Count sharesget_page_fan_count
- Count total page followersOnce configured, you can use natural language to instruct Claude to perform Facebook Page management tasks. For example:
The MCP server will automatically translate these requests into the appropriate API calls using the tools listed above.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.