Facebook MCP Server

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.

Category
Visit Server

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

  1. Install dependencies:
npm install
  1. Configure Facebook App:

    • Copy env.example to .env
    • Fill in your Facebook App ID and App Secret
    • Set the redirect URI to http://localhost:3000/auth/facebook/callback
  2. Build the project:

npm run build
  1. 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)

  1. Get Login URL: Use the get_facebook_login_url tool with your userId
  2. Click the URL: Open the provided URL in your browser
  3. Authorize: Complete Facebook authorization in the browser
  4. 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 user
  • accessToken: Your Facebook page access token
  • pageId: Your Facebook page ID
  • pageName: Your Facebook page name

3. Post to Facebook

Use the post_to_facebook tool with:

  • userId: The same user ID used during connection
  • message: 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

  1. Go to Facebook Developers
  2. Create a new app or use an existing one
  3. Add the "Facebook Login" product
  4. In App Settings, note down:
    • App ID: Your Facebook App ID
    • App Secret: Your Facebook App Secret
  5. Add these to your .env file
  6. 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

  1. get_facebook_login_url: Get OAuth login URL (recommended for Mistral Le Chat)
  2. connect_facebook_page: Manually connect a Facebook business page
  3. post_to_facebook: Post a text message to Facebook
  4. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured