Facebook Lyr
БесплатноНе проверенA Facebook/Messenger MCP server that lets AI agents read and engage with profiles, pages, posts, comments, groups, Messenger conversations, notifications, and e
Описание
A Facebook/Messenger MCP server that lets AI agents read and engage with profiles, pages, posts, comments, groups, Messenger conversations, notifications, and events using the user's existing browser session cookies — no Graph API app, tokens, or browser automation required. It supports multi-account and Page switching, write operations (posting, commenting, messaging) with per-identity limits and cooldowns, and honest error reporting where Meta has decommissioned cookie-era endpoints.
README
facebook-lyr
A Facebook / Messenger MCP server for AI agents — profile & page reads, post and comment search, groups, Messenger, notifications, events, and multi-account + Page switching, all through the same session your browser already has. No Graph API app, no tokens, no browser automation.
curl -fsSL https://raw.githubusercontent.com/ishan-parihar/facebook-lyr/main/install.sh | bash
What it does
- Read & discover — profiles, Pages, timeline posts, post details & comments, groups (+ members), people/page/group/post search, Messenger conversations & messages, notifications, and upcoming events.
- Write & engage — text / photo / video / carousel posts, delete your own posts, save & unsave posts, comment on posts, and full Messenger operations (send, delete/unsend, typing indicator, mark-seen).
- Multi-account — store multiple identities (your user, Pages you administer, linked profiles), each with its own cookie set; switch the active identity any time, discover switchable accounts, import cookies per identity, and enforce per-identity posting limits + cooldowns + attempt history.
- Agent-first CLI — AXI-compliant, TOON output, session hooks for Claude Code / Codex, and a self-installing agent skill.
Modeled directly on instagram-lyr — the same architecture, CLI conventions, and browser-cookie authentication flow. Threads lives in a separate project (threads-lyr).
Why cookie scraping?
The official Graph API requires a Meta developer app, app review, and page-scoped tokens — and it cannot see anything your app wasn't granted. Cookie scraping reuses the exact session your browser has, so the agent reads and acts on Facebook the way you would: full timelines, groups, Messenger inboxes, notifications, and events.
curl_cffiwith Chrome TLS impersonation defeats JA3 fingerprint detection.- The
fb_dtsgCSRF token is extracted from the logged-in homepage and auto-refreshed on rotation. - Messenger uses the legacy Mercury ajax endpoints (
threadlist_info.php,thread_info.php,send_messages.php,delete_messages.php) where they still exist. - Feeds, profiles, notifications, events, and search are parsed from Facebook's embedded JSON with a resilient recursive deep-scan — no fragile selectors.
- Account discovery reads the relay data on
/accounts/to list every Page / profile the session can switch to.
Quick install
One-line installation (clones to ~/projects/facebook-lyr):
curl -fsSL https://raw.githubusercontent.com/ishan-parihar/facebook-lyr/main/install.sh | bash
Or install from PyPI with uv (no clone):
uv tool install facebook-lyr
Or in any MCP client — just point it at the package:
{
"mcpServers": {
"facebook": {
"command": "uvx",
"args": ["facebook-lyr"]
}
}
}
Quick start
uv sync # install dependencies (repo install)
facebook-lyr --login # import cookies from your browser (Brave, Chrome, Edge, Firefox, Zen, ...)
facebook-lyr --status # "status: valid" when the session works
facebook-lyr # start the MCP server (stdio)
Headless agents (no interactive step): export the session directly —
export FACEBOOK_COOKIES='{"c_user":"12345","xs":"abc...","fr":"...","datr":"..."}'
facebook-lyr --status
Cookies are stored at
~/.facebook-lyr/profile/cookies.json(mode0600) and never leave your machine.
Tool surface (41 tools)
Read & discover
| Tool | What it gives you |
|---|---|
get_me / get_account_status |
Authenticated identity + session validity |
get_user_posts / get_page_posts |
Recent timeline posts for a user or Page |
get_page_info / get_profile-style info |
Profile / Page summary (bio, follower counts) |
get_post_details / get_post_comments |
Single post + its comments |
search_posts / search_people / search_pages / search_groups |
Keyword discovery across Facebook |
get_group / get_group_posts / get_group_members |
Group metadata, feed, and member list |
get_conversations / get_conversation_messages |
Messenger inbox + thread bodies |
get_notifications |
New alerts (messages, tags, follows, page activity) |
get_events |
Upcoming events for the identity |
get_account_posting_status |
Posting limits + attempt history for an identity |
Write & engage
Every write tool is confirm-gated (confirm=true), respects the identity's daily cap + cooldown, and records the attempt in the identity's posting history.
| Tool | Notes |
|---|---|
create_post |
Text post (≤ 5000 chars) |
create_photo_post |
Image (file/URL), normalized to feed spec |
create_video_post |
Video (file/URL) — best-effort |
create_carousel_post |
2–10 image carousel |
delete_post |
Delete one of your own posts (delete.php) |
save_post / unsave_post |
Bookmark / un-bookmark a post |
comment_on_post |
Comment on a post |
send_message / delete_message |
Send, or delete/unsend, a Messenger message |
send_typing_indicator / mark_conversation_seen |
Presence writes (no quota) |
Accounts & identity
| Tool | What it gives you |
|---|---|
list_accounts / get_active_account_info |
Stored identities + which is active |
list_switchable_accounts |
Every Page/profile the session can switch to |
add_account / remove_account / update_account_cookies |
Manage per-identity cookie stores |
import_account_from_browser |
Import an identity's cookies from a browser |
switch_active_account / set_active_page |
Change the identity every tool acts as |
close_session |
Release active clients |
Authentication
- Interactive:
facebook-lyr --login— importsc_user,xs,fr,datr, … from your browser's cookie store (Brave, Chrome, Edge, Firefox, Zen, Chromium, Opera, Arc, Vivaldi, LibreWolf, Waterfox, Floorp, and more). - Headless:
FACEBOOK_COOKIESenv var (JSON object with at leastc_userandxs). - If the session expires (login wall / 403), tools auto-trigger re-login and tell you to run
--login.
Multi-account (users + Pages)
Store multiple identities — your user account, Pages you administer, linked profiles — each with its own cookie set under ~/.facebook-lyr/accounts/<id>/:
facebook-lyr import_account_from_browser --account_id 100064606727322 --name "My Page" --browser zen
facebook-lyr switch_active_account --account_id 100064606727322
facebook-lyr get_active_account_info
Cookie rotations (xs/fr refreshes) are written back to the owning identity's store automatically, so stored jars stay in sync with the live session. Posting limits, cooldowns, and attempt history are tracked per identity.
Honest limitations
Facebook has been decommissioning its cookie-era write endpoints. Where a write path is dead, the tool fails loudly and honestly instead of faking success:
| Capability | Status |
|---|---|
| Timeline publishing (text/photo/video/carousel) via Graph API | 🟢 working — requires a page-scoped token (see below); the cookie path is decommissioned |
| Comment on posts / delete own posts | 🟢 working (Graph API for comments, cookie delete.php for delete) |
| Save / unsave posts, notifications, events, group members | 🟢 working (legacy endpoints still alive) |
| Messenger text send / delete / typing / seen | 🔴 decommissioned — send_messages.php returns 404 (verified live); the read side (get_conversations) still works |
| React to post/comment, edit post, follow, friend requests, Messenger media/reactions | 🔴 endpoint removed (404) — not possible with cookies or the current token |
| Post via cookies for migrated accounts | 🔴 returns a clear "official API required" error |
Graph API writes need a page-scoped access token, deployed as a sidecar ~/.facebook-lyr/.env:
FACEBOOK_GRAPH_API_TOKEN=...
FACEBOOK_GRAPH_API_PAGE_ID=...
When the token is present, facebook-lyr automatically routes timeline publishing + comments through the Graph API; without it, those writes fail honestly with the "official API required" error. Read tools and the messenger read side are unaffected.
CLI reference
facebook-lyr --help # usage
facebook-lyr --list-tools # all 41 tools
facebook-lyr --tool-info <tool> # params for one tool
facebook-lyr <tool> --param value # call a tool directly (TOON output)
facebook-lyr --login | --status | --logout
facebook-lyr --install-hook # session hooks for Claude Code / Codex
facebook-lyr --install-skill # agent skill for auto-discovery
Development
uv sync --extra dev
uv run pytest # 259 tests: parsers, write surface, limits, Tier-1 tools
uv run ruff check .
License
MIT — see LICENSE.
☕ Support & Sponsorship
If you find this project useful, consider supporting ongoing development:
Your support funds new features, releases, and infrastructure for the whole ecosystem.
Установка Facebook Lyr
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/ishan-parihar/facebook-lyrFAQ
Facebook Lyr MCP бесплатный?
Да, Facebook Lyr MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Facebook Lyr?
Нет, Facebook Lyr работает без API-ключей и переменных окружения.
Facebook Lyr — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Facebook Lyr в Claude Desktop, Claude Code или Cursor?
Открой Facebook Lyr на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Playwright
Browser automation, scraping, screenshots
автор: MicrosoftPuppeteer
Browser automation and web scraping.
автор: modelcontextprotocolopentabs-dev/opentabs
Plugin-based MCP server + Chrome extension that gives AI agents access to web applications through the user's authenticated browser session. 100+ plugins with a
автор: opentabs-devrobhunter/agentdeals
1,500+ developer infrastructure deals, free tiers, and startup programs across 54 categories. Search deals, compare vendors, plan stacks, and track pricing chan
автор: robhunterhlydecker/ucsc-genome-mcp
MCP server to interact with the UCSC Genome Browser API, letting you find genomes, chromosomes, and more.
автор: hlydecker34892002/bilibili-mcp-js
A MCP server that supports searching for Bilibili content. Provides LangChain integration examples and test scripts.
автор: 34892002achiya-automation/safari-mcp
Native Safari browser automation for AI agents with 80+ tools. No Chrome dependency, optimized for Apple Silicon with 60% less CPU overhead.
автор: achiya-automationagent-infra/mcp-server-browser
Browser automation capabilities using Puppeteer, both support local and remote browser connection.
автор: bytedanceaparajithn/agent-scraper-mcp
Web scraping MCP server for AI agents. 6 tools: clean content extraction, structured scraping with CSS selectors, full-page screenshots via Playwright, link ext
автор: aparajithnapireno/DOMShell
Browse the web using filesystem commands (ls, cd, grep, click). 38 MCP tools map Chrome's Accessibility Tree to a virtual filesystem via a Chrome Extension.
автор: apirenoCompare Facebook Lyr with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории browse
