Facebook MCP Server

by livia-zaharia

Not rated
GitHub

About

Automate and manage interactions on a Facebook Page using the Facebook Graph API.

Details

Author
livia-zaharia
Categories
Communication, Productivity

Setup

Install Facebook MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/livia-zaharia/facebook-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

Automate and manage interactions on a Facebook Page using the Facebook Graph API.

This project is aModel Context Protocol (MCP)server for automating and managing interactions on aFacebook Pageusing the Facebook Graph API. It provides tools to create posts, moderate comments, fetch post insights, and filter negative feedback — ready to plug into Claude or any other LLM-based agent.

Originally developed from@HagaiHen/facebook-mcp-server, this version is intended for packaging and distribution via PyPI.

This MCP provides a suite of AI-callable tools that connect directly to a Facebook Page, abstracting common API operations as LLM-friendly functions.

- Empowerssocial media managersto automate moderation and analytics.
- Seamlessly integrates withany Agent client.
- Enables fine-grained control over Facebook content from natural language.

This project requiresPython 3.10+anduv(a fast Python package manager).

curl -LsSf https://astral.sh/uv/install.sh | sh
# Install all dependencies and create a virtual environment uv sync # For development (includes testing and linting tools) uv sync --dev

Create a .env file in the root directory and add your Facebook Page credentials:

FACEBOOK_ACCESS_TOKEN=your_facebook_page_access_token FACEBOOK_PAGE_ID=your_page_id

In the app dashboard, go to Customize Use Case and select all options.

First create a User Access Token — make sure to:

Then generate a Page Access Token (this will inherit the permissions).

Save the Page Access Token and use it in the .env file.

Go to your Facebook Page → About → Scroll down to view the ID

⏰ Important: Facebook API Token Limitations

Facebook access tokens have limited lifespansand will expire, causing API calls to fail. Understanding these limitations is crucial for maintaining your MCP server.

- ❌ All MCP tools will returnOAuthExceptionerrors
- ❌ Error message: "Session has expired"
- ❌ Error codes: 190 (expired token) or 463 (session expired)

We provide a script to easily generate long-lived tokens (60 days):

uv run python scripts/refresh_facebook_token.py

- ✅ Guide you through token generation
- ✅ Exchange short-lived for long-lived tokens
- ✅ Update your.envfile automatically
- ✅ Validate the new token

- 🔄Refresh tokens every 50 daysto avoid expiration
- 📅Set calendar remindersfor token renewal
- 🤖Use long-lived Page tokensfor development
- 🏢Consider System User tokensfor production

# Check if your token is expired uv run python -c " from just_facebook_mcp.manager import Manager manager = Manager() try: result = manager.get_page_fan_count() print('✅ Token is working') except Exception as e: print(f'❌ Token error: {e}') "
# Option 1: Using the script entry point (recommended) uv run just_facebook_mcp # Option 2: Run the Python module directly uv run python -m just_facebook_mcp.server # Option 3: Activate virtual environment first source .venv/bin/activate python -m just_facebook_mcp.server

Go to Settings → Developer → Edit Config

You can use the MCP server without local installing with uvx:

Add the following to your MCP configuration:

{ "mcpServers": { "just_facebook_mcp": { "command": "uvx", "args": [ "just_facebook_mcp" ], "env": { "FACEBOOK_ACCESS_TOKEN": "<put_your_FB_token_here>", "FACEBOOK_PAGE_ID": "<put_your_page_id_here>" } } } }

If you already git-cloned the MCP server you can configure it locally.

Add the following to your MCP configuration:

Option 1: Using the package entry point (recommended)

{ "mcpServers": { "just_facebook_mcp": { "command": "uv", "args": [ "run", "--directory", "/absolute/path/to/just_facebook_mcp-server", "just_facebook_mcp" ] } } }
{ "mcpServers": { "just_facebook_mcp": { "command": "uv", "args": [ "run", "--directory", "/absolute/path/to/just_facebook_mcp-server", "python", "-m", "just_facebook_mcp.server" ] } } }
{ "mcpServers": { "just_facebook_mcp": { "command": "just_facebook_mcp" } } }

Replace/absolute/path/to/just_facebook_mcp-serverwith your actual project path.

Your Facebook MCP server is now configured and ready to power Claude Desktop! You can:

Contributions, issues, and feature requests are welcome!

📄 License This project is licensed under the MIT License. See the LICENSE file for details.

Manage your WhatsApp, SMS and Phone Calls using a single MCP connector

Connect to any function, any language, across network boundaries using AgentRPC.

Access your meeting transcripts, summaries, and action items from any AI assistant.

Connect Claude, ChatGPT, and other AI tools to your Granola meeting notes via MCP. Query your notes, search transcripts, and get meeting insights in your favorite AI assistants.

Build with the Kudosity API to send SMS and MMS. Access developer docs, API references and live testing tools to send messages, manage contact lists, configure webhooks and more.

Send SMS, WhatsApp, and RCS messages programmatically with DLT compliance. Manage contacts, schedule campaigns, and track delivery reports.

Interact with Twilio APIs to send messages, manage phone numbers, configure your account, and more.

The VoIPstudio MCP server gives compatible AI assistants secure access to authorised VoIPstudio account data, including recordings, call detail records, live calls and voicemails in order to query call activity, analyse patterns, identify agent performance issues and generate QA or operations reports in plain English.

A bridge server connecting Agent Communication Protocol (ACP) agents with Model Context Protocol (MCP) clients.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.