X Ads MCP server for AI agents

Live

OAUTH 2.0

SOCIAL ADS

Marketing

X Ads gives your agent campaign management in your X Ads accounts: list campaigns, line items, funding instruments, and audiences, read account stats and reach, and create and update campaigns, line items, cards, and custom audiences.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
X Ads
agent · Acme Q3
Run
List the campaigns in my main ads account.
S
xadsmcp_list_campaigns
246ms
Social ads agent
3 campaigns in the main ads account: Spring Launch, Webinar Promo, and App Install.
Sources: X Ads campaigns, 3 results
xadsmcp
3 campaigns
18:29
Message Claude...

Tools your social ads agent reaches for on X Ads, scoped per user.

CALL ANY TOOL
74 tools for social ads in X Ads: list campaigns, line items, and audiences, read account stats and reach, look up targeting, and create, update, activate, and delete ads entities.
xadsmcp_activate_campaign
Activate campaign
Activate a campaign (set entity_status=ACTIVE). This makes the campaign eligible to serve ads and SPEND REAL MONEY once its line items are also active. This is the only tool that can activate a campaign; confirm with the advertiser before calling it.
Parameters
Name
Type
Required
Description
account_id
string
Required
The ID of the ads account.
campaign_id
string
Required
The ID of the campaign to activate.
xadsmcp_add_targeting_criterion
Add targeting criterion
xadsmcp_batch_do_not_reach_list_users
Batch do not reach list users
xadsmcp_create_ad_post
Post create ad
xadsmcp_create_campaign
Create campaign
xadsmcp_create_do_not_reach_list
List create do not reach
xadsmcp_create_line_item
Create line item
xadsmcp_create_media_library_item
Create media library item
xadsmcp_delete_account_media
Delete account media
xadsmcp_delete_card
Delete card
xadsmcp_delete_media_library_item
Delete media library item
xadsmcp_get_account_media
Get account media
xadsmcp_get_active_entities
Get active entities
xadsmcp_get_app_list
List get app
xadsmcp_get_campaign_reach
Get campaign reach
xadsmcp_get_funding_instrument
Get funding instrument
xadsmcp_get_media_creative
Get media creative
xadsmcp_get_targeting_criterion
Get targeting criterion
xadsmcp_list_account_posts
List account posts
xadsmcp_list_app_lists
List app lists
xadsmcp_list_custom_audience_targeted
List custom audience targeted
xadsmcp_list_do_not_reach_lists
List do not reach lists
xadsmcp_list_line_items
List line items
xadsmcp_list_media_library
List media library
xadsmcp_list_targeting_criteria
List targeting criteria
xadsmcp_promote_post
Post promote
xadsmcp_remove_targeting
Remove targeting
xadsmcp_search_targeting_interests
Search targeting interests
xadsmcp_update_campaign
Update campaign
xadsmcp_update_media_library_item
Update media library item

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// X Ads tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["xadsmcp"], toolNames: [
    "xadsmcp_list_ads_accounts",
    "xadsmcp_list_campaigns",
    "xadsmcp_get_account_stats"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List my ads accounts, show the campaigns in the main one, and pull its account stats" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["xadsmcp"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List my ads accounts, show the campaigns in the main one, and pull its account stats" }],
  tools,
});

// Execute the tool call with the user's vaulted X Ads OAuth token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["xadsmcp"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List my ads accounts, show the campaigns in the main one, and pull its account stats" }],
  tools,
});

// Tool call runs with the user's vaulted X Ads OAuth token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["xadsmcp"] }, pageSize: 100,
});

const agent = new Agent({
  name: "social_ads_agent",
  model: "gemini-2.5-pro",
  instruction: "X Ads tools scoped to this user",
  tools,
});

await agent.run("List my ads accounts, show the campaigns in the main one, and pull its account stats");
Try these prompts
Copy any prompt into your agent. Each maps directly to a X Ads tool. Click to copy, paste into your agent, done.
Accounts and campaigns
Copy the prompt
Copied
List the ads accounts I can manage.
Copy the prompt
Copied
List the campaigns and line items in this account.
Copy the prompt
Copied
Show the stats for this ads account.
Targeting and audiences
Copy the prompt
Copied
Search targeting interests for running.
Copy the prompt
Copied
Search targeting locations for Austin.
Copy the prompt
Copied
Estimate the audience size for this targeting.
Create and promote
Copy the prompt
Copied
Create a campaign with a daily budget of $50.
Copy the prompt
Copied
Promote this post as an ad.
Copy the prompt
Copied
Activate this line item.
SEE HOW AUTH WORKS
Each user signs in to X Ads once, and Scalekit stores and refreshes their tokens. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
X Ads
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
X Ads
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
X Ads
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
X Ads
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other marketing connectors.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Test other agents
See the same per-user auth pattern across other marketing connectors.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared X Ads token looks fine in a demo. In production every campaign activation and ad spend change looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
X Ads today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access X Ads as the user or through a shared service account?
As the user. Each user signs in to X Ads once, and Scalekit stores and refreshes their tokens. Every campaign activation and spend change in your audit trail is attributed to that user, not a shared service account.
Where is the X Ads OAuth token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in X Ads?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the list, get, and estimate tools without xadsmcp_activate_campaign, which can spend real money once line items are active, or xadsmcp_delete_custom_audience. Scalekit also enforces scope checks before every API call.
What happens when a user revokes X Ads access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Which tools help plan targeting?
xadsmcp_search_targeting_interests and xadsmcp_search_targeting_locations find targeting options, xadsmcp_estimate_audience estimates the audience size, and xadsmcp_add_targeting_criterion adds one criterion to a line item.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""xadsmcp"": {
""url"": ""https://mcp.scalekit.com/xadsmcp"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.xadsmcp]
url = ""https://mcp.scalekit.com/xadsmcp""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""xadsmcp"": {
""url"": ""https://mcp.scalekit.com/xadsmcp"",
""type"": ""http""
}
}
}