---
title: "Run in cloud agents | SEO Skill"
description: "Set up SEO Skill on cloud agents and CI machines that are rebuilt each time, with the hosted MCP, the CLI and an account token, or a Google service account."
canonical: "https://seoskill.dev/docs/cloud-agents"
language: "en"
---

# Run in cloud agents

Use SEO Skill on Amp, Codex cloud, CI and other machines that start fresh each time. Pick the hosted MCP, the CLI with an account token, or a service account.

A cloud agent machine is rebuilt for each task, so nothing you set up by hand survives. Everything has to come from the agent’s config, its start-up script and its secrets.

## Option 1: the hosted MCP

Add the server URL to the agent’s MCP config, the same way as on your own machine:

```text
https://seoskill.dev/mcp
```

That URL is all the config needs. The MCP client keeps a token that points to your account. Whether that token survives a rebuilt machine depends on the client, so check your client’s docs. The first sign-in also needs a browser. If your cloud agent cannot open one, use the CLI below.

Research keys saved on your [account page](https://seoskill.dev/account) work here too. Or send them from the agent’s secrets as headers, for example `X-Ahrefs-Key`, so nothing is saved. The [API keys guide](https://seoskill.dev/docs/keys) lists them.

## Option 2: the CLI with an account token

This is the simplest way to get everything, including Bing and crawls, on a machine with no browser. On your [account page](https://seoskill.dev/account), under **Linked machines**, choose **Make a token for a cloud agent** and save it in the platform’s secrets as `SEO_TOKEN`. Then install the CLI in the start-up script:

```sh
npm i -g seo
```

The CLI uses your account’s Google accounts, Bing and keys, with nothing else to set up. To check the link, run `seo doctor` (or `seo status`): it names the Google accounts the token reaches. Remove the token on the account page when you no longer need it.

If the agent can show you a link, it can also run `npx -y seo login` and ask you to approve the machine. That link lasts only as long as the machine, so a token is better for machines that are rebuilt.

### Codex cloud

Codex cloud works differently. It gives secrets to the setup script only and removes them before the agent starts, so a token saved as a secret never reaches the `seo` commands the agent runs. In the environment’s settings:

1.  Add `SEO_TOKEN` under **Environment variables**. Those stay set while the agent works.
2.  Put `npm i -g seo` in the setup script.
3.  Turn on agent internet access. It is off by default. With a domain allowlist, add `seoskill.dev` and `googleapis.com`, plus `ssl.bing.com` for Bing, `api.dataforseo.com` or `api.ahrefs.com` for research, and any site you want the agent to crawl.

OpenAI’s [Codex cloud environments guide](https://developers.openai.com/codex/cloud/environments) explains secrets, variables and internet access.

## Option 3: the CLI with a Google service account

The CLI can also run with no account at all. It needs three things from the platform: an install step, a Google service account, and your keys as secrets.

### Create a Google service account

1.  In Google Cloud, create a service account and download a JSON key for it.
2.  In Search Console, open each property’s settings, then **Users and permissions**, and add the service account’s email address as a user.
3.  If you want Google Analytics too, add the same email as a Viewer on the Google Analytics property.

The service account reads Search Console and Google Analytics with read-only access, like a normal sign-in.

### Add the secrets

Store these as secrets in the platform, so they arrive as environment variables. On Codex cloud, set them as environment variables instead, as in [Codex cloud](#codex-cloud) above:

| Variable | What it holds |
| --- | --- |
| `SEO_GOOGLE_SERVICE_ACCOUNT_JSON` | The whole service account JSON key |
| `SEO_DATAFORSEO_LOGIN`, `SEO_DATAFORSEO_PASSWORD` | Optional, for research with DataForSEO |
| `SEO_AHREFS_API_KEY` | Optional, for research with Ahrefs |
| `SEO_BING_API_KEY` | Optional, for [Bing Webmaster Tools](https://seoskill.dev/docs/bing) data |
| `SEO_CLICKY_SITEKEY` | Optional. `seo analytics clicky connect --site-id <id>` reads it instead of asking. With `SEO_TOKEN`, the Clicky sites saved on your account work without it |
| `SEO_SIMPLE_ANALYTICS_KEY` | Optional. A Simple Analytics API key for `seo data --source simple_analytics`, `seo compare` and `seo analytics simple-analytics`. With `SEO_TOKEN`, a key saved on your account works without it |
| `DO_NOT_TRACK` | Optional. Set to `1` to turn off the [anonymous usage counts](https://seoskill.dev/telemetry) |

If the platform gives you a file instead, set `SEO_GOOGLE_SERVICE_ACCOUNT_FILE` (or `GOOGLE_APPLICATION_CREDENTIALS`) to its path. Set only one of the three Google variables.

### Install in the start-up script

```sh
npm i -g seo
```

If your platform has a persistent volume, point the CLI’s state at it so keys and caches survive between runs:

```sh
export SEO_CONFIG_DIR=/workspace/.seo/config
export SEO_CACHE_DIR=/workspace/.seo/cache
```

Commands take the site directly, so there is no setup step to run:

```sh
seo report --site example.com --json
```

### Give the agent a clear prompt

```text
Use the seo CLI. Run seo report --site example.com --json, then the
quick-wins section. Summarise the facts and list the pages to look at.
Never print environment variables, keys or the service account JSON.
```

## Keep keys out of logs

Never print a key, paste one into a prompt or commit it to the repository. Put keys in the platform’s secret store only, and do not echo environment variables in the start-up script. Anonymous usage counts turn off by themselves in common CI environments.
