Facebook MCP Server
Enables connection to Facebook business pages and posting text messages, with support for OAuth authentication and connection management
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Facebook MCP Serverpost 'Exciting new product launch tomorrow!' to my page"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 installConfigure Facebook App:
Copy
env.exampleto.envFill in your Facebook App ID and App Secret
Set the redirect URI to
http://localhost:3000/auth/facebook/callback
Build the project:
npm run buildRun the server:
# For stdio mode
npm start
# For HTTP mode
npm run start:httpUsage
Method 1: OAuth Flow (Recommended for Mistral Le Chat)
Get Login URL: Use the
get_facebook_login_urltool with youruserIdClick 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
.envfileSet 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"
});This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/engrdeveloper/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server