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

# Connect MCP and CLI clients

> Configure a remote assistant or terminal client and verify a read before scheduling work.

Use MCP for clients that discover tools and the CLI for shell commands. Their credentials carry your [AutoAdy access](/developers/authentication); setup is complete only after a verified tool result.

## MCP server

The remote endpoint is:

```text theme={null}
https://www.autoady.io/api/mcp
```

OAuth-capable clients use account sign-in through OAuth 2.1. Follow [Connect your own agent](/agent/connect) for the built-in recipes and Claude setup. Sign in with the intended identity and verify `list_ad_accounts` before allowing management tools.

For clients that launch a local stdio server, use the published wrapper with a private API-key environment:

```json theme={null}
{
  "mcpServers": {
    "autoady": {
      "command": "npx",
      "args": ["-y", "@autoady/mcp-server"],
      "env": { "AUTOADY_API_KEY": "adk_YOUR_KEY" }
    }
  }
}
```

Replace the placeholder privately and follow the client's configuration-file instructions. Do not commit a file containing the real key.

MCP offers a wider tool catalog than REST. Discover it with `tools/list` and follow each returned input schema. Tool failures can be JSON-RPC results with `isError: true`, even when the transport request succeeded. Inspect `content` and any `structuredContent`; do not assume every result contains a structured block. Raw numeric reporting data, when supplied, carries its currency and applied window.

For recurring reporting, check `get_connected_account` before interpreting old performance as proof of current delivery. Use explicit `account_id` and the date arguments accepted by each tool. Configure schedules in your own runner, or use [AutoAdy scheduled tasks](/automation/scheduled-tasks) for supported read/report work. Scheduling does not unlock blocked ad writes.

## Command line

The CLI requires Node.js 18 or later. Store `AUTOADY_API_KEY` in your private environment, then run:

```bash theme={null}
npx -y @autoady/cli accounts
```

For a persistent local command:

```bash theme={null}
npm install -g @autoady/cli
autoady results --account act_1234567890 --date-preset last_7d
```

Use a returned account ID in place of the example. A `--key` flag exists, but an environment credential avoids placing the secret in command history and process arguments.

| Command | Result |
| - | - |
| `accounts` | Reachable Meta accounts |
| `results` | Performance for a reporting window |
| `health` | Account health and components |
| `benchmarks` | Industry benchmark data |
| `compare` | Your metrics compared with a benchmark |
| `fatigue` | A fatigue calculation from supplied numbers |
| `fatigue-alerts` | Account creative-fatigue observations |
| `ad-copy`, `hooks` | Paid-plan text generation |
| `call` | A tool call with a JSON object |

Use `--help` for the installed version's flags. For raw input, `--json-body` supplies the request; `--json` controls the output format:

```bash theme={null}
autoady call get-skill --json-body '{"slug":"audit"}' --json
autoady call winner-insights --json-body '{"account_id":"act_1234567890"}' --json
```

The installed CLI has a known-tool manifest. If a newly published REST endpoint is rejected as an unknown tool, check the package version or call that endpoint directly over [REST](/developers/requests).

## Exit codes and automation

| Code | Meaning |
| - | - |
| 0 | The CLI accepted the HTTP response. Inspect the returned operation state, particularly HTTP 207 partial writes. |
| 1 | API rejection, request limit, network failure, or unexpected response. |
| 2 | Usage or authentication error, such as an unknown command, invalid flag, or missing/invalid key. |

Output goes to stdout; diagnostics go to stderr. `--json` returns the response envelope for structured processing. A zero exit code alone is insufficient evidence that every step of a write completed. Follow [response and retry handling](/developers/requests) before automating mutations.


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