RF

ramsesaguirre777/facebook-ads-library-mcp

Analytics & monitoring

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

308 stars 48 forks 品質 79 トレンド 10MIT

ramsesaguirre77/facebook-ads-library-mcp は、https://github.com/ramsesaguirre777/facebook-ads-library-mcp. からインポートされたMCPサーバー候補です。

概要

ramsesaguirre77/facebook-ads-library-mcp は、https://github.com/ramsesaguirre777/facebook-ads-library-mcp. からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

競合広告のために公開Facebook広告ライブラリをスクレーピングする小さなMCPサーバー 調査 — FacebookアカウントもAPIトークンも持たないMCPクライアントから。

これは有料のAd Libraryスクレイパー(Apifyの俳優、ScrapeCreators、そして友人たち)が存在しているからです。 ブラウザ上で公開されているものに対して料金を請求します。これはヘッドレスを駆動します ブラウザで動かすのです。

なぜ公式APIじゃないの?

Metaのads_archiveAPIは、世界中の(すべての広告)で政治的および問題の広告のみを返します このタイプはEU/英国のみのものでした。世界のほとんどの地域では、一般的な商業広告主には 役に立つものは何も返ってこない — 広告も支出もインプレッションもない。だからこのサーバーは使っていない 全く。自分で開くのと同じAdライブラリのウェブページを表示し、カードを解析します。

何が手に入るか

2つのツール:

  • search_ad_library(query, country="MX", ...) — キーワード検索。
  • scrape_ad_library_url(url, ...) — すでに持っている広告ライブラリのURLをスクレイピングしてください。

どちらも広告ごとに構造化されたレコードを返します:

フィールド 意味
advertiser、advertiser_handle ページ名とそのfacebook.com/
started_running 初登場デート

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Facebook Ad Library MCP

A small MCP server that scrapes the public Facebook Ad Library for competitive ad research — from your MCP client, with no Facebook account and no API token.

It exists because the paid Ad Library scrapers (Apify actors, ScrapeCreators, and friends) charge for something that is publicly visible in a browser. This just drives a headless browser instead.

Why not the official API?

Meta’s ads_archive API only returns political & issue ads worldwide (and all ad types only for the EU/UK). For an ordinary commercial advertiser in most of the world it returns nothing useful — no ads, no spend, no impressions. So this server doesn’t use it at all. It renders the same Ad Library web page you’d open yourself and parses the cards.

What you get

Two tools:

  • search_ad_library(query, country="MX", ...) — keyword search.
  • scrape_ad_library_url(url, ...) — scrape any Ad Library URL you already have.

Both return structured records per ad:

field meaning
advertiser, advertiser_handle Page name and its facebook.com/
started_running first-seen date
ads_using_creative how many creatives share this copy — a rough scale signal
landing_url, landing_domain destination, unwrapped from the l.facebook.com redirect
cta the button label (Learn more, Sign up, Send message, …)
link_text the headline strip under the creative
body full ad copy
creative_image thumbnail URL
ad_details_url deep link to that ad’s detail view

Plus an advertisers histogram and the raw_markdown of the page so the model can pull anything the parser missed.

Install

git clone https://github.com/RamsesAguirre777/facebook-ads-library-mcp.git
cd facebook-ads-library-mcp
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python -m playwright install chromium   # crawl4ai needs a browser

Register with your MCP client

Claude Code:

claude mcp add facebook-ads -- /abs/path/venv/bin/python /abs/path/facebook_ads_mcp_complete.py

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "facebook-ads": {
      "command": "/abs/path/venv/bin/python",
      "args": ["/abs/path/facebook_ads_mcp_complete.py"]
    }
  }
}

Restart the client.

Usage

"Search the Mexico Ad Library for 'automatización con inteligencia artificial',
 group by advertiser, and list the landing domains."

"Scrape https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=MX&q=nike&search_type=keyword_unordered
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "facebook-ads": { "command": "/abs/path/venv/bin/python", "args": ["/abs/path/facebook_ads_mcp_complete.py"] } } }