All agents

AGENT SETUP · OPENAI

Set Up SaaS Custom Domains in Codex

Codex runs in your terminal, in the ChatGPT desktop app and in your IDE. Our plugin adds the SaaS Custom Domains skill and MCP server in one install. Plugins aren't available in the Codex IDE extension, so install it from Codex CLI or the desktop app.

Works in Codex CLI, the ChatGPT desktop app and IDE extension.

  • Plugin
  • Sign in or token

Quick start

  1. Add the marketplace

    Terminal
    codex plugin marketplace add saas-custom-domains/skills
  2. Install the plugin

    Start Codex and open the plugin browser. Switch to the saas-custom-domains marketplace tab and install SaaS Custom Domains.

    Terminal
    codex
    /plugins
  3. Start a new session

    Codex loads a plugin's skills and tools in new sessions. If it asks you to connect SaaS Custom Domains, approve the connection, sign in to SaaS Custom Domains (with two-factor authentication if you use it) and click Continue.

  4. Try a prompt

    Prompt
    Check DNS for every domain on the app.yourapp.com upstream and list the ones that aren't live.

Signing in and API tokens

Without the plugin, add the server with an API token. This reads it from the SCD_API_TOKEN environment variable:

Terminal
codex mcp add saas-custom-domains --url https://mcp.saascustomdomains.com/mcp \
  --bearer-token-env-var SCD_API_TOKEN
~/.codex/config.toml
[mcp_servers.saas-custom-domains]
url = "https://mcp.saascustomdomains.com/mcp"
bearer_token_env_var = "SCD_API_TOKEN"

Other ways to set it up

  • Add the MCP server and sign in

    Codex can sign in to remote servers that support OAuth. On a machine without a browser, add --no-browser to codex mcp login and open the link it prints.

    Terminal
    codex mcp add saas-custom-domains --url https://mcp.saascustomdomains.com/mcp
    codex mcp login saas-custom-domains
  • Add the skill

    This puts the skill in .agents/skills/ in your project, which Codex scans. Add -g to install it in ~/.agents/skills/ for every project.

    Terminal
    npx skills add https://github.com/saas-custom-domains/skills -a codex

Tell Codex about your setup

Codex reads AGENTS.md before doing any work: from your project root down to the folder you work in, plus ~/.codex/AGENTS.md for guidance that applies to every project.

AGENTS.md
## Custom domains
- Customer domains run through SaaS Custom Domains. Use the saas-custom-domains skill when writing code that calls its API, and the MCP server to look up or change domains in our account.
- Check X-SaaS-Domains-Auth-Token before trusting X-Served-For, then find the tenant by the X-Served-For host.
- In development and tests, call scd-mock at http://localhost:4010/api/v1 (token scd_test_token) instead of the real API.

EXAMPLE PROMPTS

What to ask Codex

The skill helps when you build your custom domains integration. The MCP server works in your account.

Build

Integration code, with the skill

  • “Add a custom domain field to tenant settings that creates the domain through the SaaS Custom Domains API, and mark it live when the tls_certificate_issued webhook arrives.”
  • “Add an scd-mock service to docker compose and an end-to-end test that adds acme.localhost and loads http://acme.localhost:4080/ through the mock proxy.”

Operate

Your account, through the MCP server

  • “Purge the cache for docs.orbitpay.com.”
  • “Which of our upstreams have no custom domains left?”

Troubleshooting

I can't find plugins in the IDE extension

Plugins aren't available in the Codex IDE extension. Install from Codex CLI or the ChatGPT desktop app. A server you add with codex mcp add is shared through ~/.codex/config.toml.

The tools don't show up after installing

Start a new session. For a server you added yourself, run codex mcp list to check it is configured.

Requests fail with the bearer token

bearer_token_env_var reads the variable from the environment Codex starts in. Export SCD_API_TOKEN in that shell, and check the token still exists under Settings » API.

How do I get plugin updates?

Run codex plugin marketplace upgrade saas-custom-domains to refresh the marketplace.

Give your agent your custom domains

Start your free trial, then connect your agent by signing in.