A Facebook MCP server is a Model Context Protocol server that gives an AI agent such as Claude, ChatGPT or Cursor tools for Facebook data: a page's latest posts with reactions, comments, shares and video views, page details, comments, reels and the ads a brand runs across Meta. For research on pages you don't manage, the best Facebook MCP setup is the hosted Scrape.ly MCP server: your agent runs ready-made Facebook scrapers in the cloud against public pages, with no Facebook login, no Meta developer app and no Page access token.
This guide explains how that differs from Meta's own MCP servers, shows the setup per client, the Actors, the tool calls and two real runs from 27 October 2026: Duolingo's five latest posts with a reaction breakdown in 15.9 seconds, then the ten active US ads behind the same page in 25.2 seconds, for under two cents together.
Does Meta have an official Facebook MCP server?
Meta runs several, all for managing what you own. Its MCP overview lists three remote servers: Meta Ads MCP, to "Manage Meta ads - analyze campaign performance, create and edit ads, campaigns, and catalogs, assess signal health, run experiments, review activity logs, and search help articles"; Meta Social Technologies MCP, to "Manage the Meta apps and integrations you build" on Meta's developer platform; and WhatsApp Business Tools MCP for a WhatsApp Business integration.
The ads server lives at mcp.facebook.com/ads. Per Meta's setup guide, you sign in "with your Facebook account or your Meta Managed Account", and a token needs at least the ads_mcp_management permission plus ads_read or ads_management. Since 16 July 2026 any developer with their own Meta app can connect to it. Its sample prompts start with "List my ad accounts."
Most third-party Facebook MCP servers on GitHub work the same way, one Page at a time. HagaiHen/facebook-mcp-server, one of the first results, is configured with FACEBOOK_ACCESS_TOKEN=your_facebook_page_access_token and FACEBOOK_PAGE_ID=your_page_id.
Those are tools for an ad account or Page you control. Research questions are about pages you don't: what a competitor posted this week, which formats earn shares, which ads a rival is running in the US right now. That needs public data, which is what the Scrape.ly server reads.
| Scrape.ly MCP server | Meta Ads MCP | Page-token servers | |
|---|---|---|---|
| Built for | Research on any public page and its ads | Managing your own Meta ad accounts | Managing one Page you admin |
| Facebook account needed | None | Facebook or Meta Managed Account sign-in | A Page access token |
| Whose data | Any public page, post, reel or Ad Library search | The ad accounts you authorize | Your Page |
| What the agent gets | Rows: posts with reaction breakdown and views, page details, comments, ads with copy, CTA, dates and platforms | Campaign tools and reports | Whatever the Graph API allows that token |
| Export and schedule | JSON, CSV or Excel datasets; schedules and automations | Inside the chat | Depends on the server |
How to connect the Scrape.ly MCP server
The Scrape.ly MCP server is hosted at https://mcp.scrape.ly, speaks MCP's streamable HTTP transport and signs you in with OAuth or a Scrape.ly API token. Create a free account first; the free plan includes $5 of usage credit every month, no card needed.
Claude Code. One command, then /mcp inside Claude Code to sign in:
claude mcp add --transport http scrapely https://mcp.scrape.lyClaude Desktop and claude.ai. Add https://mcp.scrape.ly as a custom connector under Customize → Connectors.
Cursor. Add this to ~/.cursor/mcp.json, or leave out headers to sign in with OAuth:
{
"mcpServers": {
"scrapely": {
"url": "https://mcp.scrape.ly",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
}ChatGPT, VS Code, Windsurf and others use the same URL; formats are in the MCP docs.
A Facebook-only server. To give the agent just posts and ads:
https://mcp.scrape.ly?actors=echofield/facebook-posts-scraper,echofield/facebook-ads-scraperThe Facebook Actors your agent can call
Each data type has its own Actor in the Store, all maintained by Scrape.ly and all reading public pages without a login:
| Actor | Input | What comes back |
|---|---|---|
| Facebook Posts Scraper | Page, post or reel URLs | Text, time, total reactions and the per-type breakdown, comments and shares counts, video views, media, link previews, top comments, the page's Ad Library id |
| Facebook Ad Library Scraper | Page URL, page name or an Ad Library search link | One row per ad: copy, title, CTA, cards, images, videos, landing URL, start and end dates, active flag, platforms |
| Facebook Pages Scraper | Page URLs | Followers, category, contact details, website, ratings, ad status |
| Facebook Comments Scraper | Post, reel, photo or video URLs | Comment text, time, likes |
| Facebook Reels, Reviews, Groups and Events Scrapers | Pages, groups, cities | Reels with play counts, page reviews, public group posts, events |
The Posts Scraper costs $2.37 per 1,000 posts and the Ad Library Scraper $0.41 per 1,000 ads, platform usage included, as listed on their Store pages on 27 October 2026. The Facebook scrapers page compares the whole family with sample output.
What the agent does: the four tool calls
search-actorswith "facebook" finds the Actors above.fetch-actor-detailsreturns the input schema, README and price, so the agent knows posts takestartUrlsandresultsLimit.call-actorstarts the run and waits up to 45 seconds. Both runs below finished inside that.get-actor-outputreads the rows, only the fields the agent asks for.
The rows never land in the call-actor reply, so a large export doesn't flood the context window.
A real run: a brand page's latest posts
The prompt: "Use scrapely to get Duolingo's five latest Facebook posts with reactions, comments, shares and views, and tell me what kind of post gets the most laughs."
The agent sends echofield/facebook-posts-scraper the page URL with a cap:
{
"actor": "echofield/facebook-posts-scraper",
"input": {
"startUrls": [{ "url": "https://www.facebook.com/duolingo/" }],
"resultsLimit": 5
},
"waitSecs": 45,
"callOptions": { "maxTotalChargeUsd": 0.05 }
}The run on 27 October 2026 took 15.9 seconds. Its log:
2026-10-27T16:10:25.114Z [scrapely.actor] INFO Finished posts=5 pages=2
2026-10-27T16:10:27.715Z [scrapely.actor] INFO Comments from post pages 1/1
2026-10-27T16:10:28.518Z [scrapely.actor] INFO Pushed 5 itemsThe agent read time,text,likes,comments,shares,viewsCount,isVideo,reactionLikeCount,reactionLoveCount,reactionHahaCount,pageAdLibrary:
| Posted | Type | Reactions | Haha | Comments | Shares | Views | Caption |
|---|---|---|---|---|---|---|---|
| Oct 27 | Post | 14 | 4 | 0 | 2 | — | i have a chin and a jaw, jjincha |
| Oct 26 | Reel | 9,588 | 4,543 | 390 | 1,726 | 104,378 | make my own group, call it K/DUO |
| Oct 26 | Reel | 1,507 | 46 | 29 | 51 | 23,083 | could've been us if u did ur lesson |
| Oct 26 | Reel | 4,918 | 688 | 184 | 87 | 194,751 | leave everything in the past except ur streak |
| Oct 23 | Post | 19,381 | 8,276 | 309 | 717 | — | i heard they're selling me today? |
The agent's answer: the two posts built around the mascot as a character, the K/DUO reel and the Oct 23 "selling me" post, got the most laughs, with Haha making up 47% and 43% of their reactions. The most-viewed reel, at 194,751 views, drew mostly plain Likes. The newest post was ten minutes old when the run started, so its 14 reactions say nothing yet. "Reactions" is Facebook's total; the run also returned the Love and Care counts and a short list of top comments, which we leave out because commenters are private people.
Three of these reels were also on Duolingo's TikTok, and our TikTok MCP run read them two minutes earlier. The "leave everything in the past" clip had 879,800 TikTok plays and 22,900 shares against 194,751 Facebook views and 87 shares. Each platform counts views its own way, but a gap that wide is the kind an agent can flag in one sentence.
Cost: 5 × $0.00237 = $0.01185 at list price, platform usage included; our account was billed $0.00948 after its plan's Store discount.
The next call: the ads behind the page
Every post row carried pageAdLibrary.id, the page's id in Meta's Ad Library, which was 141935472517297. The agent turned it into an Ad Library link for active US ads and called the Ad Library Scraper:
{
"actor": "echofield/facebook-ads-scraper",
"input": {
"startUrls": [{ "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&is_targeted_country=false&media_type=all&search_type=page&view_all_page_id=141935472517297" }],
"resultsLimit": 10
},
"waitSecs": 45,
"callOptions": { "maxTotalChargeUsd": 0.05 }
}It finished in 25.2 seconds with "Saved 10 ads." The log shows the Actor handling a failed request by itself:
2026-10-27T16:11:11.449Z [scrapely.actor] INFO Search attempt 1 did not return ads (SSLError)
2026-10-27T16:11:14.199Z [scrapely.actor] INFO Pushed 10 itemsAll ten ads were active, ran on Facebook, Instagram, Audience Network and Threads, used Meta's dynamic creative (DCO) format with an "Install now" button and pointed to the Duolingo app on Google Play. Grouped by headline:
| Headline | Language | Ads | Started |
|---|---|---|---|
| Free Language Learning | English | 4 | Oct 14 (3), Oct 21 (1) |
| Speak Confidently on Duolingo | English | 1 | Oct 14 |
| Aprende idiomas jugando ¡y gratis! | Spanish | 3 | Oct 14 |
| Aprende inglés gratis | Spanish | 2 | Oct 14 |
Half of the brand's active US ads in this sample were in Spanish, every one asked for an app install, and none mentioned the paid Super plan. The organic feed jokes; the ads push installs. Cost: 10 × $0.000406 = $0.00406 at list price, $0.00325 billed. For the same brand's Google ads next to these, see competitor ad intelligence.
Prompts that work well
- "Use scrapely to get the last 20 posts from these three brand pages and rank the formats by shares per post."
- "Pull this page's posts from the last 30 days and tell me which day of the week gets the most reactions."
- "Get the active US ads for this page from the Ad Library and summarize the offers and calls to action."
- "Search the Ad Library for 'meal kit' in the US, 30 ads, and list which advertisers run the most creatives."
- "Keep every run under $0.10."
The agent turns the last line into callOptions.maxTotalChargeUsd.
What your agent can and can't get from Facebook
- Public pages, not personal profiles. Pages and public posts work. A personal profile that isn't public, or a page that answers with a login wall, returns no posts; the Posts Scraper fails that page instead of writing an error row, and keeps what other pages returned.
- Top comments, not full threads. Post rows carry the comments Facebook sends with the post. For a full comment list, the agent calls the Comments Scraper with the post URLs.
- No spend for commercial ads. Meta doesn't publish exact spend or reach for ordinary commercial ads, so those fields stay empty; ads about social issues, elections or politics carry ranges.
- Template text in catalog ads. Dynamic and catalog ads store copy such as
{{product.name}}, which is what Meta keeps in the library. - Large ad pulls take minutes. The first 30 ads of a search arrive in seconds; after that the library sends about 10 at a time, roughly 1,000 ads in seven minutes, per the README. Start long jobs with
waitSecs: 0and poll. - Nothing invented. A field Facebook didn't send stays off the row, and a real
0stays0.
Spending control for agents
- A dollar cap per run.
maxTotalChargeUsdcaps everything a run can cost; the Posts Scraper stops cleanly at the cap and keeps what it saved. - Scoped API keys with daily charge limits. Give an unattended agent its own key under Settings → API keys, with only
actors:runandruns:read. - A prepaid balance. No invoice surprises.
Is it legal to scrape Facebook with an AI agent?
The Actors read pages and an Ad Library that any logged-out visitor can open; your agent never signs in. Meta's Terms of Service (effective January 1, 2025) say "You may not access or collect data from our Products using automated means (without our prior permission)", "regardless of whether such automated access or collection is undertaken while logged-in to a Facebook account." In Meta Platforms v. Bright Data (N.D. Cal., January 2024), the court granted Bright Data summary judgment on Meta's contract claims over logged-off scraping of publicly available data; that ruling covers those terms and facts, not every use. Commenters and people tagged in posts are personal data under the GDPR and CCPA, so collect only what you need. This isn't legal advice.
For a REST endpoint instead of a chat, the Facebook API page has Python, JavaScript and cURL examples, and our guide to scraping the Facebook Ads Library goes deeper on ad research. For other platforms, see social media scraping, Instagram MCP and the best MCP servers for web scraping.
FAQ
Is there an official Facebook MCP server?
Meta runs the Meta Ads MCP server at mcp.facebook.com/ads for managing your own ad accounts, plus MCP servers for Meta developer apps and WhatsApp Business. All three work on accounts, apps or integrations you sign in to. For public posts, page details and Ad Library ads from any page, use the Scrape.ly MCP server.
What is the Facebook MCP server URL for Scrape.ly?
https://mcp.scrape.ly, for Claude, ChatGPT, Cursor and every other client. Add ?actors=echofield/facebook-posts-scraper,echofield/facebook-ads-scraper to expose only those two tools.
Can Claude read Facebook posts?
Yes, through the Scrape.ly MCP server. Ask about a public page and Claude runs the Facebook Posts Scraper, then works with the text, reactions by type, comments, shares and video views it gets back.
Can my agent see a competitor's Facebook ads?
Yes. The Ad Library Scraper reads Meta's public Ad Library by page URL, page name or a search link, and returns each ad's copy, call to action, landing URL, dates and platforms. Spend and reach stay empty for ordinary commercial ads because Meta doesn't publish them.
Do I need a Facebook access token or the Graph API?
No. The Actors read public pages, so there's no Meta developer app, App Review or Page token. You only need a Scrape.ly account.
How much does a Facebook MCP setup cost?
Connecting the server is free. Posts cost $2.37 per 1,000 and Ad Library ads $0.41 per 1,000, platform usage included. Our two runs, five posts and ten ads, cost $0.01591 together at list price.




