X Ads MCP server: X's own server, and what a hosted layer on top of it adds
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 directly | Agent Planners MCP | |
|---|---|---|
| X Ads tools | X's tool list as-is | 10 reads, 8 writes, plus any other server tool by name |
| Account binding | Your own discipline | Every call names the selected ads account |
| Money | Micro-units | Whole account currency in and out, converted once |
| Stats beyond 7 days / 20 ids | Split it yourself | Split into windows and merged, in the account's time zone |
| Creates | Whatever you send | Always created paused |
| Permanent deletes, removing targeting | Applied when called | Held for a person on every key mode |
| Other platforms in the same session | No | 28 more platforms on one endpoint |
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
- 1Create a key in API & MCP.
tools:readfor reporting; addtools:writefor changes. Tools mode needs a paid plan and fails closed. - 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.
- 3Add the server to Claude Code, Claude Desktop or Codex with the snippet below.
- 4Run
describe_permissions, thenx_ads__list_accountsfor the ads account ids, and scope every call with one.
claude mcp add --transport http agentplanners https://www.agentplanners.com/api/mcp \
--header "Authorization: Bearer ap_live_…"~/.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.
X's ad model, for anyone building on it
- Campaigns carry no budget.
create_campaigntakes 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.