Microsoft Ads MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Microsoft Ads MCP Server (read + write)
An MCP server for Microsoft Advertising, using the Microsoft Advertising REST API v13 (the API formerly called the Bing Ads API). Use it from Claude, ChatGPT, Cursor, Codex or any MCP client to report on Search, Shopping and Performance Max campaigns, find keywords, and change campaigns, ad groups, ads, keywords, targeting, budgets and bids.
Maintained by AI Shopping Feeds. It offers:
Coverage of the advertiser workflow: accounts, campaigns, ad groups, ads (with a responsive search ad helper), keywords and negatives, Performance Max asset groups, targeting and audiences, shared budgets, portfolio bid strategies, labels, reports, change history, keyword ideas, estimates, recommendations and bulk download
Safety: dry-run, confirm words for deletes, big batches and spend rises, new campaigns created paused, an audit log with before-snapshots, read-only mode and tool groups
An escape hatch for every other REST v13 operation, read-only or confirm-gated
Microsoft also runs a hosted Microsoft Advertising MCP Server that you connect with your own Entra app. Its documented scenarios are reporting, analysis, assets and change history. This one runs on your own machine and adds guarded write tools. More in docs/terms-and-data.md.
Not affiliated with or endorsed by Microsoft.
Part of the AI Shopping Feeds MCP family: Google Ads · Google Merchant Centre · Google Analytics · YouTube Studio · Amazon Ads · Apple Ads · Microsoft Ads · TikTok Ads · Pinterest Ads · Snapchat Ads · OpenAI Ads · AppLovin.
Let your agent set it up
Paste this into Claude Code, Codex, Cursor or any agent that can read web pages and edit files:
Set up the Microsoft Ads MCP server for me by following https://raw.githubusercontent.com/AI-Shopping-Feeds/microsoft-ads-mcp/main/skills/microsoft-ads-mcp/SKILL.mdThe agent checks whether it's already connected, installs the runner if you agree, walks
you through the developer token, the Entra app registration and sign-in, adds the server
to your client's config without touching your other servers, and checks it works by
calling microsoft_ads_health_check.
The same file is an Agent Skill, so your agent can keep it as a guide to using the tools well. For Claude Code, copy the folder into your skills:
git clone --depth 1 https://github.com/AI-Shopping-Feeds/microsoft-ads-mcp.git /tmp/microsoft-ads-mcp
cp -r /tmp/microsoft-ads-mcp/skills/microsoft-ads-mcp ~/.claude/skills/Other agents that support skills load the same skills/microsoft-ads-mcp folder from their
own skills directory.
Related MCP server: microsoft-ads-mcp
What it can do
70 tools, all prefixed microsoft_ads_. The full list is in docs/tools.md.
Read
Area | Tools |
Accounts |
|
Structure |
|
Targeting |
|
Budgets and labels |
|
Reports |
|
Insights |
|
Bulk and anything else |
|
Write
Area | Tools |
Campaigns and ad groups |
|
Ads |
|
Keywords |
|
Performance Max |
|
Targeting |
|
Budgets and bidding |
|
Labels |
|
Quick edits |
|
Recommendations |
|
Any operation |
|
Safety
Dry-run (
MICROSOFT_ADS_DRY_RUN=trueormicrosoft_ads_set_dry_run) records writes and returns a preview without sending them.Confirm words: deletes need
confirm="DELETE". Batches over 10 items, bid or budget rises over 20% (or where the current value can't be read), values over your caps, enabling campaigns, applying recommendations and raw writes needconfirm="APPLY". A refused call shows what it would send.New campaigns, ad groups and asset groups are created paused unless you set
Status.Audit log of every write and rehearsal, with a before-snapshot, in
~/.microsoft-ads-mcp/logs/audit.jsonl(owner-only). Entries older than 30 days are pruned;microsoft-ads-mcp purgedeletes the log and the stored token. Report rows stay in memory and downloads are capped at 200 MB.Read-only mode (
MICROSOFT_ADS_READ_ONLY=true) and tool groups (MICROSOFT_ADS_TOOL_GROUPS) limit what the agent can see.Spend guards:
MICROSOFT_ADS_MAX_INCREASE_PCT,MICROSOFT_ADS_MAX_DAILY_BUDGETandMICROSOFT_ADS_MAX_BID.The HTTP transports refuse to bind to a non-loopback address unless you set
MICROSOFT_ADS_ALLOW_REMOTE=true.Only Microsoft Advertising and Microsoft sign-in hosts are called. Terms, data handling and limits: docs/terms-and-data.md.
Supported clients
Client | Works? | How |
Claude Code | ✅ | Local server, |
Claude Desktop | ✅ | Local server, |
Cursor | ✅ | Local server, |
VS Code (Copilot) | ✅ | Local server, |
Codex | ✅ | Local server, |
Gemini CLI | ✅ | Local server, |
Windsurf and other local clients | ✅ | Local server, same JSON entry |
Claude.ai and ChatGPT | ❌ not yet | These need a remote server with sign-in. This server's HTTP transports have no sign-in, so don't expose them publicly. Use a local client. |
Setup
1. Install uv
The server runs with uvx from uv
(brew install uv on macOS) and needs Python 3.11 or later. It installs straight from this
repository:
uvx --from git+https://github.com/AI-Shopping-Feeds/microsoft-ads-mcp.git microsoft-ads-mcpPin a release by adding @vX.Y.Z to the URL.
2. Get credentials
Developer token: a Super Admin of your Microsoft Advertising account requests one in Microsoft Advertising under Settings > Developer settings. Microsoft says it is issued straight away for your own accounts and can take up to five business days if you manage other people's accounts. Not needed for the sandbox.
App registration: in the Azure portal (Microsoft Entra ID > App registrations), register an app for any organisational directory and personal Microsoft accounts, and add the redirect URI
http://localhost:8765/callbackunder Mobile and desktop applications. Copy the Application (client) ID.Sign in once with the Microsoft account that manages the ads:
MICROSOFT_ADS_CLIENT_ID=your-client-id MICROSOFT_ADS_DEVELOPER_TOKEN=your-developer-token \ uvx --from git+https://github.com/AI-Shopping-Feeds/microsoft-ads-mcp.git microsoft-ads-mcp authIt saves a refresh token to
~/.microsoft-ads-mcp/secrets/microsoft-ads-token.json(owner-only). Add--manualif the browser can't reach localhost.
Step by step, with the sandbox, agencies and troubleshooting: docs/setup-microsoft-ads-api.md.
3. Add it to your client
Replace the placeholders. Keep your other servers in each file. The token file from step 2 is found automatically.
Claude Code
claude mcp add --scope user microsoft-ads \
--env MICROSOFT_ADS_CLIENT_ID=your-client-id \
--env MICROSOFT_ADS_DEVELOPER_TOKEN=your-developer-token \
--env MICROSOFT_ADS_ACCOUNT_ID=123456789 \
-- uvx --from git+https://github.com/AI-Shopping-Feeds/microsoft-ads-mcp.git microsoft-ads-mcpClaude Desktop, Cursor, Gemini CLI, Windsurf (and VS Code under servers)
{
"mcpServers": {
"microsoft-ads": {
"command": "uvx",
"args": ["--from", "git+https://github.com/AI-Shopping-Feeds/microsoft-ads-mcp.git", "microsoft-ads-mcp"],
"env": {
"MICROSOFT_ADS_CLIENT_ID": "your-client-id",
"MICROSOFT_ADS_DEVELOPER_TOKEN": "your-developer-token",
"MICROSOFT_ADS_ACCOUNT_ID": "123456789"
}
}
}
}Desktop apps often can't find uvx on the PATH; if the server doesn't start, use the full
path from which uvx as the command. If you keep the token somewhere else, add
"MICROSOFT_ADS_TOKEN_FILE": "/abs/path/microsoft-ads-token.json".
Codex (~/.codex/config.toml)
[mcp_servers.microsoft-ads]
command = "uvx"
args = ["--from", "git+https://github.com/AI-Shopping-Feeds/microsoft-ads-mcp.git", "microsoft-ads-mcp"]
env = { MICROSOFT_ADS_CLIENT_ID = "your-client-id", MICROSOFT_ADS_DEVELOPER_TOKEN = "your-developer-token", MICROSOFT_ADS_ACCOUNT_ID = "123456789" }You can also put these settings in ~/.microsoft-ads-mcp/.env instead of the client config.
4. Check it works
Restart or reload the client, then ask it "which Microsoft Advertising accounts can you
see?". It should call microsoft_ads_health_check and list your accounts. Set
MICROSOFT_ADS_ACCOUNT_ID to the one you use most; tools also take an account_id.
Configuration
Variable | Required | What it does |
| yes | Application (client) ID of your Entra app registration |
| production | Developer token (the sandbox uses Microsoft's universal sandbox token) |
| no |
|
| no | Only for apps registered as Web apps with a secret |
| no | Sign-in tenant (default |
| no | Refresh-token file written by |
| no | The refresh token itself, instead of the file |
| no | Default account, and its customer (looked up from the account if unset) |
| no |
|
| no |
|
| no | Comma-separated groups: |
| no | Items per write before |
| no | Bid/budget rise that needs |
| no | Optional absolute caps |
| no | Audit log path (default |
| no | Days to keep audit entries, pruned at startup (default 30; 0 keeps them) |
| no | Largest report or bulk file to download (default 200) |
| no | Per-user folder for secrets, logs and |
| no | Request timeout in seconds (60) and log level (logs go to stderr) |
| no |
|
| no |
|
Settings are read from the environment, --env FILE, ./.env and then
~/.microsoft-ads-mcp/.env. CLI: microsoft-ads-mcp run (default), auth, purge,
describe, version.
Example prompts
Which campaigns spent the most last week, and what was their cost per conversion?Lower keyword bids by 10% in the "Running shoes" ad group for keywords with no conversions in 30 days. Dry-run first and show me the table.Add "free" and "cheap" as phrase negatives to all my Search campaigns.What changed in the account in the last seven days, and who changed it?More docs
Agent skill: setup and usage guide for agents
Contributing and licence
Issues and pull requests are welcome on this repository. See CONTRIBUTING.md.
Licensed under the MIT License.
Try out AI Shopping Feeds, our shopping feed management tool (including Google Shopping feeds).
This server cannot be deployed
Maintenance
Related MCP Connectors
Microsoft Ads MCP server: 11 tools for search, PMax, Google Ads imports. Read-only by default.
Google Ads MCP: reports, search terms, negatives, budgets, campaigns. Approval on every write.
Connects Amazon Seller Central and Amazon Advertising to any MCP client. Settlement-accurate P&L - every fee, refund and reimbursement as Amazon posted it - plus contribution margin and breakeven per product, per marketplace, per day. Full Sponsored Products, Brands and Display management: search terms, placements, keyword and competitor research, dayparting, automation rules. 110 tools: 78 read-only (P&L, PPC at every grain, SQP/Brand Analytics, inventory, forecasting), 28 staged writes (every change is a proposal you review and confirm before it reaches Amazon - there is no autonomous-write mode), and 4 confirmation & support tools. 4 additional AI Workforce tools appear once a client is connected.
Google Ads MCP server — manage campaigns, keywords, and metrics.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for Microsoft Advertising (Bing Ads) REST API enabling agent-led campaign management and reporting. It provides tools to manage campaigns, ad groups, keywords, ads, budgets, and pull performance reports.6632 PyPIMIT
- AlicenseAqualityDmaintenanceAn MCP server for the Microsoft Advertising (Bing Ads) API. Gives an MCP client live read and management access to your Microsoft Advertising accounts — reporting, campaign structure, and full write operations.26MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to retrieve Google Ads performance data, run GAQL queries and keyword planner research, and create or manage search and P-MAX campaigns, budgets, keywords, and ad status. Includes safety defaults such as paused creation and read-only mode.16MIT
- AlicenseAqualityBmaintenanceEnables MCP-compatible clients to query advertising data, analyze spend, conversions, and audiences, compare campaigns, generate dashboards, and manage campaigns with optional read-only safeguards.28Apache 2.0