Operate Advertising.chat from Claude¶
@advertising-chat/mcp-manage is a local MCP server that turns Claude
Desktop, Claude Code, or any MCP-capable agent host into a management
console for your Advertising.chat account: ad units, line items, creatives
(including flows), campaigns, API keys, and live performance — about 39
tools, all running with your account and permissions.
Ask things like:
- "How many impressions did we serve this week, and from which ad units?"
- "Create a line item for the homepage ad unit with the summer-sale creative — leave it disabled, I'll review first."
- "Pause every creative that mentions the old pricing."
1. Log in once¶
mcp-manage reuses the Advertising.chat CLI's authentication. Install
ads-cli and run:
This runs a browser device-flow sign-in and caches a token at ~/.ads-cli.
mcp-manage picks it up — and refreshes it — automatically. (Alternatively,
set ADCHAT_TOKEN to an access token in the server's environment.)
2. Add the server to your MCP host¶
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"advertising-chat-manage": {
"command": "npx",
"args": ["-y", "@advertising-chat/mcp-manage"]
}
}
}
Claude Code:
Optional environment variables:
| Env var | Meaning |
|---|---|
ADCHAT_ORG |
Org id to operate on. Default: your own org. You must be a member of the target org. |
ADCHAT_TOKEN |
Explicit access token (instead of the ~/.ads-cli cache). |
Restart the host and ask whoami — the agent should report your email,
org, and role.
3. What your agent can do¶
Every tool is a thin projection of the same management API the Console uses, called with your token. Your role applies unchanged: a viewer can read everything below but every mutation fails with a permission error; editor and up can mutate.
| Area | Tools |
|---|---|
| Context | whoami |
| Ad units | list_ad_units, get_ad_unit, create_ad_unit, update_ad_unit, delete_ad_unit, suggest_targeting_keys |
| Line items | list_line_items, get_line_item, create_line_item, update_line_item, enable_line_item, disable_line_item, delete_line_item |
| Creatives | list_creatives, get_creative, create_creative, update_creative, pause_creative, resume_creative, delete_creative |
| Campaigns | list_campaigns, get_campaign, create_campaign, update_campaign, pause_campaign, resume_campaign, delete_campaign |
| Ad groups | list_ad_groups, get_ad_group, create_ad_group, update_ad_group, delete_ad_group |
| API keys | list_api_keys, create_api_key |
| Performance | query_counters, query_uniques, query_publisher_journal, get_entity_stats |
Flow creatives (format: "Flow") get special treatment: the conversation
graph is validated locally against the flow creative spec — node bounds,
edge integrity, depth, required disclosure — before anything is sent, so
authoring mistakes come back instantly with exact, fixable errors.
Safety model¶
- Your authority, nothing more. Every request carries your token and target org; membership and role checks happen server-side exactly as they do for the Console. There is no service credential anywhere in the loop.
- Created disabled. New ad units, line items, and campaigns default to
enabled: false— nothing serves until you review and enable it, unless you explicitly ask the agent to launch. - Deletes are double-gated. Destructive tools refuse to run without an
explicit
confirm: trueargument (the agent must show you what it's deleting and get your go-ahead), and MCP hosts prompt on non-read-only tools as well. - Attributed. Requests are tagged
X-Adchat-Agent: mcp-manage, so agent-made changes are distinguishable in platform logs. - The server never logs your token.
Troubleshooting¶
| Symptom | Fix |
|---|---|
"Not authenticated. Either run ads login …" |
Run ads login; check ~/.ads-cli exists. |
| "Session expired and no refresh token…" | Run ads login again. |
| 401 on every call | Your token expired and could not refresh — ads login. If you set ADCHAT_ORG, confirm you are a member of that org. |
| Mutations return 403, reads work | Your role in the org is viewer. Ask an org admin for editor. |