flin-meta-ads-mcp
Read-only MCP server for Meta Ads that lists and reads ad accounts, campaigns, ad sets, ads, ad images, creatives, and fetches insights at various levels.
README
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_urllinks) - 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.9
git push origin v0.1.9
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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。