Skip to main content
Glama
README.md
<div align="center">
  <a href="https://adport.dev"><img src="website/favicon.svg" width="56" height="56" alt="Adport website" /></a>
  <h1>Adport</h1>
  <p><strong>Open-source ad management for AI agents.</strong><br />Report on campaigns and preview changes across your ad accounts through MCP or the CLI.</p>
  <p>
    <a href="https://github.com/ynnickw/adport/actions/workflows/ci.yml"><img src="https://github.com/ynnickw/adport/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
    <a href="https://www.npmjs.com/package/adport"><img src="https://img.shields.io/npm/v/adport" alt="npm version" /></a>
    <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache 2.0 license" /></a>
  </p>
  <p><strong><a href="https://app.adport.dev/login?mode=signup">Try Adport Cloud</a> · <a href="#quick-start">Run locally</a> · <a href="#local-or-cloud">Compare local and Cloud</a> · <a href="docs/README.md">Read the docs</a></strong></p>
  <p><a href="https://adport.dev">Website</a> · <a href="https://github.com/ynnickw/adport/releases">Releases</a> · <a href="SUPPORT.md">Support</a> · <a href="CONTRIBUTING.md">Contributing</a></p>
  <p><strong>Connect your ad accounts</strong><br />Google Ads · Meta Ads · TikTok Ads · Apple Ads · Microsoft Advertising · <a href="#providers">All platforms</a></p>
  <p><strong>Connect an AI agent</strong><br /><a href="https://chatgpt.com/plugins/plugin_asdk_app_6ac8e34c80f88191ab5020c82b00e652">ChatGPT</a> · <a href="https://adport.dev/resources/connect-ads-to-claude">Claude</a> · <a href="https://adport.dev/resources/connect-ads-to-claude-code">Claude Code</a> · <a href="https://adport.dev/resources/google-ads-with-codex">Codex</a> · <a href="#connect-an-ai-agent">MCP setup</a></p>
</div>

## See Adport in action

[![Watch the Adport demo on YouTube](website/media/adport-demo-poster.jpg)](https://www.youtube.com/watch?v=o7HQEG8k_NY)

[Watch on YouTube](https://www.youtube.com/watch?v=o7HQEG8k_NY) · [Watch on adport.dev](https://adport.dev/#video)

## What you can do

- **Report across ad accounts.** Use provider-native queries or normalized reports with explicit currencies and attribution limits.
- **Review campaign changes before applying them.** Inspect supported updates to campaigns, budgets, and status, then approve the exact operation.
- **Audit campaign performance.** Find wasted spend, low CTR, CPA outliers, and below-break-even ROAS. Review the evidence and track findings as open, dismissed, or applied.
- **Work in your terminal or AI agent.** The CLI, Model Context Protocol (MCP) server, and Cloud use the same provider modules, tool schemas, and policy checks.

## Local or Cloud

Run the open-source CLI and stdio MCP server on your own machine or infrastructure, or use Adport Cloud for a managed dashboard, provider connections, and team access. Available operations depend on the provider, your account permissions, and, in Cloud, your plan and project role.

| Area | Open-source CLI and MCP | Adport Cloud |
| --- | --- | --- |
| **Cost** | Free under the [Apache 2.0 license](LICENSE). You run and maintain the installation. | Free for read-only use. Paid plans add writes and higher limits. See [Cloud pricing](https://adport.dev/pricing). |
| **Getting started** | [Install `adport` with npm](#quick-start) and connect an account with `adport connect <provider>`. | Create an Adport account, connect a provider in the dashboard, and choose which accounts to enable for your project. |
| **Provider authorization** | [Supply your own provider application or API credentials](docs/providers.md). You handle any developer access or approval the platform requires. | Connect through Adport's configured OAuth apps where available. Some integrations, such as [OpenAI Ads](docs/providers/openai.md#connect-in-cloud), use an advertiser API key. Available connections depend on provider access and approval. |
| **Where you work** | Local CLI and [stdio MCP](#connect-an-ai-agent) in compatible clients such as Claude Code and Codex. | Dashboard, hosted REST API, CLI via the Cloud API, and [remote MCP](plugins/adport/README.md) for ChatGPT, Claude, Codex, and other compatible clients. |
| **Reporting and findings** | Account inventory, reports, and audit findings for the accounts your credentials can access. | Account inventory, reports, and findings for the accounts enabled in each project. Reporting is available on Free. |
| **Active ad accounts** | Account access follows your provider credentials and platform limits. | Free, Pro, Growth, and Business allow 3, 5, 20, and 60 active accounts respectively, shared across the organization. |
| **Projects and team access** | Credentials, settings, and logs belong to the local installation. Use a separate `ADPORT_HOME` directory for each local configuration. | Unlimited isolated projects and free read-only viewers. Pro, Growth, and Business include 2, 5, and 15 editing members respectively. [Roles and project access](docs/cloud/organizations-and-projects.md). |
| **Campaign changes** | Supported writes use your provider permissions and require a preview and approval. | Paid plans let authorized editors preview and apply supported changes with the same approval flow. |
| **Budget caps and protected accounts** | Configure safeguards in `policy.yaml`. | Manage safeguards per project in the dashboard. |
| **Credentials and data** | Provider calls go directly from your installation to the platform. Credentials live in a permission-restricted file or your environment. The local tools are telemetry-free. | Adport hosts project data and encrypts provider credentials in a project vault. See the [privacy policy](https://adport.dev/privacy). |
| **Approvals and audit history** | Pending approvals and append-only JSONL logs are stored locally. You manage retention and backups. | Pending approvals and audit events are stored by project. Audit events record who acted. Free, Pro, Growth, and Business retain 30, 90, 365, and 730 days respectively. |
| **Updates and support** | Install updates on your own schedule and use [GitHub community support](SUPPORT.md). | Adport operates and updates the service. Use [Cloud support](https://adport.dev/support) for account help. |

The Cloud application source is in [`apps/cloud`](apps/cloud). See [local Cloud development](docs/cloud/local-development.md), [hosted provider onboarding](docs/providers/cloud-onboarding.md), and the [deployment model](docs/cloud/deployment-model.md) for setup and architecture details.

## Quick start

Requires **Node.js 22.13 or newer**. CI tests Node.js 22 and 24.

```sh
npm install -g adport
adport --version
```

To use a real account, follow the [provider connection guide](docs/providers.md) to create your own provider application or obtain its required credentials, then connect:

```sh
adport connect google
adport doctor
adport accounts --provider google
adport report --provider google --metrics spend,clicks,conversions,roas --range last_7_days
```

The same `adport connect <provider>` flow supports all providers below. With no credentials, account and report calls return `NOT_CONNECTED`.

## Connect an AI agent

After installing the CLI and connecting a provider, add the local server to Claude Code:

```sh
claude mcp add adport -- adport mcp
```

For other clients that support stdio MCP, use:

```json
{
  "mcpServers": {
    "adport": {
      "command": "adport",
      "args": ["mcp"]
    }
  }
}
```

Start with a request such as “Report my campaign performance for the last seven days. Keep currencies separate.” For a change, ask “Preview pausing this campaign and show the before and after.”

The [hosted plugin](plugins/adport/README.md) uses Cloud OAuth and a remote endpoint. Its availability and provider permissions are separate from local MCP setup.

## Providers

The advertising providers below have local connection commands, normalized reports, and guarded write tools. Check the capability and setup guides for each provider's supported operations and live verification status.

| Provider | Connection ID | Capabilities and setup |
| --- | --- | --- |
| Google Ads | `google` | [GAQL, campaigns, ad groups, keywords, RSA copy/status, budgets, bidding](docs/providers.md#google-ads) |
| Meta Ads | `meta` | [Insights, ads, creatives/media, targeting, audiences, budgets, status](docs/providers.md#meta-ads) |
| TikTok Ads | `tiktok` | [Reports, campaigns, budgets, status, sandbox support](docs/providers.md#tiktok-ads) |
| Apple Ads | `apple` | [Campaigns, ad groups, keywords, creatives, reports](docs/providers.md#apple-ads) |
| Microsoft Advertising | `microsoft` | [Detailed reports, campaigns, ad groups, keywords/exclusions, RSAs, images/extensions, targeting, budgets, status](docs/providers.md#microsoft-advertising) |
| Reddit Ads | `reddit` | [Campaign children, creative/media, structured posts, targeting, reports](docs/reddit-campaign-setup.md) |
| Snapchat Ads | `snapchat` | [Campaign hierarchy, creative/media, targeting, audiences, measurement](docs/snapchat-campaign-setup.md) |
| Spotify Ads | `spotify` | [Reports, unpublished drafts, campaign status, ad-set delivery](docs/providers/spotify.md) |
| Pinterest Ads | `pinterest` | [Discovery, reports, campaigns, budgets, status](docs/providers/pinterest.md) |
| LinkedIn Ads | `linkedin` | [Campaigns/groups, targeting, bids, text creatives and image library](docs/providers/linkedin.md) |
| X Ads | `x` | [Campaigns, line items, targeting, draft creatives, cards/media and analytics](docs/providers/x.md) |
| OpenAI Ads | `openai` | [Ads in ChatGPT: reports, campaigns, ad groups, ads, status, spend limits](docs/providers/openai.md) |
| Gravity | `gravity` | [Ads in AI assistants, campaigns, ads, budgets, conversion tracking and reporting](docs/providers/gravity.md) |

Read-only analytics sources:

| Source | Connection ID | Capabilities and setup |
| --- | --- | --- |
| Google Analytics 4 | `ga4` | [Acquisition outcomes and conversion goals](docs/providers/google-analytics.md) |
| Google Search Console | `gsc` | [Search analytics, sitemaps, URL inspection](docs/providers/google-analytics.md) |
| Matomo | `matomo` | [Acquisition outcomes and conversion goals](docs/providers/matomo.md) |

Provider application approval, account access, and available metrics depend on the platform. The [connection guides](docs/providers.md) record prerequisites and testing limits. Reports preserve currency and attribution differences; see [reporting semantics](docs/reporting-semantics.md) before comparing providers.

## How write approval works

1. Call a write tool with the proposed arguments. The first call returns a preview, budget deltas, policy coercions, and a short-lived `pending_operation_id`.
2. Review the preview. Policy forces new campaigns to start paused and reports that adjustment in the preview.
3. Repeat the call with identical arguments and the pending ID to apply it.

The policy engine rejects changed arguments, expired approvals, protected accounts, and budget-cap violations. Applied provider changes go in an append-only audit trail. Recommendations use the same approval flow.

```sh
adport tools list
adport audit run
adport recommendations list
adport policy
adport audit show --limit 50
```

Local state lives under `${ADPORT_HOME:-~/.config/adport}`. The local tools store credentials in `credentials.json` with mode `0600` and read policy from `policy.yaml`. See the [write-safety contract](docs/write-safety.md) for the full behavior, including provider-side validation limits, and the [privacy policy](https://adport.dev/privacy) for Cloud data handling.

## Development

```sh
git clone https://github.com/ynnickw/adport.git
cd adport
corepack enable
pnpm install --frozen-lockfile
pnpm check
pnpm build
pnpm test
pnpm typecheck
```

The repository pins pnpm in `package.json`. Advertising credentials are unnecessary for the default build and tests. Optional database and HTTP integration checks are documented in the [Cloud development guide](docs/cloud/local-development.md).

| Path | Purpose |
| --- | --- |
| `packages/core` | Tool registry, policy engine, credentials, audit rules |
| `packages/{provider}` | Advertising platform adapters and wire-contract tests |
| `packages/cli`, `packages/mcp` | CLI and stdio MCP adapters |
| `apps/cloud` | Hosted dashboard, authorization, REST, remote MCP |
| `supabase` | Database migrations and tenant-isolation checks |
| `website`, `scripts` | Public site, generated pages, repository tooling |
| `plugins/adport` | Agent plugin manifests and skill |
| `docs` | User guides, operations, release and validation records |

See the [repository structure guide](docs/maintainers/repository-structure.md) for file ownership, generated assets, and directory conventions.

## Contributing and support

Bug fixes, documentation, provider tests, and practical feedback from advertisers are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md); commits require a DCO sign-off (`git commit -s`). The [release guide](docs/maintainers/releasing.md) explains versioning, verification, and publishing.

Use [GitHub issues](https://github.com/ynnickw/adport/issues/new/choose) for reproducible bugs and feature proposals. See [SUPPORT.md](SUPPORT.md) for help, [SECURITY.md](SECURITY.md) for private vulnerability reports, and the [Code of Conduct](CODE_OF_CONDUCT.md) for community expectations.

## License

[Apache License 2.0](LICENSE).