Facebook Messenger MCP Bridge
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 Messenger MCP Bridgelist my recent Messenger conversations"
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 Messenger MCP Bridge (Python)
A complete, battle-tested AI client bridge that reads and replies to Facebook Messenger using the Model Context Protocol (MCP) and a Chrome Extension.
This system bypasses Facebook's robust anti-bot protections (like the Lexical editor) to allow seamless AI interactions on your personal Messenger account.
Architecture Overview
┌─────────────────┐ MQTT (TCP/WS) ┌──────────────────┐ stdio ┌─────────────┐
│ Chrome Ext │ ◄──────────────────► │ Python MCP │ ◄─────────────► │ AI Client │
│ (Manifest V3) │ Broker (HiveMQ) │ Server │ │ (Claude, │
│ │ │ │ │ Cursor, │
│ - content.js │ │ - fb_read │ │ v.v) │
│ - background │ │ - fb_send │ │ │
└─────────────────┘ └──────────────────┘ └─────────────┘Related MCP server: social-mcp
Features & Breakthroughs
Robust Message Reading: Bypasses obfuscated DOM classes by parsing Facebook's hidden accessibility labels (aria-labels). This correctly identifies the sender, timestamp, and message text regardless of UI updates.
Lexical Editor Bypass: Facebook Messenger uses the Lexical framework which ignores standard DOM value injections (
input.value). This extension bypasses it by:Simulating a native
ClipboardEvent(Paste) to inject text into the editor.Using Javascript to find and trigger a physical
MouseEventon the Send button.
Stable Connection: Uses a persistent MQTT connection via WebSockets from a Chrome Extension Service Worker, relayed to a Python MCP server.
Installation & Setup
1. Install Python Dependencies
uv sync2. Configure Environment
Create a .env file in the root directory with your MQTT broker details (e.g. HiveMQ):
HIVE_MQTT_HOST=your-cluster.s2.eu.hivemq.cloud
HIVE_MQTT_PORT=8883
HIVE_MQTT_USERNAME=mcp-user
HIVE_MQTT_PASSWORD=your-password
HIVE_MQTT_CLIENT_ID=mcp-server-0013. Load Chrome Extension
Open Chrome and navigate to
chrome://extensions/Enable Developer mode (top right toggle)
Click Load unpacked
Select the
chrome-extensionfolder in this project.Make sure you are logged into
https://www.messenger.com.
4. Start the MCP Server
You can run the standalone server script to initialize both the WS-MQTT bridge and the MCP server:
uv run python start.py5. Using with an AI Client (Cursor / Claude Desktop)
Add the following to your MCP client configuration:
{
"mcpServers": {
"facebook-messenger": {
"command": "uv",
"args": ["run", "python", "-m", "mcp_server.server"],
"env": {}
}
}
}Available MCP Tools
Tool | Description |
| List recent Messenger conversations to get |
| Read message history from a specific |
| Send a text message to a |
| Search your Messenger contacts by name. |
| Get metadata about a conversation. |
Security & Disclaimer
⚠️ Important: This tool uses DOM scraping and simulated user input.
It operates using your actual logged-in session.
Facebook may change their UI or anti-bot measures at any time.
Use responsibly to avoid rate limits or account blocks.
This project is not affiliated with or endorsed by Meta/Facebook.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityCmaintenanceEnables AI assistants to manage marketing campaigns, Facebook accounts, and lead generation tasks through the MessengerFlow platform. It provides tools for interacting with messaging inboxes, scraping leads, and accessing real-time performance analytics.Last updated5121
- Flicense-qualityDmaintenanceLets you control Meta apps (Facebook, Instagram, Threads) using your Chrome login session without API tokens, enabling actions like posting, messaging, and reading inbox locally.Last updated2
- Flicense-qualityDmaintenanceEnables AI agents to manage Facebook profiles, pages, posts, and engagement via the Graph API with OAuth authentication.Last updated2
- Alicense-qualityCmaintenanceEnables AI agents to manage a Facebook Fanpage via the official Graph API, supporting posting, scheduling, comment moderation, and analytics, without scraping or accessing private messages.Last updatedMIT
Related MCP Connectors
Give AI agents the LinkedIn tools to find, qualify, engage, and follow up with prospects.
60+ Meta Ads tools for AI agents: audits, campaign management, audiences and CAPI tracking.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/anhln-embedded/fb-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server