Sprites MCP · Microsoft Ads MCP server · Codex

How to connect Microsoft Ads to Codex

To connect Microsoft Ads to Codex, add https://mcp.sprites.ai/mcp as a remote MCP server in Codex, sign in to Sprites, and Codex can read your Microsoft Advertising account and propose changes to it. Setup takes about two minutes and needs no API key. Every write comes back as an approval before it touches the account.

MCP server URLhttps://mcp.sprites.ai/mcp

5 steps · about 2 minutes

CodexSprites connected

Which Bing search terms spent money without converting last month?

Spritesanalyzerunning
SpritesMicrosoft Ads
  • free crm software$412 · 0 convNegative-$412
  • crm jobs$188 · 0 convNegative-$188
  • crm for agencies$96 · 7 convAdd keyword$14 CPA
Read-only · nothing changedAdd the negatives

Add Sprites to Codex

Available on Anywhere Codex CLI runs — a ChatGPT plan that includes Codex, or an API key. You need a Sprites account with Microsoft Advertising already connected — the connector acts on that connection, so Codex never handles a Microsoft Ads credential.

Microsoft Ads MCP setup guide
  1. Add the server

    One command writes the entry into ~/.codex/config.toml for you.

    Terminal
    codex mcp add sprites --url https://mcp.sprites.ai/mcp
  2. Or write the config by hand

    The same entry in ~/.codex/config.toml, or in .codex/config.toml inside a trusted project when you want the connector scoped to one repo.

    ~/.codex/config.toml
    [mcp_servers.sprites]
    url = "https://mcp.sprites.ai/mcp"
    auth = "oauth"
  3. Sign in

    Codex opens a browser for the Sprites consent screen and stores the token locally. Sprites supports dynamic client registration and client ID metadata documents, so there is nothing to pre-register.

    Terminal
    codex mcp login sprites
  4. Approve changes by name

    Codex renders results as text, so a pending change comes back written out rather than as a card you can click. Nothing is applied until you approve it, and the approval waits for you in Sprites — open it there and the same run continues.

    Pending change
    ChangeDaily budget $40 → $65Gategate_7f2c…

What permissions this needs

Connecting Microsoft Ads to Codex yourself means a Microsoft Advertising API integration, and these are the permissions and gates it runs into. Through Sprites you sign in with OAuth instead, with no developer token or app review of your own.

OAuth scope: msads.manage

The one scope the Microsoft Advertising API takes for a signed-in user, read and write alike. offline_access adds the refresh token a connection needs to outlive the hour.

Microsoft Entra app registration

A self-built integration, Microsoft’s own MCP server included, signs in through an app you register in Microsoft Entra.

Developer token

Every Microsoft Advertising API call carries a developer token, requested from the Microsoft Advertising Developer Portal.

CustomerId and CustomerAccountId

Calls name the customer (the manager level) and the ad account they act on, in their own headers.

What Sprites asks for when you connect

Microsoft sign-in for openid, offline_access and the msads.manage scope, on the Sprites app.

What you skip

You register no Entra app, request no developer token and never handle a customer or account ID. Codex signs in to Sprites with OAuth and never holds a Microsoft Ads credential.

Official Microsoft Advertising MCP vs Sprites MCP

Microsoft runs its own MCP server at partner.api.bingads.microsoft.com/ext/mcp/vnext. Here is what each one covers, so you can pick the one that fits in Codex — or connect both.

Microsoft hosts its own MCP server for Microsoft Advertising. It reads campaigns, ad groups, ads, keywords and their performance, and it is free. Before any client can connect you register your own Microsoft Entra app with the msads.manage scope, which is routine for a developer and a wall for most marketers. It only reads, so every change still happens in Microsoft Advertising itself.

Microsoft’s official Microsoft Advertising MCP compared with the Sprites MCP server
Microsoft officialpartner.api.bingads.microsoft.com/ext/mcp/vnextSprites MCPapproval-gated
Endpointpartner.api.bingads.microsoft.com/ext/mcp/vnextmcp.sprites.ai/mcp
SetupRegister your own Entra app with the msads.manage scopeSign in to Microsoft once inside Sprites
WritesNone: read-onlyCampaigns, ad groups, ads, keywords, negatives, budgets, status and goals
ApprovalNothing to approve, since nothing changesEvery change is a card, then read back from Microsoft
ReachesMicrosoft Advertising onlyMicrosoft beside Google, Meta, LinkedIn, TikTok, Reddit, GA4 and SEO

If you only want to read Microsoft Advertising from a chat and can register an Entra app, Microsoft’s own server is free and enough. Use Sprites when you want the agent to act on what it finds, adding the negatives, moving the budget or building the campaign, with each change approved first and checked after.

Why run Microsoft Ads ads through Sprites

Codex is the interface; the connector decides what it can see and what it is allowed to do. Six things change when that connector is Sprites.

Bing and Google in one answer

Most Microsoft accounts mirror a Google Ads account. Sprites reads both, so the same keyword’s cost on each network is one question, and the budget move it suggests is the next.

Google Ads MCP server

Every change approved, then verified

Budgets, keywords, negatives, ads and campaigns each arrive as a card with the before and after. After you approve, Sprites reads the entity back from Microsoft to confirm the change landed as shown.

No Entra app to register

Sprites connects with a normal Microsoft sign-in. There is no app registration, developer token or client secret for you to create or keep safe.

Run the first prompt

Ask Codex this. It routes to a Sprites door, which reads your Microsoft Advertising account and answers — no account to name, no confirmation to give first.

  • With Sprites, which Microsoft Ads search terms spent money without converting last month?
  • Ask Sprites to compare cost per conversion on Bing and Google for our brand campaigns.
  • Use Sprites to add these 12 terms as negatives to our shared Microsoft Ads list.
  • Have Sprites raise the Bing Brand campaign budget to $80 a day.
  • With Sprites, build a Microsoft Ads search campaign for our new pricing page, paused.

Run `codex mcp list` and confirm sprites shows as connected.

Running Microsoft Advertising from Codex

The jobs people hand over first, start to finish: what you type, what Sprites does with it, and what comes back to approve.

  1. Weekly search term cleanup

    You, in CodexEvery Monday, have Sprites review last week’s Microsoft Ads search terms.

    Sprites does
    Runs the search query report, finds terms with spend and no conversions, and the converting terms you do not yet bid on.
    You get back
    One card of negatives to add and one of keywords to add, applied only when you approve.
  2. Bing versus Google

    You, in CodexWith Sprites, compare our cost per conversion on Bing and Google this quarter.

    Sprites does
    Reads both accounts for the same period and lines up campaigns that target the same terms.
    You get back
    A side by side table and the budget changes it suggests, as cards.
  3. A new search campaign

    You, in CodexHave Sprites build a Microsoft Ads campaign for our pricing page at $40 a day.

    Sprites does
    Drafts the campaign, ad groups, keywords and responsive search ads within Microsoft’s limits.
    You get back
    Cards for each part, created paused once approved, so you choose when it starts.

What Codex can do with Microsoft Advertising

The same doors, whichever client you are in. Marketing work that belongs in a commit: Codex can read the landing page it is about to ship and brief Sprites on the campaign pointing at it, in one session.

The searches behind the spend

Sprites runs Microsoft’s search query report and names the actual searches that triggered your ads, with what each cost and whether it converted.

Negatives in one batch

Terms to exclude go onto a shared negative keyword list or a single campaign in one approval, with a warning when a one-word broad negative would block more than you meant.

Is it actually serving?

An ad marked active can still be stuck in editorial review or under a paused ad group. Sprites reads the status of the entity, its parents and its review state together and says which one is holding it.

Search campaigns built for Bing

A campaign, its ad groups, keywords and responsive search ads arrive as cards. New campaigns, keywords and ads start paused, so nothing spends until you turn it on.

Conversion goals before smart bidding

Microsoft refuses Target CPA and Maximize Conversions without an active goal. Sprites reads your goals and UET tags and can create a URL, event or offline goal first.

Bing next to Google

Microsoft sits beside Google Ads in the same conversation, so a question like “is Bing cheaper per lead than Google for the same keywords” is one answer, not two exports.

How approvals work here

Codex renders tool results as text, so a Microsoft Ads change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.

What it reads

  • Campaigns, ad groups, ads and keywords, with their settings and status
  • Spend, clicks, impressions, conversions and CPA over any date range
  • Search query, keyword, geographic and audience reports
  • Delivery state, including editorial review and paused parents
  • Conversion goals and UET tags

What it can change

  • Search campaigns, ad groups and responsive search ads, created paused
  • Keywords added, updated or removed; negatives added to a shared list or a campaign
  • Daily budgets and status: pause, enable, or delete with a warning that it is permanent
  • Conversion goals: URL, custom event or offline
  • Every change is an approval card, then read back from Microsoft to confirm it landed

When it does not work in Codex

Three things go wrong in this client specifically, and each has a one-line fix.

Codex says the tool is not found.

The config was edited while a session was open. Restart Codex — it reads config.toml at startup.

Login loops without ever completing.

The OAuth callback defaults to http://127.0.0.1/callback. If something else on the machine holds that port, set mcp_oauth_callback_url in config.toml and log in again.

Codex says a change was applied and nothing happened in the account.

It was proposed, not applied — that is the design. The approval is waiting in Sprites; open it there and the run continues from where it stopped.

And on the Microsoft Ads side

Sprites says no Microsoft ad account is selected.

Open the Microsoft Advertising connection on the Sprites integrations page and pick the ad account. A sign-in that reaches several accounts needs one chosen.

Microsoft rejects a switch to Target CPA or Maximize Conversions.

Microsoft needs an active conversion goal first. Ask Sprites to list your goals and UET tags, and to create a goal if none is active.

A new ad shows as active but gets no impressions.

Microsoft reviews every ad before it serves. Ask Sprites why it is not serving: it reads editorial review and the parent ad group and campaign together.

Microsoft says the connection has expired.

Reconnect Microsoft Advertising on the Sprites integrations page, then ask again.

Microsoft Advertising and Codex: questions

Which URL do I paste into Codex?

https://mcp.sprites.ai/mcp. There is one endpoint and every client uses it — every OAuth grant is bound to exactly that address, so a variant of it will not be honoured.

Can Codex change my Microsoft Advertising account without asking?

Codex renders tool results as text, so a Microsoft Ads change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.

Do I need a Microsoft Advertising API key or developer token?

No. Microsoft Advertising is connected once inside Sprites through Microsoft Advertising (Microsoft sign-in), and the connector acts on that connection. You register no Entra app, request no developer token and never handle a customer or account ID. Codex never sees a credential for it.

Why Codex for Microsoft Advertising specifically?

Marketing work that belongs in a commit: Codex can read the landing page it is about to ship and brief Sprites on the campaign pointing at it, in one session.

Is there an official Microsoft Ads MCP server?

Yes. Microsoft runs a hosted Microsoft Advertising MCP server that reads campaigns, ad groups, ads, keywords and their performance. It is free and read-only, and you register your own Microsoft Entra app with the msads.manage scope before a client can connect. Sprites is a separate server that also changes the account, with every change approved first.

Is this the same as Bing Ads?

Yes. Bing Ads is the old name for Microsoft Advertising. It serves search ads on Bing and Microsoft’s partner sites, and Sprites works on the same accounts.

Keep going

The same Codex connector reaches every other channel — nothing else to add.

All Microsoft Ads guides

Microsoft Advertising, from Codex

Paste one URL, sign in once, and the next Microsoft Ads question you ask Codex gets answered from the live account.