npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-bing-ads

v1.0.2

Published

MCP server for Microsoft Advertising (Bing Ads) API with campaign, ad group, keyword, and performance reporting. First comprehensive open-source Bing Ads MCP.

Readme

Bing Ads MCP Server

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:

  • 30+ production-tested tools
  • 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

npm install mcp-bing-ads

Configuration

  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:

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

    {
      "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):

    export BING_ADS_CLIENT_ID="your_client_id"
    export BING_ADS_CLIENT_SECRET="your_client_secret"
    export BING_CUSTOMER_ID="your_customer_id"
    export BING_ACCOUNT_ID="your_account_id"

Usage

Start the server

npm start

Use with Claude Code

Add to ~/.claude.json:

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

Example API Calls

// 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

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
  • bing_ads_add_campaign_negatives(campaign_id, keywords) — Campaign-level negatives

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

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

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

Troubleshooting

Config file not found

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

Missing required credentials

Check that:

  • BING_ADS_CLIENT_ID and BING_ADS_CLIENT_SECRET are set (or in config.json)
  • BING_CUSTOMER_ID and BING_ACCOUNT_ID are provided
  • 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

Maintained by: VS Code AI team & community contributors

Last Updated: 2026-03-13

Stability: Production-ready

Note: This is the first comprehensive open-source Bing Ads MCP. No other serious alternatives exist.