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:
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 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 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, 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:
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:
- Add
SEO_TOKENunder Environment variables. Those stay set while the agent works. - Put
npm i -g seoin the setup script. - Turn on agent internet access. It is off by default. With a domain allowlist, add
seoskill.devandgoogleapis.com, plusssl.bing.comfor Bing,api.dataforseo.comorapi.ahrefs.comfor research, and any site you want the agent to crawl.
OpenAI’s Codex cloud environments guide 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
- In Google Cloud, create a service account and download a JSON key for it.
- In Search Console, open each property’s settings, then Users and permissions, and add the service account’s email address as a user.
- 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 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 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 |
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
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:
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:
seo report --site example.com --json
Give the agent a clear prompt
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.