Meta Ads MCP Server

Meta Ads MCP Server

Enables Claude to fetch and analyze Meta ad accounts, campaigns, ad sets, ads, and performance insights via the Meta Marketing API.

Category
访问服务器

README

Meta Ads MCP Server

A remote MCP server that wraps the Meta Marketing API so Claude can pull data from all of your Meta ad accounts: accounts, campaigns, ad sets, ads, and performance insights (spend, impressions, clicks, CTR/CPC/CPM, reach, conversions, with optional breakdowns and date ranges).

Tools exposed

  • list_ad_accounts — every ad account reachable with your token
  • get_campaigns(account_id, status?, limit?)
  • get_adsets(account_id, campaign_id?, limit?)
  • get_ads(account_id, adset_id?, campaign_id?, limit?)
  • get_insights(account_id, level?, date_preset? | since+until, breakdowns?, fields?, limit?)

1. Get a Meta access token with access to all your ad accounts

  1. Go to developers.facebook.com and create an app (type: Business).
  2. Add the Marketing API product to the app.
  3. In Meta Business Settings → Users → System Users, create a system user (role: Admin, or Employee with the right permission).
  4. Under Assign Assets, assign every ad account you want Claude to see to that system user.
  5. Generate a token for the system user with the ads_read permission (add ads_management too if you later want write access, e.g. pausing campaigns). Choose a token with no expiry, or a long-lived one, and set a calendar reminder to rotate it if it does expire.

This gives you one token that covers every ad account, rather than one login per account.

2. Deploy to Vercel

cd meta-ads-mcp
npm install
vercel deploy --prod

Then in the Vercel project settings, add two environment variables (Project Settings → Environment Variables), and redeploy so they take effect:

Variable Value
META_ACCESS_TOKEN the system user token from step 1
MCP_SECRET_TOKEN a random string you generate, e.g. openssl rand -hex 24

3. Add it to Claude as a custom connector

In Claude, go to Customize → Connectors → Add custom connector, and enter this URL (no OAuth fields needed):

https://<your-project>.vercel.app/api/mcp?token=<MCP_SECRET_TOKEN>

Using the exact MCP_SECRET_TOKEN value from step 2. This URL is effectively a bearer credential, so treat it as a secret — don't post it or check it into git.

Note: the token is passed as a ?token= query parameter rather than a bracketed dynamic path segment. This is deliberate — folder names with square brackets (e.g. [token]) can get mangled by drag-and-drop uploads or some zip tools, so a query string is more robust if you're not deploying via git push or the Vercel CLI.

Enable the connector for a conversation via the "+" button → Connectors, then ask Claude something like: "List my Meta ad accounts" or "Show me spend and ROAS by campaign for account X over the last 30 days."

Notes / next steps

  • Security model: this uses a shared-secret URL rather than full OAuth, which is the simplest option for a single-user setup. If you ever want to let teammates connect with their own Meta permissions instead of a shared system-user token, that would need a real OAuth layer in front of Meta's Marketing API — a bigger build, happy to do that if it becomes useful.
  • Rate limits: the Marketing API has its own rate limits per app/ad account; if you're pulling insights across many accounts at once you may want to add caching or request the accounts one at a time.
  • Extending: to add write actions (e.g. pause a campaign, adjust a budget), add a new server.registerTool(...) block in lib/server.ts calling the relevant Graph API POST endpoint — same pattern as the read tools here.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选