About Facebook Ads Library
Facebook Ads Library is an MCP server published by trypeggy in the Social category: get any answer from the Facebook Ads Library, conduct deep research including messaging, creative testing and comparisons in seconds. Conduid read 9 tools from its source: analyze_ad_image, analyze_ad_video, cleanup_media_cache, get_cache_stats, get_meta_ads, get_meta_platform_id and 3 more. It is published to npm as @proxy-intell/facebook-ads-library-mcp and starts with npx.
The repository has 332 stars and 45 forks, and its last commit was on 30 Nov 2026. The latest release is v1.1.0 (20 Nov 2026): 331 of you starred this repo, and video analysis had quietly stopped working. The release before it was v1.0.0 (11 Aug 2026). It passes all 1 static checks Conduid ran on the repository. Its topics include analytics, api, facebook, facebook-api, github and marketing.
Install
claude mcp add facebook-ads-library -- npx -y @proxy-intell/facebook-ads-library-mcpnpx -y @proxy-intell/facebook-ads-library-mcpgit clone https://github.com/trypeggy/facebook-ads-library-mcpTools (9)
analyze_ad_imageReturns the ad image to the model for visual analysis| Parameter | Type | Description |
|---|---|---|
| ad_id | string | Optional ad ID, used for the ad library link. |
| brand_name | string | Optional brand name for cache organization. |
| media_url * | string | The image URL from a get_meta_ads or search_meta_ads_by_keyword result. |
analyze_ad_videoAnalyzes an ad video with Gemini (set `GEMINI_MODEL` to change the model)| Parameter | Type | Description |
|---|---|---|
| ad_id | string | Optional ad ID for tracking purposes. |
| brand_name | string | Optional brand name for cache organization. |
| media_url * | string | The direct URL to the Facebook ad video to analyze. |
cleanup_media_cacheCleans up old cached media files to free disk space| Parameter | Type | Description |
|---|---|---|
| max_age_days | integer | Maximum age in days before media files are deleted (default: 30) |
get_cache_statsGets statistics about cached media (images and videos) and storage usageget_meta_adsRetrieves ads for page IDs or brand names, plus what changed since the last fetch| Parameter | Type | Description |
|---|---|---|
| brand_name | string | Alias for platform_ids. |
| brand_names | any | Alias for platform_ids. |
| country | string | Optional country code to filter ads by geographic targeting. Examples: "US", "CA", "GB", "AU". If not provided, returns ads from all countries. |
| limit | integer | Maximum number of ads to retrieve per platform ID (default: 50, max: 500). Higher limits allow comprehensive brand analysis but may take longer to process. |
| platform_ids | any | Single platform ID (str) or list of platform IDs (List[str]) obtained from get_meta_platform_id, or brand names, each resolved to its top-ranked page. Examples: "123456789", ["123456789", "987654321"], ["Nike", "Adidas"] |
| trim | boolean | Whether to trim the response to essential fields only (default: True). Set to False to get full ad metadata including targeting details. |
get_meta_platform_idReturns platform ID given one or many brand names| Parameter | Type | Description |
|---|---|---|
| brand_names * | any | Single brand name (str) or list of brand names (List[str]) to search for. Examples: "Nike", ["Nike", "Coca-Cola", "Apple"] |
get_playbookStep-by-step method for one of eleven research jobs (also served as prompts)| Parameter | Type | Description |
|---|---|---|
| job * | string |
search_cached_mediaSearches previously analyzed media by brand, colors, people, or media type| Parameter | Type | Description |
|---|---|---|
| brand_name | string | Filter by exact brand name match |
| color_contains | string | Filter by dominant color (partial match, e.g., "red", "blue") |
| has_people | boolean | Filter by presence of people in media (True/False) |
| limit | integer | Maximum number of results to return (default: 20) |
| media_type | string | Filter by media type ('image' or 'video') |
search_meta_ads_by_keywordSearches every advertiser's ads by keyword, country, format, date, run time (`min_duration_days`); sorts include `longest_running` and `newest`| Parameter | Type | Description |
|---|---|---|
| country | string | Two-letter country code, e.g. "US". Default: all countries. |
| end_date | string | Only ads shown up to this date, YYYY-MM-DD. |
| limit | integer | Max ads to return (default 30, max 150). Each page of results is one ScrapeCreators credit. |
| media_type | string | "all" (default), "image" (stills and carousels) or "video". |
| min_duration_days | integer | Only ads that have run at least this many days, e.g. 90 for proven ads. Filters the ads fetched (up to 5 pages); sort_by then defaults to "total_impressions". |
| query * | string | Keyword or phrase, e.g. "running shoes". |
| search_type | string | "keyword_unordered" (default) or "keyword_exact_phrase" (better for multi-word product names). |
| sort_by | string | "relevancy_monthly_grouped" (default, on-topic, last month only), "total_impressions" (biggest advertisers first, any age), "longest_running" or "newest" (these two rank only the ads fetched, not the whole library). |
| start_date | string | Only ads shown from this date, YYYY-MM-DD. |
| status | string | "ACTIVE" (default upstream), "INACTIVE" or "ALL". |
| trim | boolean | True (default) returns essential fields only. |
Security checks
- ✓README presentThe repository's README runs to about 1.4K words.
5 checks have not been run yet.
Releases
README
The repository's README runs to about 1.4K words. The original in the repository is authoritative.
Read full README