GuidesArticleOperator-judged

Connect MCP and launch

Run ztdsp mcp with ADP_ZERO_API_KEY and ADP_ZERO_API_URL. The agent discovers tools, sends mutations through the public API, and opens a hosted funding link when the wallet needs money.

Published 2026-09-09 · Search job: MCP advertising server

Connect an MCP client to Adprime Zero by running ztdsp mcp with ADP_ZERO_API_KEY and ADP_ZERO_API_URL. The agent then sees the tool list and launches through the same public API as the dashboard.

This is the technical attach guide. The short artifact is MCP setup card. The discovery pillar is Run ads from an AI agent.

Client config

{
  "mcpServers": {
    "adprime-zero": {
      "command": "npx",
      "args": ["-y", "ztdsp", "mcp"],
      "env": {
        "ADP_ZERO_API_URL": "https://adp-zero-api.adam-25a.workers.dev",
        "ADP_ZERO_API_KEY": "<stored api key>"
      }
    }
  }
}

Get the key from dashboard API keys or from ztdsp register. Store it in the client's secret env, not in the repo and not in the chat. The key looks like ak_.... Rotate it if it landed in a transcript.

MCP tools that change account state send Authorization: Bearer <api_key> to the public REST API. They also send X-AdpZero-Request-Id. Failures report that id. Diagnostics write JSON to stderr only. Do not log keys, bearer headers, tool arguments, bodies, cookies, payment details, or login codes.

Tools the agent should find

Setup and money: register_account, request_prepay_link, list_funding_intents, get_funding_intent_status.

Audience and campaign: discover_segments, create_targeting, submit_creative, create_campaign.

Iteration: list_campaign_creatives, add_campaign_creative, replace_campaign_creative, pause_campaign_creative, resume_campaign_creative, remove_campaign_creative, copy_campaign.

Measurement: conversion-event tools, query_performance, get_campaign_performance.

If the client cannot see those names, the MCP process is not running or the key is missing. Fix attach before you debug targeting. A client that lists tools but cannot mutate usually has a placeholder key still in the JSON, or is pointed at the wrong ADP_ZERO_API_URL.

Do not ask the model to type the key into a prompt "so it can test." If the env is set, the tools already have it. If the env is not set, edit the client config and restart the MCP process.

First launch after connect

  1. Confirm the tool list. Ask the agent to name request_prepay_link and submit_creative.
  2. If the wallet is empty, have it request a prepay link. You complete login and Stripe Checkout. The agent polls funding status.
  3. Submit creative and create targeting from catalog ids.
  4. Create the campaign and read readiness. Activate when balance and review allow it.
  5. Subscribe webhooks if you want funded, balance-low, creative, campaign, URL, and conversion events without polling.

If a tool fails, read the upstream request id before rewriting targeting. A 401 is a bad or missing key. A funding or activation refusal about prepaid balance is a wallet problem, not a creative problem. Those are different fixes.

Direct REST remains available with the same key. REST clients need a normal User-Agent, for example your-agent-name/1.0. MCP is not a second permission model. How an agent buys ads is the loop after this config works. Agent quickstart is the docs twin of this page.