MCPInstall
MCP-Facebook logo

MCP-Facebook

by Tisik79 13 stars Tisik79/MCP-Facebook

MCP server for entering and evaluating advertising campaigns on Facebook using Claude AI.

READMEmain

Facebook Ads MCP Server

🇨🇿 Česká verze

MCP server for managing Facebook ads straight from Claude AI. No manual token hunting — sign in with Facebook once and you're done.

Features

  • Campaign management (create, update, delete)
  • Ad sets and individual ads
  • Analytics and insights
  • Custom and lookalike audiences
  • Page posts
  • Automatic token management (page tokens are permanent)

Installation

Requirements

  • Node.js 18+
  • Claude Desktop

1. Clone the repository

git clone https://github.com/Tisik79/MCP-Facebook.git
cd MCP-Facebook
npm install
npm run build

2. Add to Claude Desktop

Open the Claude Desktop config file:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add:

{
  "mcpServers": {
    "facebook-ads": {
      "command": "node",
      "args": ["/PATH/TO/MCP-Facebook/dist/index.js"]
    }
  }
}

3. First run — 5-minute setup

On first start, a wizard walks you through creating your own Facebook App:

Steps:
  1. Click "Create App"
  2. Choose type: "Business"
  3. Enter any name (e.g. "My Ads")
  4. After creation, go to Settings → Basic
  5. Copy the App ID and App Secret
  6. Add the "Facebook Login" product and set:
     Valid OAuth Redirect URIs: http://localhost:3456/auth/callback
  7. In Basic settings, add "localhost" to App Domains

After entering the App ID and Secret, a browser opens automatically → sign in with Facebook → done.

Re-login / adding pages

node dist/index.js login

Usage in Claude

"Show my active campaigns"
"Create a campaign for MyBrand with a $20 daily budget"
"How did my ads perform last month?"
"Post an update to page XY"

Available Tools

ToolDescription
connect_facebook_account / set_facebook_tokenSign in via OAuth / store a token from Graph API Explorer
list_connected_accounts / set_active_accountShow connected pages & accounts / switch the active one
facebook_setup_helpStep-by-step connection guide
get_campaignsList campaigns
create_campaignCreate a new campaign
update_campaignUpdate a campaign (incl. bidStrategy) — read-after-write
get_campaign_detailsCampaign detail (budget, bid_strategy, spend today)
delete_campaignDelete a campaign
get_campaign_insightsCampaign analytics
get_adset_insights / get_ad_insightsAd set / ad level analytics
get_adsetsList ad sets
create_ad_setCreate an ad set (incl. lead fields promotedObject / destinationType)
update_adsetUpdate an ad set (name / status) — real write + read-after-write verification
get_adsList ads (filtered via adSetId/campaignId edge + status)
get_adAd detail incl. creative (link, CTA, copy, video/image)
upload_ad_mediaUpload an image (image_hash) or video (video_id)
create_adcreativeCreate a creative from object_story_spec
create_adCreate an ad (defaults to PAUSED)
update_adUpdate an ad (name/status/creative) — read-after-write
delete_adDelete an ad
create_lead_formCreate an instant lead form on a page
get_lead_formsList lead forms (id, name, status, leads_count)
get_pixelsAccount pixels (id, name) for promoted_object
create_pixel / update_pixel / get_pixelPixel management (detail incl. last_fired_time)
get_pixel_statsPixel event statistics (verify events are flowing)
search_interests / get_interest_suggestionsInterest search & suggestions for targeting
search_behaviorsBehavior categories for targeting
search_geo_locationsGeo keys (region/city/zip) for targeting.geo_locations
estimate_audience_sizeAudience size estimate for a given targeting spec
send_conversion_event / send_conversion_events_batchConversions API — server-side events (auto SHA-256 PII hashing)
get_custom_conversions / get_custom_conversionList / detail of custom conversions
create_custom_conversion / update_custom_conversion / delete_custom_conversionCustom conversions (custom_conversion_id for lead campaigns)
get_offline_conversion_sets / create_offline_conversion_set / upload_offline_conversionsOffline conversions from your CRM
update_adcreativeUpdate a creative (name/status — content is immutable)
get_audiencesCustom audiences
create_custom_audienceCreate an audience
create_lookalike_audienceLookalike audience
create_postPage post
create_video_postVideo page post (resumable upload, unpublished by default)

The scope of the targeting/conversion tool set was inspired by Draivix/aidvertaiser (David Strejc, MIT) — thanks!

Lead Campaigns (OUTCOME_LEADS)

Lead collection has two paths; both require promotedObject + destinationType on the ad set:

  • Website conversions — optimizationGoal=OFFSITE_CONVERSIONS, destinationType=WEBSITE, promotedObject={ pixel_id, custom_event_type: "LEAD" } (find your Pixel ID via get_pixels).
  • Instant form — optimizationGoal=LEAD_GENERATION, destinationType=ON_AD, promotedObject={ page_id }, creative with call_to_action.value.lead_gen_form_id (create the form via create_lead_form).

Without promotedObject + destinationType, Meta returns "Invalid parameter". For accounts with campaign-level budget (CBO), do not set a budget on the ad set — it inherits from the campaign. If the campaign uses a cap bid strategy (LOWEST_COST_WITH_BID_CAP), the ad set requires bidAmount; otherwise set the campaign to bidStrategy=LOWEST_COST_WITHOUT_CAP.

License

MIT

More Marketing Automation MCP servers

Similar servers from the same category.

Integrates with Audiense's audience insights platform, enabling retrieval of audience data and analytics for targeted marketing and social media strategy development.

analysiscontent+1

Enables AI-driven browser profile management through AdsPower's local API, providing tools for creating, updating, opening, and deleting browsers with customizable fingerprints and proxy configurations.

filesystembrowser

mcp-mortgage-server

confersolutions

Canonical MCP server for parsing Loan Estimate (LE) and Closing Disclosure (CD) PDFs into MISMO-compliant JSON with LLM-enriched context. Built for AI-driven mortgage automation, compliance, and decisioning.

PDFAutomation+2

amazon-ads-mcp-server

MarketplaceAdPros

STDIO MCP Server to interact with Amazon Ads

Marketing Automation