hafidsousa
MCP Serverhafidsousapublic

meta mcp

用于通过 Meta Client Platform 与 Facebook 营销 API 交互的工具包。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
MIT License
License

About This Server

用于通过 Meta Client Platform 与 Facebook 营销 API 交互的工具包。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Facebook Marketing API Client for Meta Client Platform (MCP)

This package provides tools for interacting with the Facebook Marketing API through the Meta Client Platform.

Important Update

As of version 2.0.0: All request payloads must use snake_case format as they are passed directly to the Facebook Marketing API without transformation. Previous versions used camelCase with automatic conversion.

The server now acts as a direct proxy to the Facebook Marketing API, passing all parameters through without modification and returning Facebook API responses directly.

Installation

npm install meta-mcp

Configuration

Set the following environment variables:

FB_ACCESS_TOKEN=your_facebook_access_token
FB_AD_ACCOUNT_ID=your_ad_account_id
FB_API_VERSION=v22.0
FB_API_DOMAIN=https://graph.facebook.com

Usage Examples

Creating a Campaign

const result = await callTool({
  name: "createCampaign",
  arguments: {
    config: {
      name: "Test Campaign",
      objective: "OUTCOME_AWARENESS",
      status: "PAUSED",
      special_ad_categories: ["NONE"],
      daily_budget: 2000, // $20.00
      bid_strategy: "LOWEST_COST_WITHOUT_CAP"
    }
  }
});

Updating a Campaign

const result = await callTool({
  name: "updateCampaign",
  arguments: {
    campaignId: "23848238482384",
    config: {
      name: "Updated Campaign Name",
      daily_budget: 5000 // $50.00
    }
  }
});

Creating an Ad Set

const result = await callTool({
  name: "createAdSet",
  arguments: {
    config: {
      name: "My First Ad Set",
      campaign_id: "23848238482384",
      daily_budget: 1000, // $10.00
      billing_event: "IMPRESSIONS",
      optimization_goal: "REACH",
      bid_strategy: "LOWEST_COST_WITHOUT_CAP",
      targeting: {
        geo_locations: {
          countries: ["US"]
        },
        age_min: 18,
        age_max: 65,
        genders: [1, 2]
      },
      status: "PAUSED"
    }
  }
});

Creating an Ad

const result = await callTool({
  name: "createAd",
  arguments: {
    config: {
      name: "My First Ad",
      adset_id: "23848238482384",
      status: "PAUSED",
      creative: {
        name: "My First Creative",
        title: "Try our amazing product!",
        body: "This is the best product you'll ever use.",
        link_url: "https://example.com",
        image_url: "https://example.com/image.jpg",
        call_to_action: "LEARN_MORE"
      }
    }
  }
});

Getting Campaigns

const result = await callTool({
  name: "getCampaigns",
  arguments: {
    limit: 10,
    status: "ACTIVE",
    datePreset: "last_30_days"
  }
});

Getting Ad Sets

const result = await callTool({
  name: "getAdSets",
  arguments: {
    campaignId: "23848238482384"
  }
});

Getting Ads

const result = await callTool({
  name: "getAds",
  arguments: {
    adSetId: "23848238482384"
  }
});

Pausing a Campaign

const result = await callTool({
  name: "pauseCampaign",
  arguments: {
    campaignId: "23848238482384"
  }
});

Available Tools

Campaign Management

  • createCampaign: Create a new campaign
  • updateCampaign: Update an existing campaign
  • getCampaign: Get details for a specific campaign
  • getCampaigns: Get a list of campaigns
  • pauseCampaign: Pause an active campaign

Ad Set Management

  • createAdSet: Create a new ad set
  • updateAdSet: Update an existing ad set
  • getAdSet: Get details for a specific ad set
  • getAdSets: Get a list of ad sets for a campaign
  • getAccountAdSets: Get a list of ad sets for the account
  • pauseAdSet: Pause an active ad set

Ad Management

  • createAd: Create a new ad
  • updateAd: Update an existing ad
  • getAd: Get details for a specific ad
  • getAds: Get a list of ads for an ad set
  • getAccountAds: Get a list of ads for the account
  • pauseAd: Pause an active ad

Account Management

  • getAvailableAdAccounts: Get a list of available ad accounts

Facebook API Parameters

Refer to the Facebook Marketing API documentation for details on available parameters and their formats. As the server now acts as a direct proxy, you can use any parameter documented in the Facebook Marketing API directly in your requests.

Error Handling

Errors from the Facebook API are passed directly to the client without modification. Check the error message and details for information about what went wrong.

License

MIT

Quick Start

1

Clone the repository

git clone https://github.com/hafidsousa/meta-mcp
2

Install dependencies

cd meta-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerhafidsousa
Repometa-mcp
LanguageTypeScript
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation