本工具包可帮助用户便捷地管理元广告多账户,提供丰富的操作工具和灵活的配置选项,提升广告账户管理效率。
运行以下命令开启工具:
uvx meta-ads-mcp --app-id your_app_id
若要查看所有关联的广告账户,请运行:
uvx meta-ads-mcp --app-id your_app_id --get-ad_accounts
使用以下命令通过 pip 安装:
pip install meta-ads-mcp
按以下步骤从源代码安装:
git clone https://github.com/your-repository/meta_ads_mcp.git
cd meta_ads_mcp
python setup.py install
使用 mcp_meta_ads_get_login_link 工具获取新的授权链接:
mcp_meta_ads_get_login_link()
列出所有关联的广告账户:
mcp_meta_ads_get_ad_accounts()
以下是完整的操作工具列表,每个工具都有特定的功能:
mcp_meta_ads_get_login_link()mcp_meta_ads_get_ad_accounts()mcp_meta_ads_get_account_info(account_id="your_account_id")mcp_meta_ads_create_campaign(campaign_name="your_campaign_name", budget_type="daily", daily_budget=100.0, account_id="your_account_id")mcp_meta_ads_delete_campaign(campaign_id="your_campaign_id", account_id="your_account_id")mcp_meta_ads_get_campaigns(account_id="your_account_id")mcp_meta_ads_create_ad_set(ad_set_name="your_ad_set_name", campaign_id="your_campaign_id", budget_type="daily", daily_budget=100.0, account_id="your_account_id")mcp_meta_ads_delete_ad_set(ad_set_id="your_ad_set_id", account_id="your_account_id")mcp_meta_ads_get_ad_sets(campaign_id="your_campaign_id")mcp_meta_ads_create_ad(creative_id="your_creative_id", title="your_title", description="your_description", url="your_url", ad_set_id="your_ad_set_id")mcp_meta_ads_delete_ad(ad_id="your_ad_id", ad_set_id="your_ad_set_id")mcp_meta_ads_get_creatives(account_id="your_account_id")设置 META_APP_ID 环境变量:
export META_APP_ID=your_app_id
uvx meta-ads-mcp
uvx meta-ads-mcp --app-id your_app_id
首次运行时,工具会自动启动浏览器进行授权:
uvx meta-ads-mcp
使用 --force-login 标志强制重新登录:
uvx meta-ads-mcp --force-login
若需下载创意图像,设置如下:
export AD_CREATIVES_DOWNLOAD=1
mcp_meta_ads_get_creatives(account_id="your_account_id")
启用日志记录以排查问题:
uvx meta-ads-mcp --log-file /path/to/logfile.log
所有认证信息均加密存储,且不会被第三方访问。避免在共享环境中使用此工具。
数据通过 HTTPS 安全传输,确保传输过程中的安全性。
--force-login 标志强制重新登录。如需更详细的文档,访问项目官网或查阅相关技术资料。