Connects Claude to the Microsoft Advertising API with ten production-tested tools covering campaigns, ad groups, keywords, and performance reports. You can pull quality scores and keyword metrics, analyze search terms that triggered your ads, manage negative keyword lists, and update campaign budgets. Ships read-only by default with an explicit write flag to prevent accidental changes from casual prompts. Built for teams running Bing Ads who want programmatic access to bid automation, budget optimization, and performance analysis without writing against the raw API. Uses OAuth through Azure AD and supports multi-account setups via config.
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:
Note: ⚠️ First open-source Bing Ads MCP with comprehensive tooling
npm install mcp-bing-ads
Security: Never share your .mcp.json file or commit it to git -- it may contain API credentials. Add .mcp.json to your .gitignore.
Get OAuth credentials:
Microsoft Advertising APIhttps://ads.microsoft.com/msads.manage offline_accessCreate config.json:
cp config.example.json config.json
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"
}
}
}
Set environment variables (recommended):
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"
| Variable | Required | Default | Description |
|---|---|---|---|
BING_ADS_DEVELOPER_TOKEN | yes | -- | Microsoft Advertising developer token |
BING_ADS_CLIENT_ID | yes | -- | Azure AD app client ID |
BING_ADS_REFRESH_TOKEN | yes | -- | OAuth refresh token |
BING_ADS_CLIENT_SECRET | no | -- | Azure AD app client secret (if confidential client) |
BING_ADS_MCP_WRITE | no | false | Set to true, 1, or yes to expose mutating tools (pause/update/add). Any other value -- or unset -- keeps the server read-only. |
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.
npm start
Add to ~/.claude.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).
// 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" }
]
})
bing_ads_get_client_context(working_directory) -- Detect account from working directorybing_ads_list_campaigns() -- List all campaignsbing_ads_get_campaign_performance(start_date, end_date) -- Campaign metricsbing_ads_update_campaign_budget(campaign_id, daily_budget) -- Update daily spendbing_ads_list_ad_groups(campaign_id) -- List ad groups in campaignbing_ads_keyword_performance(start_date, end_date, [campaign_ids]) -- Keyword metrics & QSbing_ads_search_term_report(start_date, end_date) -- Search terms that triggered adsbing_ads_pause_keywords(ad_group_id, keyword_ids) -- Pause keywordsbing_ads_list_shared_entities([type]) -- List shared negative listsbing_ads_add_shared_negatives(list_id, keywords) -- Add to shared listQuality Score (QS): 1-10 rating of keyword quality
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
npm run dev # Run in dev mode (tsx)
npm run build # Compile TypeScript
npm test # Run contract tests
Files:
src/index.ts — MCP server, OAuth flow, tool handlerssrc/tools.ts — Tool schema definitionssrc/errors.ts — Error handling & classificationconfig.json — Credentials & client mappingError Classification:
src/tools.tssrc/index.ts tool dispatch.contract.test.tsnpm testnpm test -- --run # Single run
npm test -- --watch # Watch mode
Config file not foundcp config.example.json config.json
# Fill in your Azure credentials and Bing Ads IDs
Missing required credentialsCheck that:
BING_ADS_DEVELOPER_TOKEN, BING_ADS_CLIENT_ID, and BING_ADS_REFRESH_TOKEN are setBING_ADS_CLIENT_SECRET is set (if using a confidential app)Rate limit exceededBing Ads applies rate limits. The server handles common retries automatically. If you hit limits frequently:
Quality Score is 0QS = 0 means keyword hasn't been shown enough times yet. Increase impressions or wait for more data.
MIT
Contributions welcome! Please:
docs/ folder for detailed API referenceMark 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
BING_ADS_DEVELOPER_TOKEN*secretMicrosoft Advertising developer token
BING_ADS_CLIENT_ID*Azure AD app client ID for OAuth
BING_ADS_REFRESH_TOKEN*secretOAuth refresh token for Microsoft Advertising API
BING_ADS_CLIENT_SECRETsecretAzure AD app client secret (optional for public clients)
com.mcparmory/google-search
io.github.pipeworx-io/brave-search
marcopesani/mcp-server-serper
brave/brave-search-mcp-server
com.mcparmory/google-search-console
acamolese/google-search-console-mcp