Bing Ads

io.github.mharnett由 GitHub 账号 mharnett 发布v1.0.2更新于 Oct 24, 2026

MCP server for Microsoft Advertising (Bing Ads) — campaigns, keywords, and reports

已验证STDIO仅桌面数据与分析商业与电商

概览

AI 生成的概览

面向 Microsoft Advertising(Bing Ads)的本地 MCP 服务器,让助手列出广告系列、广告组和关键词、获取效果报告,并可选地修改预算或暂停关键词。

可以做什么
列出广告系列和广告组,并通过工作目录上下文调用识别账户。按日期范围读取广告系列效果指标,如 ROI、转化、点击率和单次点击费用。分析关键词效果,包括质量得分、预期点击率、广告相关性和着陆页体验。报告触发广告的搜索词,并列出共享否定关键词列表。启用写入模式后,可暂停关键词、更新广告系列每日预算和添加共享否定关键词。
适用场景
适合付费搜索从业者让助手查看 Bing/Microsoft Ads 的广告系列与关键词表现、诊断质量得分,并在对话中做小幅预算或关键词调整。
运行要求
以 npm 包(mcp-bing-ads)在本地 Node.js 上运行,仅限桌面端。需要注册 Azure AD 应用并授予 Microsoft Advertising API 权限,并设置环境变量 BING_ADS_CLIENT_ID、BING_ADS_DEVELOPER_TOKEN 和 BING_ADS_REFRESH_TOKEN;机密客户端可选 BING_ADS_CLIENT_SECRET。README 还提到需要含客户与账户 ID 的 config.json。
安装前请注意
需要 OAuth 凭据和开发者令牌,README 提醒不要分享或提交含凭据的配置文件。除非将 BING_ADS_MCP_WRITE 设为 true,否则写入工具会被隐藏并拒绝调用;这些工具会改动真实广告账户(暂停关键词、修改预算、添加否定词),可能影响花费。README 建议用完后取消写入模式。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Bing Ads,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Bing Ads MCP Server

[npm version] [npm downloads] [GitHub stars] [License: MIT]

Production-grade MCP server for Microsoft Advertising (Bing Ads) API. Enables Claude to manage Bing/Microsoft Ads accounts with full campaign, ad group, keyword, and performance analysis capabilities.

Features:

  • 10 tools -- production-tested
  • Campaign, ad group, and keyword management
  • Keyword performance analysis with quality scores
  • Search term reporting & bid automation
  • Budget & bid strategy optimization
  • Campaign-level budget updates
  • Negative keyword management (shared + campaign-level)

Note: ⚠️ First open-source Bing Ads MCP with comprehensive tooling

  • No serious alternatives exist in the ecosystem
  • Battle-tested across multiple accounts

Installation

bash
npm install mcp-bing-ads

Configuration

Security: Never share your .mcp.json file or commit it to git -- it may contain API credentials. Add .mcp.json to your .gitignore.

  1. Get OAuth credentials:

    • Go to Microsoft Azure Portal
    • Create an Azure AD app registration
    • Grant API permissions: Microsoft Advertising API
    • Scopes: https://ads.microsoft.com/msads.manage offline_access
  2. Create config.json:

    bash
    cp config.example.json config.json
  3. Fill in your credentials:

    json
    {
      "oauth": {
        "client_id": "YOUR_AZURE_CLIENT_ID",
        "client_secret": "YOUR_AZURE_CLIENT_SECRET"
      },
      "clients": {
        "default": {
          "customer_id": "YOUR_CUSTOMER_ID",
          "account_id": "YOUR_ACCOUNT_ID",
          "name": "My Account"
        }
      }
    }
  4. Set environment variables (recommended):

    bash
    export BING_ADS_DEVELOPER_TOKEN="your_developer_token"
    export BING_ADS_CLIENT_ID="your_client_id"
    export BING_ADS_REFRESH_TOKEN="your_refresh_token"
    # Optional:
    export BING_ADS_CLIENT_SECRET="your_client_secret"
    # Optional: opt into mutating tools (read-only by default)
    export BING_ADS_MCP_WRITE="true"

Environment Variables

VariableRequiredDefaultDescription
BING_ADS_DEVELOPER_TOKENyes--Microsoft Advertising developer token
BING_ADS_CLIENT_IDyes--Azure AD app client ID
BING_ADS_REFRESH_TOKENyes--OAuth refresh token
BING_ADS_CLIENT_SECRETno--Azure AD app client secret (if confidential client)
BING_ADS_MCP_WRITEnofalseSet to true, 1, or yes to expose mutating tools (pause/update/add). Any other value -- or unset -- keeps the server read-only.

Read-only by default

Mutating tools (bing_ads_pause_keywords, bing_ads_update_campaign_budget, bing_ads_add_shared_negatives) are hidden from the tool list and refused at call time unless BING_ADS_MCP_WRITE=true is set in the server environment. This is a safety gate against casual write actions -- for example, pausing a keyword or editing a budget based on a throwaway chat message. To make write changes, set the env var explicitly in your .mcp.json or shell profile for the session that needs it, then unset it afterwards. Read tools (list/report/performance) are always available.

Usage

Start the server

bash
npm start

Use with Claude Code

Add to ~/.claude.json:

json
{
  "mcpServers": {
    "bing-ads": {
      "type": "http",
      "url": "http://localhost:3002"
    }
  }
}

Claude Desktop: Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

Example API Calls

typescript
// Get client context
bing_ads_get_client_context({ working_directory: "/path/to/project" })

// List campaigns
bing_ads_list_campaigns()

// Get campaign performance
bing_ads_get_campaign_performance({
  start_date: "2026-01-01",
  end_date: "2026-03-01"
})

// Get keyword performance
bing_ads_keyword_performance({
  start_date: "2026-02-01",
  end_date: "2026-03-01"
})

// Create negative keywords
bing_ads_add_shared_negatives({
  shared_list_id: "list_123",
  keywords: [
    { text: "cheap", match_type: "Phrase" },
    { text: "discount", match_type: "Exact" }
  ]
})

API Reference

Context

  • bing_ads_get_client_context(working_directory) -- Detect account from working directory

Campaigns

  • bing_ads_list_campaigns() -- List all campaigns
  • bing_ads_get_campaign_performance(start_date, end_date) -- Campaign metrics
  • bing_ads_update_campaign_budget(campaign_id, daily_budget) -- Update daily spend

Ad Groups

  • bing_ads_list_ad_groups(campaign_id) -- List ad groups in campaign

Keywords

  • bing_ads_keyword_performance(start_date, end_date, [campaign_ids]) -- Keyword metrics & QS
  • bing_ads_search_term_report(start_date, end_date) -- Search terms that triggered ads
  • bing_ads_pause_keywords(ad_group_id, keyword_ids) -- Pause keywords

Negative Keywords

  • bing_ads_list_shared_entities([type]) -- List shared negative lists
  • bing_ads_add_shared_negatives(list_id, keywords) -- Add to shared list

Performance Reports

  • Campaign performance (ROI, conversions, CTR, CPC)
  • Keyword performance (QS, expected CTR, ad relevance, landing page experience)
  • Search term insights (which queries are converting)

Key Metrics & Definitions

Quality Score (QS): 1-10 rating of keyword quality

  • 1-3: Poor
  • 4-6: Average
  • 7-10: Excellent

Expected CTR: 1-9 rating of expected click-through rate Ad Relevance: 1-9 rating of relevance to search query Landing Page Experience: 1-9 rating of landing page quality

CLI Tools

bash
npm run dev                 # Run in dev mode (tsx)
npm run build             # Compile TypeScript
npm test                  # Run contract tests

Architecture

Files:

  • src/index.ts — MCP server, OAuth flow, tool handlers
  • src/tools.ts — Tool schema definitions
  • src/errors.ts — Error handling & classification
  • config.json — Credentials & client mapping

Error Classification:

  • Authentication errors (token expired)
  • Rate limit errors (retry with backoff)
  • Service errors (API temporarily unavailable)
  • Validation errors (bad input)

Development

Adding a New Tool

  1. Define schema in src/tools.ts
  2. Add handler in src/index.ts tool dispatch
  3. Add contract test in .contract.test.ts
  4. Test with npm test

Testing

bash
npm test -- --run        # Single run
npm test -- --watch      # Watch mode

Troubleshooting

Config file not found

bash
cp config.example.json config.json
# Fill in your Azure credentials and Bing Ads IDs

Missing required credentials

Check that:

  • BING_ADS_DEVELOPER_TOKEN, BING_ADS_CLIENT_ID, and BING_ADS_REFRESH_TOKEN are set
  • BING_ADS_CLIENT_SECRET is set (if using a confidential app)
  • OAuth token is valid (expires, may need refresh)

Rate limit exceeded

Bing Ads applies rate limits. The server handles common retries automatically. If you hit limits frequently:

  • Batch operations when possible
  • Reduce query frequency
  • Wait before retrying

Quality Score is 0

QS = 0 means keyword hasn't been shown enough times yet. Increase impressions or wait for more data.

License

MIT

Contributing

Contributions welcome! Please:

  1. Add tests for new features
  2. Update README
  3. Follow existing code style
  4. Tag releases

Support

  • Issues: GitHub issues for bugs/feature requests
  • Docs: See docs/ folder for detailed API reference
  • Community: GitHub Discussions

Built By

Mark Harnett — Demand generation leader and paid media practitioner building AI-powered ad management tools. This is the first comprehensive open-source Bing Ads MCP server — born from managing real campaigns across multiple accounts and wanting Claude to do the heavy lifting.

Built with production workloads in mind: resilient API calls (circuit breakers, retry with backoff, response truncation), full Quality Score diagnostics, and negative keyword management at scale.

Also by Mark: mcp-linkedin-ads -- LinkedIn Ads MCP server with 7 tools.

Last Updated: 2026-03-13

来源:README.md,提交 9b9be61

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分