Facebook MCP Server
Enables AI agents to manage Facebook profiles, pages, posts, and engagement via the Graph API with OAuth authentication.
README
Facebook MCP Server
A comprehensive Model Context Protocol (MCP) server for managing Facebook features, including Profiles, Pages, Posts, and Engagement. This server integrates with the Facebook Graph API and provides a seamless way for AI agents (like Claude Desktop) to interact with Facebook.
Features
- OAuth 2.0 Authentication: No need to hardcode long-lived access tokens. The server includes a built-in OAuth flow to authenticate directly with Facebook.
- Profile Management: Fetch profile details for the authenticated user or specific user IDs.
- Page Management: List managed pages and fetch page insights.
- Content Publishing: Publish posts to feeds or pages, and delete objects.
- Engagement: Read feeds, fetch comments, and reply to comments.
- Docker Support: Easily containerized and run with Docker Compose.
Prerequisites
Before running the server, you need to create a Facebook App on the Meta for Developers portal.
- Go to Meta for Developers.
- Create a new App (choose "Other" -> "Consumer" or "Business" depending on your needs).
- Add the Facebook Login product to your app.
- In the Facebook Login settings, add your redirect URI to the "Valid OAuth Redirect URIs" list. By default, it should be:
http://localhost:3000/auth/facebook/callback. - Get your App ID and App Secret from the App Dashboard -> Settings -> Basic.
Installation
Local Setup
- Clone or copy the project files to your desired directory.
- Install dependencies:
npm install - Copy
.env.exampleto.envand fill in your credentials:Editcp .env.example .env.env:FACEBOOK_APP_ID=your_actual_app_id FACEBOOK_APP_SECRET=your_actual_app_secret PORT=3000 REDIRECT_URI=http://localhost:3000/auth/facebook/callback
Running the Server
Option 1: Local Node.js
- Build the project:
npm run build - Start the server:
npm start
Option 2: Docker
- Make sure your
.envfile is filled out. - Run with Docker Compose:
This will build the image and start the server, exposing the port specified in yourdocker-compose up --build.envfile (default 3000) for the authentication callback.
Connecting to Claude Desktop
Add the server to your Claude Desktop configuration file (usually located at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS).
For Local Execution:
{
"mcpServers": {
"facebook": {
"command": "node",
"args": ["f:/MCP_Server/Facebook_MCP_server/dist/index.js"],
"env": {
"FACEBOOK_APP_ID": "your_app_id",
"FACEBOOK_APP_SECRET": "your_app_secret",
"REDIRECT_URI": "http://localhost:3000/auth/facebook/callback",
"PORT": "3000"
}
}
}
}
(Adjust the path to index.js as necessary)
For Docker Execution:
If running via Docker, the server reads the .env file from the directory. You can use the docker command in Claude config if you have Claude configured to run docker commands, or simply run the container in the background and connect via network if supported (though stdio is the standard for Claude Desktop).
Authentication Flow
Once the server is connected to Claude Desktop:
- Ask Claude to "Authenticate with Facebook" or use the
fb_authenticatetool. - Claude will provide a login URL.
- Open the URL in your browser, log in to Facebook, and authorize the application.
- You will be redirected to a page that says "Authentication Successful!".
- The server automatically saves the access token in a local
.fb_token.jsonfile. - You can now start using all other tools!
Available Tools
Auth
fb_authenticate: Returns the URL to start the OAuth login process.
Profile
fb_get_profile: Get profile details (ID, Name, etc.). Can acceptuserIdandfields.
Pages
fb_get_pages: List Facebook Pages managed by the authenticated user.fb_get_page_insights: Get metrics (like impressions) for a specific page.
Publishing
fb_publish_post: Publish a message or link to a feed/page.fb_delete_object: Delete a post or comment by ID.
Engagement
fb_get_feed: Get posts from a feed.fb_get_comments: Get comments on an object.fb_reply_comment: Post a reply to a comment.
License
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.