Meta Ads Codex MCP
Provides tools for reading Meta Ads performance data, allowing listing ad accounts, checking active ads, reading ad performance, and summarizing account-level spend.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Meta Ads Codex MCPWhich active ads have the highest CPC over the last 7 days?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Meta Ads Codex MCP
A local MCP server that lets Codex answer conversational questions about Meta Ads performance.
Example prompts in Codex:
Use Meta Ads to show how my live ad is performing.
How much have I spent in total?
Which active ads have the highest CPC over the last 7 days?
Summarize my account performance for the last 30 days.This project runs locally. It does not send your Meta Ads token anywhere except Meta's official MCP endpoint at https://mcp.facebook.com/ads.
Codex provides the AI conversation. This package provides the local MCP tools that let Codex safely read Meta Ads data.
Current Status
This first release is read-only. It exposes safe tools for:
listing ad accounts
checking active ads
reading ad performance
reading account-level spend
summarizing account performance
Write actions such as pausing ads, changing budgets, or creating campaigns are intentionally not included yet.
Related MCP server: OpenAI Ads MCP Server
Requirements
Node.js 18+
Codex CLI
A Meta MCP-compatible access token
Meta's official hosted MCP OAuth currently does not support every MCP client. This server supports token-based access by reading a token from an environment variable or local config file.
Quick Start
Install from this repo:
npm install -g .Store a token:
meta-ads-codex-mcp token setOptionally set your default ad account:
meta-ads-codex-mcp account set 2051892919047874Install the MCP server into Codex:
meta-ads-codex-mcp install-codexRestart Codex, then ask:
Use Meta Ads to show how my live ad is performing.Token Sources
The server looks for a token in this order:
META_ADS_MCP_ACCESS_TOKEN~/.meta-ads-codex-mcp.json~/.meta_ads_mcp_token.jsonfrom the local prototype helper
The config file is written with 0600 permissions.
CLI
meta-ads-codex-mcp check
meta-ads-codex-mcp accounts
meta-ads-codex-mcp active-ads --date-preset last_7d
meta-ads-codex-mcp spend --date-preset maximum
meta-ads-codex-mcp performance --ad-id 120247766096870426 --date-preset last_7d
meta-ads-codex-mcp serverCodex Config
install-codex runs:
codex mcp add meta_ads_codex -- meta-ads-codex-mcp serverYou can remove it with:
codex mcp remove meta_ads_codexSecurity
Treat Meta access tokens like passwords.
Do not commit
.env, local config, or token files.This package does not log token values.
Use read-only tokens when possible.
Development
Run the server locally:
node src/cli.js serverRun a direct check:
node src/cli.js checkMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityCmaintenanceA local Model Context Protocol server that enables interaction with the Meta Marketing API to manage ad accounts, campaigns, and creatives. It provides tools for targeting research, insight reporting, and campaign management through local MCP clients like Claude Code and Cursor.Last updated4051AGPL 3.0
- Alicense-qualityCmaintenanceAn MCP server that exposes the ChatGPT Ads API as tools an LLM host can call.Last updated4MIT
- Flicense-qualityDmaintenanceMCP server that wraps the Meta Marketing API (Graph API v25.0) as semantic tools for LLM agents.Last updated1
- AlicenseAqualityDmaintenanceMCP server to manage Meta Ads (Facebook/Instagram) campaigns, ad sets, insights, and audiences from Claude Code using natural language.Last updated99MIT
Related MCP Connectors
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mariocodesforfun/meta_ads_codex_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server