Skip to main content

flin-meta-ads-mcp

flin-meta-ads-mcp is a public, strict read-only MCP server for Meta Ads. It is designed to be installed with uvx and loaded into Claude with minimal setup.

What it does

  • Lists and reads Meta Ads accounts
  • Reads campaigns, ad sets, ads, ad images, and creatives
  • Gets ad previews (including preview_url links)
  • Fetches insights for account, campaign, ad set, and ad levels
  • Stays read-only in v0.1.x

Scope for v0.1.x

This release is strictly read-only.

That means:

  • No create, update, pause, resume, or delete actions
  • No OAuth flow or token refresh
  • No generic Graph API proxy

Install

Install and run the latest published PyPI release:

uvx flin-meta-ads-mcp

Install and refresh to the newest published release:

uvx --refresh flin-meta-ads-mcp

Run the latest GitHub code (main branch):

uvx --refresh --from git+https://github.com/flin-agency/flin-meta-ads-mcp.git flin-meta-ads-mcp

Claude config

Stable (latest published PyPI release, refreshed):

{
  "mcpServers": {
    "flin-meta-ads-mcp": {
      "command": "uvx",
      "args": ["--refresh", "flin-meta-ads-mcp"],
      "env": {
        "META_ACCESS_TOKEN": "EAA...",
        "META_GRAPH_API_VERSION": "v21.0"
      }
    }
  }
}

Latest GitHub code (main branch, refreshed):

{
  "mcpServers": {
    "flin-meta-ads-mcp": {
      "command": "uvx",
      "args": [
        "--refresh",
        "--from",
        "git+https://github.com/flin-agency/flin-meta-ads-mcp.git",
        "flin-meta-ads-mcp"
      ],
      "env": {
        "META_ACCESS_TOKEN": "EAA...",
        "META_GRAPH_API_VERSION": "v21.0"
      }
    }
  }
}

Environment variables

Required:

  • META_ACCESS_TOKEN: Meta access token with read permissions

Optional:

  • META_GRAPH_API_VERSION: Graph API version, default v21.0
  • META_TIMEOUT_SECONDS: request timeout, default 30
  • META_MAX_RETRIES: retry count for transient failures, default 3
  • META_DEFAULT_AD_ACCOUNT_ID: optional fallback ad account (e.g. act_123...) used when a tool call omits ad_account_id
  • RUN_LIVE_META_TESTS: set to 1 to enable live integration tests

Ad account selection:

  • If the token has exactly one accessible ad account, the server resolves it automatically.
  • If META_DEFAULT_AD_ACCOUNT_ID is set, the server uses it when ad_account_id is omitted.
  • If the token has multiple accessible ad accounts, pass ad_account_id in the tool call.

2-minute smoke test

Use these first three tool calls to confirm the server is working:

  1. list_ad_accounts
  2. list_campaigns
  3. get_insights with level=campaign and date_preset=last_7d

Example flow in Claude:

Call list_ad_accounts
Call list_campaigns
Call get_insights with level=campaign and date_preset=last_7d

If the first call works but later calls fail, the issue is usually permissions or ad account scope.

If list_campaigns returns a selection request, call it again with one of the suggested ad_account_id values.

Troubleshooting

Problem Likely cause Fix
Token missing META_ACCESS_TOKEN is not set Add the env var and restart Claude
Token invalid Expired or wrong token Generate a valid Meta read token
Permission denied Missing ads_read or account access Grant the token access to the ad account
Ambiguous ad account Token can access multiple ad accounts Pass ad_account_id per tool call
Rate limit errors Meta API throttling Retry later or reduce the number of insight calls

Development

Local development quickstart:

python -m pip install -e ".[dev]"
pytest -q
ruff check .
mypy src

If you want to run live Meta API tests:

RUN_LIVE_META_TESTS=1 pytest -q

Release

Create and push a release tag:

git tag v0.1.10
git push origin v0.1.10

After release, users can run:

uvx flin-meta-ads-mcp

Notes

  • Use only ad accounts you are allowed to access
  • This server is intended for analysis and reporting, not mutation
  • Public users should treat META_ACCESS_TOKEN as a secret and supply it through environment variables only

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flin_meta_ads_mcp-0.1.10.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flin_meta_ads_mcp-0.1.10-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file flin_meta_ads_mcp-0.1.10.tar.gz.

File metadata

  • Download URL: flin_meta_ads_mcp-0.1.10.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for flin_meta_ads_mcp-0.1.10.tar.gz
Algorithm Hash digest
SHA256 479b00e02712e42eb2b93c6dc34550c4e678435b74bb55771d2e4c014af8aee7
MD5 ada28ce04c428ca9ddbfa82a468677fa
BLAKE2b-256 59971d287c1094f7cee386a2783f8aab6446b6a6217e57998ddd3d6ead4412bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for flin_meta_ads_mcp-0.1.10.tar.gz:

Publisher: release.yml on flin-agency/flin-meta-ads-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flin_meta_ads_mcp-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for flin_meta_ads_mcp-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 677ef32a2d16083c99bd992e6628cee524d53a334badedefbc6a14f539c88c0d
MD5 2fba212ecd7f148aa2be9e1a5aef86d7
BLAKE2b-256 dd5b50e4c20c9449881ea3b5fe6ffcf136c8221abdc71dcce57c890e51e3434a

See more details on using hashes here.

Provenance

The following attestation bundles were made for flin_meta_ads_mcp-0.1.10-py3-none-any.whl:

Publisher: release.yml on flin-agency/flin-meta-ads-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page