Sponsored by Deepsite.site

Meta Ads Insights Macp

Created By
ncklrs5 months ago
A Model Context Protocol (MCP) server for accessing Meta (Facebook) Ads insights data with built-in support for joining with HubSpot deal data. Features Fetch ad insights with flexible filtering and breakdowns Campaign and ad set management Mobile placement tracking for revenue attribution Prepare ads data for joining with HubSpot deals Configurable access tokens via MCP configuration
Content

Meta Ads Insights MCP Server

A Model Context Protocol (MCP) server for accessing Meta (Facebook) Ads insights data with built-in support for joining with HubSpot deal data.

Features

  • Fetch ad insights with flexible filtering and breakdowns
  • Campaign and ad set management
  • Mobile placement tracking for revenue attribution
  • Prepare ads data for joining with HubSpot deals
  • Configurable access tokens via MCP configuration

Setup

  1. Install dependencies:
npm install
  1. Build the server:
npm run build
  1. Configure Claude Desktop: Add the server configuration to your Claude Desktop config file:

Location:

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

Configuration:

{
  "mcpServers": {
    "meta-ads-insights": {
      "command": "node",
      "args": ["/absolute/path/to/your/project/dist/index.js"],
      "env": {
        "META_ACCESS_TOKEN": "your_meta_access_token_here",
        "META_AD_ACCOUNT_ID": "your_ad_account_id_without_act_prefix",
        "META_API_VERSION": "v19.0"
      }
    }
  }
}
  1. Get your Meta Access Token:

    • Go to Meta for Developers
    • Create an app or use existing app
    • Generate a User Access Token with ads_read permission
    • For production, use a System User Access Token
  2. Find your Ad Account ID:

    • Go to Meta Ads Manager
    • The account ID is in the URL: act_1234567890 (use just 1234567890)

Available Tools

get_ad_insights

Fetch ad performance data with breakdowns and filtering.

Example usage:

Get mobile ad performance for the last 30 days with placement breakdown

get_campaigns

List campaigns with filtering options.

get_adsets

List ad sets, optionally filtered by campaign.

prepare_hubspot_join

Prepare ads data for joining with HubSpot deals data using various strategies:

  • date_range: Match deals created within attribution window
  • utm_params: Match deals with UTM parameters
  • conversion_tracking: Match deals with Facebook click IDs

Example workflow:

  1. Get mobile placement ads data
  2. Prepare for HubSpot join with date range strategy
  3. Use the prepared data to query HubSpot for deals created within the attribution window
  4. Analyze mobile ads → revenue correlation

Example Use Cases

Mobile Ads Revenue Attribution

1. Get ads insights with device_platform and placement breakdowns
2. Filter for mobile placements
3. Prepare data for HubSpot join with 7-day attribution window
4. Query HubSpot deals created in that timeframe
5. Calculate ROI from mobile ad spend to deal revenue

Campaign Performance Analysis

1. Get campaign insights for last 30 days
2. Break down by placement and device
3. Join with HubSpot deal data
4. Identify highest-converting campaign + placement combinations

Data Joining Strategy

The server provides a prepare_hubspot_join tool that:

  • Adds join keys based on strategy (UTM params, date ranges, click IDs)
  • Calculates attribution windows
  • Flags mobile placements for filtering
  • Provides HubSpot query suggestions

This allows you to connect ad performance data with actual revenue outcomes tracked in HubSpot.

Development

# Development mode with auto-rebuild
npm run dev

# Build only
npm run build

# Run built server
npm start

Troubleshooting

  • Ensure your Meta access token has ads_read permission
  • Verify the ad account ID is correct (without "act_" prefix)
  • Check that the absolute path in claude_desktop_config.json is correct
  • Restart Claude Desktop after configuration changes# meta-insights-mcp

Server Config

{
  "mcpServers": {
    "meta-ads-insights": {
      "command": "node",
      "args": [
        "/absolute/path/to/your/project/dist/index.js"
      ],
      "env": {
        "META_ACCESS_TOKEN": "your_meta_access_token_here",
        "META_AD_ACCOUNT_ID": "your_ad_account_id_without_act_prefix",
        "META_API_VERSION": "v19.0"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
Playwright McpPlaywright MCP server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop
Tavily Mcp