> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adstellar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Connect an MCP client to AdStellar in a few minutes.

## ChatGPT (plugin, OAuth)

AdStellar is listed in the ChatGPT plugin directory.

1. Open [AdStellar in ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac0b6df2c148191992b3a4334f2f833) and choose **Connect**.
2. ChatGPT sends you to the AdStellar consent screen. Pick the team, workspaces, and scopes to grant.
3. Start a new chat and mention **@AdStellar**, or just ask: "How did my campaigns perform over the last 7 days?"

Prefer to add it by URL? In ChatGPT open **Settings → Security and login**, turn on **Developer mode**, then go to **Plugins**, press **+**, and enter `https://app.adstellar.ai/api/mcp` as the MCP server URL.

Tools that change data (image and video generation, launch drafts) are labelled so ChatGPT confirms before calling them. Nothing in the plugin publishes ads; launching stays in the AdStellar dashboard.

## Claude (connector, OAuth)

AdStellar is listed in the Claude Connectors directory: open **Customize > Connectors** in Claude, search for **AdStellar**, and connect. The connector URL is `https://app.adstellar.ai/api/mcp/claude`; it carries every tool except AI image and video generation and automation rules. See [Use AdStellar in Claude](https://docs.adstellar.ai/api-mcp/claude.md) for the walkthrough, example prompts and Claude Code setup.

## Claude Desktop (full server, OAuth)

To reach the full tool surface, including creative generation, add AdStellar to your `claude_desktop_config.json` with no key at all:

```json theme={null}
{
  "mcpServers": {
    "adstellar": {
      "url": "https://app.adstellar.ai/api/mcp"
    }
  }
}
```

On first use the client registers itself, opens the AdStellar consent screen in your browser, and you pick the team + scopes to grant. Tokens refresh automatically.

## API key (for your own agents)

Create a key in Settings → Developers (or via `POST /api/settings/api-keys`), then:

```json theme={null}
{
  "mcpServers": {
    "adstellar": {
      "url": "https://app.adstellar.ai/api/mcp",
      "headers": {
        "Authorization": "Bearer ast_live_YOUR_KEY"
      }
    }
  }
}
```

Restart the client. You should see AdStellar's tools — try:

> "What's my current credit balance and which ad accounts are connected?"

> "Generate 5 headline variants for my default brand kit, bold tone, goal: drive trial signups."

> "Generate a 9:16 image ad for my product, 2 variations" — then "check the status of batch \<id>"

> "How did my campaigns perform over the last 7 days, grouped by campaign?"

> "Pause every ad set with a CPA over \$40 this week, and show me the list first."

> "Build a sales campaign for my main product at \$50/day and walk me through the preview before launching."

> "Whenever a campaign spends $50 with a CPA above $40 over 7 days, suggest pausing it."

## REST API

Every MCP tool is also a REST endpoint — `POST /api/v1/tools/{toolName}` with the same bearer credential:

```bash theme={null}
curl -X POST https://app.adstellar.ai/api/v1/tools/get_credit_balance \
  -H "Authorization: Bearer ast_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

The full spec lives at the [API Reference](https://docs.adstellar.ai/api-reference) tab (or `GET /api/v1/openapi.json`).

## Raw JSON-RPC (for debugging)

```bash theme={null}
# Discover tools
curl -X POST https://app.adstellar.ai/api/mcp \
  -H "Authorization: Bearer ast_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

# Call a tool
curl -X POST https://app.adstellar.ai/api/mcp \
  -H "Authorization: Bearer ast_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": { "name": "get_credit_balance", "arguments": {} }
  }'
```

Supported methods: `initialize`, `ping`, `tools/list`, `tools/call` (single or batched). The server is stateless — every POST is self-contained.

## Building your own agent

1. Create a key with only the scopes your agent needs.
2. On startup, call `tools/list` to discover the tools visible to that key.
3. Call `get_team_info` to confirm which team you're acting on.
4. Use `list_models` before any generation call so you can pass an explicit `model` id (or omit it for the default router).
5. Generation is async: call `generate_image`/`generate_video`, then poll `get_generation_status` until `complete: true`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.