This skill tells you how to create, edit, and report on X (Twitter) ads through AdKit. It covers the steps, not the strategy.
Connect AdKit
AdKit is one MCP connector for Meta, Google, TikTok, LinkedIn, Microsoft, Reddit, X, and Pinterest ads.
- Claude, ChatGPT, and most AI apps: add a custom connector with the address
https://mcp.adkit.so, then sign in. - Claude Code:
claude mcp add --transport http adkit https://mcp.adkit.so
For other AI apps, see how to connect AdKit to X Ads. If the AdKit tools are not available, tell the user how to connect. Then stop.
What AdKit can do on X
| Entity | X name | Actions |
|---|---|---|
campaigns |
Campaigns | list, get, create, update |
ad-groups |
Line items | list, get, create, update |
ads |
Promoted posts | list, get, create, delete |
results |
list (needs from and to dates) |
|
accounts |
list, available, connect, disconnect, update, profiles, pixels, funding-instruments | |
drafts |
get, publish (review your changes, then send them) |
Steps
All calls go through adkit_manage with platform: "x". Before a call you have not made in this session, read its fields with adkit_help({ path: "manage x <entity> <action>" }). Do not guess field names. In this skill, campaigns create means entity: "campaigns", action: "create".
-
Project: call
adkit_projectsand get theprojectId. Every call needs it. -
Account: call
adkit_status. If no X account is connected, calladkit_setupwithplatform: "x"and give the user the link. After they sign in, useaccountsavailable, thenaccountsconnect. -
Account defaults: find the profile, pixel, and funding instrument with
accountsprofiles,accountspixels, andaccountsfunding-instruments. Save them withaccountsupdate. This change applies immediately, with no draft. -
Build from the top down. Each create saves a draft. For each level, do these steps before you start the next level:
- Show the draft to the user (
draftsget, or the linkhttps://app.adkit.so/manage/drafts?open=<draftId>). - Wait for a yes. Then publish it with
draftspublish. - Use the X ID that the publish result returns as the parent of the next level. A draft ID never works as a parent ID.
The levels, in order:
- Campaign:
campaignscreatewith a name, a budget, andstatus: "paused". A paused campaign spends nothing. - Ad group:
ad-groupscreatewith thecampaignId, the objective, bidding, and targeting. - Ad:
adscreatewith theadGroupIdand eitherexistingPostId(promote a post that already exists) or acreativefor a new post. Readadkit_help({ path: "manage x ads create" })for the media a new post can use.
- Show the draft to the user (
-
Go live:
campaignsupdatewithstatus: "active". Publish that draft only after the user says yes. Then check withad-groupslistthat the ad groups are active too. -
Results:
resultslistwith aleveland a date range (fromandto). X requires both dates.
X rules
- Write support is in beta. When a write fails, read the error and its
retryableflag. Check your drafts and the existing X objects before you retry, so you do not create the same thing twice. Report unexpected failures withadkit_feedback. - A daily budget on the campaign means X spreads it across the ad groups, so leave the ad group budgets out. With only a lifetime budget on the campaign, set a budget on each ad group.
- The ad group objective is required, and its optimization goal must match it.
- An ad is the link between an ad group and a post. You cannot pause or edit an ad. Pause its ad group, or delete the ad.
- In results, the ad
platformIdis the ID of the promoted post (the link between the ad group and the post).postIdis the post itself. - Use AdKit field names (camelCase). The entities in the table above ignore raw X API field names.
Anything else in the X Ads API
For an X feature that AdKit does not cover, use entity: "platform-api-request" with action: "mutate". The action is always mutate, also for reads. AdKit sends the request to https://ads-api.x.com/12 as it is. The user must turn on Advanced Platform Access in AdKit's Agent Permissions.
- X often uses
PUTfor updates. Check every path and field in the X Ads API docs. - Read requests run immediately, with no draft. Writes save a draft, like any other change.
- After you use it, report the missing feature with
adkit_feedback.
{
"projectId": "<projectId>",
"entity": "platform-api-request",
"action": "mutate",
"data": {
"platform": "x",
"accountId": "<accountId>",
"endpoint": "accounts/<accountId>/campaigns",
"method": "GET",
"description": "List campaigns"
}
}
Other platforms
The same AdKit connector runs Meta, Google, TikTok, LinkedIn, Microsoft, Reddit, and Pinterest ads. Each platform has its own skill in this repo, for example meta-ads and google-ads.