# @thenavidm/facebook-ad-library-mcp-cli [Health: Active]

**Category:** 🎯 Marketing  
**Repository:** https://github.com/thenavidm/facebook-ad-library-mcp-cli  
**GitHub Stars:** 15  
**npm Downloads (last month):** 945  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/thenavidm-facebook-ad-library-mcp-cli

## Description
Facebook Ad Library MCP server and CLI for Claude Code, Codex and AI agents. 9 tools that read every ad running on Facebook, Instagram, Messenger, Threads and Audience Network, for any advertiser in any country, free and with no API key.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "facebook-ad-library-mcp-cli": {
    "command": "npx",
    "args": ["-y","@thenavidm/facebook-ad-library-mcp-cli"]
  }
}
```

## Documentation

## What @thenavidm/facebook-ad-library-mcp-cli does

@thenavidm/facebook-ad-library-mcp-cli makes Meta’s public Facebook Ad Library available to AI agents and command-line workflows. It can search ads by keyword or advertiser, identify a brand’s Facebook Page ID, retrieve an individual ad, inspect its images, and transcribe video creative.

The server also supports advertiser activity comparisons, EU-specific transparency data, and links that people can open directly in the Ad Library. Its archive covers advertising shown on Facebook, Instagram, Messenger, Threads, and Audience Network, with searches available for advertisers in any country.

The package provides nine capabilities through two interfaces: an MCP server for AI applications and a CLI for shell users. Both interfaces use the same tool definitions and names, so an operation available through one surface is available through the other.

## How it works

The MCP entry point is launched by an MCP client, for example with `npx -y @thenavidm/facebook-ad-library-mcp-cli`. The client receives the server’s tool definitions and can call the Ad Library operations during a conversation. The CLI exposes the same operations as commands such as `search-ads`, `list-advertisers`, and `get-ad`.

The implementation is built on Slipway, which generates the MCP server and CLI from a shared definition for each tool. This keeps command behavior and MCP behavior aligned. The data comes from a public advertising archive, so normal searches do not require an account, API key, or confirmation flag.

For shell automation, commands can return JSON with `--json`, reduce output to one line with `--compact`, and select particular fields with `--select`. The `--agent` option produces compact JSON without prompts. `schema <command>` prints the JSON Schema for a CLI command’s corresponding MCP tool.

## Setup and configuration

Install and launch the package through `npx` when configuring an MCP client. A Claude Code configuration can be added with:

```bash
claude mcp add facebook-ad-library -- npx -y @thenavidm/facebook-ad-library-mcp-cli
```

Claude Desktop can install the packaged `.mcpb` extension from the project’s latest GitHub release. The MCP process is normally started by the client rather than run manually.

For terminal or automation use, install the package so that `facebook-ad-library-cli` is available, then invoke a command directly:

```bash
facebook-ad-library-cli list-advertisers --query ridge
facebook-ad-library-cli search-ads --page-id 123456789 --country US
```

Use `facebook-ad-library-cli <command> --help` for command-specific arguments. The public archive does not require an API key. The `doctor` command, exposed as the `backend_status` MCP tool, checks whether the setup is working.

## Tools and capabilities

The nine shared tools are:

- `search_ads`: Find ads using a keyword or advertiser, with options such as Page ID and country.
- `list_advertisers`: Locate a brand and obtain its Facebook Page ID.
- `get_ad`: Read an individual ad in detail.
- `view_ad_creative`: Examine an ad’s images or other creative view.
- `transcribe_ad`: Produce a transcription for a video ad.
- `diff_advertiser`: Compare what an advertiser has started or stopped running.
- `get_eu_transparency`: Retrieve EU ad spend, reach, and demographic information.
- `ad_library_url`: Create a link that a person can open in the Ad Library.
- `backend_status`: Check the tool’s setup and backend status; the CLI equivalent is `doctor`.

The CLI uses dashed command names, while MCP uses underscored tool names. For example, `search-ads` is the CLI form of `search_ads`, and `get-eu-transparency` maps to `get_eu_transparency`.

These capabilities fit competitor research, creative monitoring, advertiser activity reviews, and workflows that need to pass structured ad data to scripts or other agent tools.

## Limitations and notes

The MCP server and CLI are alternative access surfaces over the same nine tools. An MCP client is needed for the server interface; a terminal, script, cron job, or CI environment uses the CLI instead. Applications that load MCP tool definitions on every message may incur model input-token usage, while the CLI avoids loading the server’s tools until a command is run.

The CLI returns documented exit codes for successful execution, usage errors, missing results, rejected keys, upstream failures, exhausted credits, and an unavailable backend. Scripts can use those codes to branch instead of parsing human-readable output.

_Full upstream README: https://allmcps.com/mcp/thenavidm-facebook-ad-library-mcp-cli/readme_

