Strict read-only MCP server for Meta Ads
Project description
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
- 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, defaultv21.0META_TIMEOUT_SECONDS: request timeout, default30META_MAX_RETRIES: retry count for transient failures, default3META_DEFAULT_AD_ACCOUNT_ID: optional fallback ad account (e.g.act_123...) used when a tool call omitsad_account_idRUN_LIVE_META_TESTS: set to1to 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_IDis set, the server uses it whenad_account_idis omitted. - If the token has multiple accessible ad accounts, pass
ad_account_idin the tool call.
2-minute smoke test
Use these first three tool calls to confirm the server is working:
list_ad_accountslist_campaignsget_insightswithlevel=campaignanddate_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.7
git push origin v0.1.7
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_TOKENas a secret and supply it through environment variables only
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flin_meta_ads_mcp-0.1.7.tar.gz.
File metadata
- Download URL: flin_meta_ads_mcp-0.1.7.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4705e808d1b7c49689231865dbf94df2eba4d5d3e58f46d2f558391206ee276
|
|
| MD5 |
5391130595e1b015d710a5078d3b5873
|
|
| BLAKE2b-256 |
12f3e4bcf1d38f18293e8a0bd8322ab0daedd3650a1f347de95a3ac9ba816086
|
Provenance
The following attestation bundles were made for flin_meta_ads_mcp-0.1.7.tar.gz:
Publisher:
release.yml on flin-agency/flin-meta-ads-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flin_meta_ads_mcp-0.1.7.tar.gz -
Subject digest:
b4705e808d1b7c49689231865dbf94df2eba4d5d3e58f46d2f558391206ee276 - Sigstore transparency entry: 1270790690
- Sigstore integration time:
-
Permalink:
flin-agency/flin-meta-ads-mcp@f22ae3bf37927e7e076b67a0f1d9a73020d49743 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/flin-agency
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f22ae3bf37927e7e076b67a0f1d9a73020d49743 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flin_meta_ads_mcp-0.1.7-py3-none-any.whl.
File metadata
- Download URL: flin_meta_ads_mcp-0.1.7-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60e14ae5262c32b7363940f58ce4da855f9595de083f5ddfbeba6c95ff92c55e
|
|
| MD5 |
1012c04b543ea9df8030146ec7905d4c
|
|
| BLAKE2b-256 |
bf95f6b42064b44a64bfe88cbe1bcff052cebcbddac120842ed68b2d9f4e5c0a
|
Provenance
The following attestation bundles were made for flin_meta_ads_mcp-0.1.7-py3-none-any.whl:
Publisher:
release.yml on flin-agency/flin-meta-ads-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flin_meta_ads_mcp-0.1.7-py3-none-any.whl -
Subject digest:
60e14ae5262c32b7363940f58ce4da855f9595de083f5ddfbeba6c95ff92c55e - Sigstore transparency entry: 1270790692
- Sigstore integration time:
-
Permalink:
flin-agency/flin-meta-ads-mcp@f22ae3bf37927e7e076b67a0f1d9a73020d49743 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/flin-agency
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f22ae3bf37927e7e076b67a0f1d9a73020d49743 -
Trigger Event:
push
-
Statement type: