Microsoft Ads MCP Server
Create and manage Microsoft Advertising campaigns programmatically. This MCP server enables full campaign management for Bing and DuckDuckGo search ads.
Why Microsoft Advertising?
- - DuckDuckGo Integration - Microsoft Advertising powers DDG search ads, reaching privacy-conscious users
- Lower CPCs - Often 30-50% cheaper than Google Ads
- Bing + Yahoo + AOL - Access to the full Microsoft Search Network
- Import from Google - Easy migration of existing campaigns
Setup
1. Install the MCP server
CODEBLOCK0
2. Get credentials
- 1. Microsoft Ads Account: Sign up at ads.microsoft.com
- Developer Token: Apply at developers.ads.microsoft.com
- Azure AD App: Create at portal.azure.com with redirect URI INLINECODE0
3. Configure mcporter
Add to ~/.mcporter/mcporter.json:
CODEBLOCK1
4. Authenticate
CODEBLOCK2
Available Tools
Account Management
CODEBLOCK3
Campaign Operations
CODEBLOCK4
Ad Groups
CODEBLOCK5
Keywords
CODEBLOCK6
Ads
CODEBLOCK7
Reporting
CODEBLOCK8
Other
CODEBLOCK9
Complete Workflow Example
CODEBLOCK10
Match Types
| Type | Syntax | Triggers |
|---|
| Broad | INLINECODE2 | Related searches, synonyms |
| Phrase |
"keyword" | Contains phrase in order |
| Exact |
[keyword] | Exact match only |
Report Columns
Campaign Reports: CampaignName, Impressions, Clicks, Ctr, AverageCpc, Spend, Conversions, Revenue
Keyword Reports: Keyword, AdGroupName, CampaignName, Impressions, Clicks, Ctr, AverageCpc, Spend, Conversions, QualityScore
Search Query Reports: SearchQuery, Keyword, CampaignName, Impressions, Clicks, Spend, Conversions
Geographic Reports: Country, State, City, CampaignName, Impressions, Clicks, Spend, Conversions
Tips
- 1. Start paused - Campaigns are created paused by default. Review before activating.
- Use Phrase match - Good balance between reach and relevance for most keywords.
- Multiple headlines - RSAs need 3-15 headlines (30 chars each) and 2-4 descriptions (90 chars each).
- Check search queries - Review actual search terms to find negative keywords.
- Geographic targeting - Use geo reports to optimize by location.
Credits
MCP Server: github.com/Duartemartins/microsoft-ads-mcp-server
Built with FastMCP and the Bing Ads Python SDK
Microsoft Ads MCP 服务器
以编程方式创建和管理 Microsoft Advertising 广告活动。此 MCP 服务器支持对必应和 DuckDuckGo 搜索广告进行完整的广告活动管理。
为什么选择 Microsoft Advertising?
- - DuckDuckGo 集成 - Microsoft Advertising 为 DDG 搜索广告提供支持,覆盖注重隐私的用户
- 更低的 CPC - 通常比 Google Ads 便宜 30-50%
- 必应 + Yahoo + AOL - 访问完整的 Microsoft 搜索网络
- 从 Google 导入 - 轻松迁移现有广告活动
设置
1. 安装 MCP 服务器
bash
git clone https://github.com/Duartemartins/microsoft-ads-mcp-server.git
cd microsoft-ads-mcp-server
pip install -r requirements.txt
2. 获取凭据
- 1. Microsoft Ads 账户:在 ads.microsoft.com 注册
- 开发者令牌:在 developers.ads.microsoft.com 申请
- Azure AD 应用:在 portal.azure.com 创建,重定向 URI 设为 https://login.microsoftonline.com/common/oauth2/nativeclient
3. 配置 mcporter
添加到 ~/.mcporter/mcporter.json:
json
{
mcpServers: {
microsoft-ads: {
command: python3,
args: [/path/to/microsoft-ads-mcp-server/server.py],
type: stdio,
env: {
MICROSOFTADSDEVELOPERTOKEN: yourtoken,
MICROSOFTADSCLIENTID: yourazureappclient_id
}
}
}
}
4. 身份验证
bash
mcporter call microsoft-ads.getauthurl
在浏览器中打开 URL,登录,复制重定向 URL
mcporter call microsoft-ads.complete
auth {redirecturl: https://login.microsoftonline.com/common/oauth2/nativeclient?code=...}
可用工具
账户管理
bash
mcporter call microsoft-ads.search_accounts
广告活动操作
bash
列出广告活动
mcporter call microsoft-ads.get_campaigns
创建广告活动(为安全起见,默认暂停)
mcporter call microsoft-ads.create
campaign {name: My Campaign, dailybudget: 20}
激活或暂停
mcporter call microsoft-ads.update
campaignstatus {campaign_id: 123456, status: Active}
广告组
bash
列出广告组
mcporter call microsoft-ads.get
adgroups {campaign_id: 123456}
创建广告组
mcporter call microsoft-ads.create
adgroup {campaign
id: 123456, name: Product Keywords, cpcbid: 1.50}
关键词
bash
列出关键词
mcporter call microsoft-ads.get
keywords {adgroup_id: 789012}
添加关键词(广泛匹配、词组匹配或精确匹配)
mcporter call microsoft-ads.add
keywords {adgroup
id: 789012, keywords: buy widgets, widget store, matchtype: Phrase, default_bid: 1.25}
广告
bash
列出广告
mcporter call microsoft-ads.get
ads {adgroup_id: 789012}
创建自适应搜索广告
mcporter call microsoft-ads.create
responsivesearch_ad {
ad
groupid: 789012,
final_url: https://example.com/widgets,
headlines: Buy Widgets Online|Best Widget Store|Free Shipping,
descriptions: Shop our selection. Free shipping over $50.|Quality widgets at great prices.
}
报告
bash
提交报告请求
mcporter call microsoft-ads.submit
campaignperformance
report {daterange: LastWeek}
mcporter call microsoft-ads.submit
keywordperformance
report {daterange: LastMonth}
mcporter call microsoft-ads.submit
searchquery
report {daterange: LastWeek}
mcporter call microsoft-ads.submit
geographicreport {date_range: LastMonth}
检查状态并获取下载 URL
mcporter call microsoft-ads.poll
reportstatus
其他
bash
mcporter call microsoft-ads.get_budgets
mcporter call microsoft-ads.get_labels
完整工作流程示例
bash
1. 检查账户
mcporter call microsoft-ads.search_accounts
2. 创建广告活动
mcporter call microsoft-ads.create
campaign {name: PopaDex - DDG Search, dailybudget: 15}
返回:广告活动 ID 123456
3. 创建广告组
mcporter call microsoft-ads.create
adgroup {campaign
id: 123456, name: Privacy Keywords, cpcbid: 0.75}
返回:广告组 ID 789012
4. 添加关键词
mcporter call microsoft-ads.add_keywords {
ad
groupid: 789012,
keywords: privacy search engine, private browsing, anonymous search,
match_type: Phrase,
default_bid: 0.60
}
5. 创建广告
mcporter call microsoft-ads.create
responsivesearch_ad {
ad
groupid: 789012,
final_url: https://popadex.com,
headlines: PopaDex Private Search|Search Without Tracking|Privacy-First Search Engine,
descriptions: Search the web without being tracked. No ads, no profiling.|Your searches stay private. Try PopaDex today.
}
6. 激活广告活动
mcporter call microsoft-ads.update
campaignstatus {campaign_id: 123456, status: Active}
7. 几天后检查效果
mcporter call microsoft-ads.submit
campaignperformance
report {daterange: LastWeek}
mcporter call microsoft-ads.poll
reportstatus
匹配类型
| 类型 | 语法 | 触发条件 |
|---|
| 广泛匹配 | keyword | 相关搜索、同义词 |
| 词组匹配 |
keyword | 按顺序包含词组 |
| 精确匹配 | [keyword] | 仅精确匹配 |
报告列
广告活动报告:广告活动名称、展示次数、点击次数、点击率、平均每次点击费用、支出、转化次数、收入
关键词报告:关键词、广告组名称、广告活动名称、展示次数、点击次数、点击率、平均每次点击费用、支出、转化次数、质量得分
搜索查询报告:搜索查询、关键词、广告活动名称、展示次数、点击次数、支出、转化次数
地理报告:国家、州、城市、广告活动名称、展示次数、点击次数、支出、转化次数
提示
- 1. 从暂停开始 - 广告活动默认以暂停状态创建。激活前请先审核。
- 使用词组匹配 - 在覆盖范围和相关性之间取得良好平衡,适用于大多数关键词。
- 多个标题 - RSA 需要 3-15 个标题(每个 30 个字符)和 2-4 个描述(每个 90 个字符)。
- 检查搜索查询 - 查看实际搜索词以找到否定关键词。
- 地理定位 - 使用地理报告按位置优化。
致谢
MCP 服务器:github.com/Duartemartins/microsoft-ads-mcp-server
基于 FastMCP 和 Bing Ads Python SDK 构建