MCP

X Ads MCP server: X's own server, and what a hosted layer on top of it adds

TL;DR

X Ads has an official MCP server (ads-api.x.com/mcp), and on X's Ads Starter plan it is the only route that works: our first live connect got an empty 403 from the REST Ads API and 74 tools from the MCP server. This guide covers using X's server directly, and what a hosted layer adds for unattended or multi-platform work.

What already exists for this platform

X publishes its own Ads MCP server over Streamable HTTP. It is stateless — a tool call needs no session — and answers in server-sent events. With an X developer app enrolled in the Ads project and an OAuth 2.0 token carrying ads.read and ads.write, any MCP client can call its tools directly.

  • An official server, 74 tools at the time of our connect: accounts, funding, campaigns, line items, promoted posts, targeting, stats, audiences, cards, pixels, media.
  • Your own developer app. X's developer console puts the Ads product on the "Ads Starter" plan, described as MCP access only — the REST Ads API answered our token with an empty 403.
  • Raw units and raw limits. Amounts are micro-units, stats are seven days and twenty ids per call, and nothing stops a call from targeting an account you did not mean.

What a hosted layer adds

X's Ads MCP directlyAgent Planners MCP
X Ads toolsX's tool list as-is10 reads, 8 writes, plus any other server tool by name
Account bindingYour own disciplineEvery call names the selected ads account
MoneyMicro-unitsWhole account currency in and out, converted once
Stats beyond 7 days / 20 idsSplit it yourselfSplit into windows and merged, in the account's time zone
CreatesWhatever you sendAlways created paused
Permanent deletes, removing targetingApplied when calledHeld for a person on every key mode
Other platforms in the same sessionNo28 more platforms on one endpoint
Counted from the tool registry; tools/list offers the same 18 X Ads tools of the 1012 on the endpoint (a key that lists tools on demand reaches them through search_tools and call_tool). A key only sees the writes if it carries tools:write.

How to configure it

  1. 1Create a key in API & MCP. tools:read for reporting; add tools:write for changes. Tools mode needs a paid plan and fails closed.
  2. 2Connect X Ads under Integrations, signing in with an X account that has a role on your ads account (ads.x.com → Settings → Users). The MCP key never carries X credentials.
  3. 3Add the server to Claude Code, Claude Desktop or Codex with the snippet below.
  4. 4Run describe_permissions, then x_ads__list_accounts for the ads account ids, and scope every call with one.
bash
claude mcp add --transport http agentplanners https://www.agentplanners.com/api/mcp \
  --header "Authorization: Bearer ap_live_…"
Codex uses the same endpoint from ~/.codex/config.toml, with the key in an environment variable rather than the file: [mcp_servers.agentplanners] / url = "…/api/mcp" / bearer_token_env_var = "AGENTPLANNERS_API_KEY".

What waits for a person, whatever the key allows

A tools:write key's writes either run inside the organization's guardrails or queue for an admin, depending on how the key was minted. One class never runs on the key's say-so: it is held in the approval queue, an accountable admin or editor is emailed, and it is decided on its own.

  • The server's permanent deletes — a custom audience, a card, a web or app event tag, a tracking tag, a media item or media creative, a do-not-reach list, an app list.
  • Removing a targeting criterion. A line item left with no criteria serves broadly, so taking one away can widen spend.
A status of DELETED and any delete-shaped write outside that list are refused outright. There is no campaign or line-item delete on X's server — pause is the stop.

X's ad model, for anyone building on it

  • Campaigns carry no budget. create_campaign takes a name and a funding instrument; daily and total budget, bid, schedule, pacing and placements belong to the line item, and a line item needs a daily budget and a start time.
  • Pause and activate are separate. An update can pause a campaign but not activate it; activation is its own call, and a line item serves only when its campaign is active as well.
  • Placements for stats are ALL_ON_TWITTER or PUBLISHER_NETWORK, and stats days follow the ads account's time zone.

Frequently asked questions

Does X have an official Ads MCP server?
Yes — X runs one at ads-api.x.com/mcp over Streamable HTTP. It listed 74 tools for our token on 2 October 2026, and on X's Ads Starter plan it is the route that works: the REST Ads API answered the same token with an empty 403.
How do I connect Claude to X Ads?
Either point your MCP client at X's own server with your own enrolled developer app and OAuth token, or use a hosted server: connect X Ads under Integrations, add the endpoint to Claude Code, Claude Desktop or Codex with an API key, and scope each call to an ads account from x_ads__list_accounts.
Can an MCP client delete X Ads campaigns?
No. X's Ads MCP has no campaign or line-item delete, so pausing is the stop. Through this server, the deletes X does offer — audiences, cards, tags, media — and removing a targeting criterion are held for a person on every key mode.
Put a human-approved agent on your ad ops

Start free — 2,500 credits a month, no credit card. Reads are free; every write waits for you.

Related reading