Facebook MCP Server
Enables posting text messages to Facebook business pages through MCP. Supports OAuth authentication and manual connection methods for managing Facebook page content.
README
Facebook MCP Server
A simple Model Context Protocol (MCP) server for connecting to Facebook business pages and posting text messages.
Features
- Connect Facebook Page: Connect your Facebook business page using an access token
- Post to Facebook: Post simple text messages to your connected Facebook page
- Check Connection: Verify your Facebook page connection status
- User Data Storage: Automatically saves user connection data to JSON file
Setup
- Install dependencies:
npm install
-
Configure Facebook App:
- Copy
env.exampleto.env - Fill in your Facebook App ID and App Secret
- Set the redirect URI to
http://localhost:3000/auth/facebook/callback
- Copy
-
Build the project:
npm run build
- Run the server:
# For stdio mode
npm start
# For HTTP mode
npm run start:http
Usage
Method 1: OAuth Flow (Recommended for Mistral Le Chat)
- Get Login URL: Use the
get_facebook_login_urltool with youruserId - Click the URL: Open the provided URL in your browser
- Authorize: Complete Facebook authorization in the browser
- Return to Chat: Come back to Mistral Le Chat and use other tools
Method 2: Manual Connection
Use the connect_facebook_page tool with:
userId: A unique identifier for the useraccessToken: Your Facebook page access tokenpageId: Your Facebook page IDpageName: Your Facebook page name
3. Post to Facebook
Use the post_to_facebook tool with:
userId: The same user ID used during connectionmessage: The text message you want to post
4. Check Connection
Use the check_facebook_connection tool with:
userId: The user ID to check connection for
Getting Facebook App Credentials
- Go to Facebook Developers
- Create a new app or use an existing one
- Add the "Facebook Login" product
- In App Settings, note down:
- App ID: Your Facebook App ID
- App Secret: Your Facebook App Secret
- Add these to your
.envfile - Set the redirect URI to:
http://localhost:3000/auth/facebook/callback
User Data Storage
User connection data is automatically saved to user_data.json in the project root. This includes:
- User ID
- Facebook access token
- Page ID and name
- Connection timestamp
Tools Available
- get_facebook_login_url: Get OAuth login URL (recommended for Mistral Le Chat)
- connect_facebook_page: Manually connect a Facebook business page
- post_to_facebook: Post a text message to Facebook
- check_facebook_connection: Check connection status
Example Usage
OAuth Flow (Recommended)
// Step 1: Get login URL
get_facebook_login_url({
userId: "user123"
});
// Step 2: Click the URL in browser, complete Facebook auth
// Step 3: Use other tools
post_to_facebook({
userId: "user123",
message: "Hello from MCP server!"
});
Manual Connection
// Connect to Facebook page manually
connect_facebook_page({
userId: "user123",
accessToken: "your_page_access_token",
pageId: "your_page_id",
pageName: "Your Page Name"
});
// Post a message
post_to_facebook({
userId: "user123",
message: "Hello from MCP server!"
});
// Check connection
check_facebook_connection({
userId: "user123"
});
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.