home / mcp / facebook ads mcp server
Provides an interface to Meta Ads, enabling programmatic access to data, campaigns, and insights via an MCP client.
Configuration
View docs{
"mcpServers": {
"gomarble-ai-facebook-ads-mcp-server": {
"command": "python",
"args": [
"/path/to/your/fb-ads-mcp-server/server.py",
"--fb-token",
"YOUR_META_ACCESS_TOKEN"
]
}
}
}You can access and manage Meta Ads data programmatically through an MCP server that acts as an interface to Meta Ads. This server installs locally, handles environment setup, and guides you to connect securely for token-based authentication, enabling you to fetch data and perform common Meta Ads actions from MCP-compatible clients.
You will run the MCP server locally and connect it to an MCP client to access Meta Ads data and actions. Start the server with your Meta access token and configure your MCP client to communicate with the local process. Use the client’s MCP configuration to reference the server by a logical name, then run your client as you would for other MCP servers.
Prerequisites are Python 3.10 or newer and dependencies listed in the project’s requirements file.
Optionally, create and activate a virtual environment to isolate dependencies.
Install dependencies from the requirements file.
Obtain a Meta User Access Token with the required permissions (for example, ads_read) from the Meta Developer portal.
The server can be run with a token provided on startup, or it can connect to GoMarble’s service to obtain a token, which is stored locally on your machine for use with the MCP server.
To integrate with an MCP-compatible client, you add a configuration that points at the server and supplies the token. If you are using a virtual environment, you may specify the python executable inside the venv.
If your Meta access token expires, generate a new one and update the client configuration to continue using the tools.
The server exposes a set of tools to interact with Meta Ads objects, including reading accounts, campaigns, ads, creatives, and performing insights queries.
{
"mcpServers": {
"fb-ads-mcp-server": {
"command": "python",
"args": [
"/path/to/your/fb-ads-mcp-server/server.py",
"--fb-token",
"YOUR_META_ACCESS_TOKEN"
]
// If using a virtual environment, you might need to specify the python executable within the venv:
// "command": "/path/to/your/fb-ads-mcp-server/venv/bin/python",
// "args": [
// "/path/to/your/fb-ads-mcp-server/server.py",
// "--fb-token",
// "YOUR_META_ACCESS_TOKEN"
// ]
}
}
}Lists ad accounts linked to the provided token.
Retrieves detailed information for a specific ad account.
Fetches details for a single campaign by its ID.
Fetches details for a single ad set by its ID.
Fetches details for a single ad by its ID.
Fetches details for a specific ad creative.
Retrieves multiple ad sets by their IDs.
Retrieves campaigns within a given ad account.
Retrieves ad sets within a given ad account.
Retrieves ads within a given ad account.
Retrieves ad sets within a campaign.
Retrieves ads within a campaign.
Retrieves ads within an ad set.
Retrieves creatives associated with a specific ad.
Retrieves performance insights for an ad account.
Retrieves performance insights for a campaign.
Retrieves performance insights for an ad set.
Retrieves performance insights for an ad.
Fetches data from a pagination URL (such as insights pagination).
Retrieves change history for an ad account.
Retrieves change history for an ad set.