All agents

AGENT SETUP · ANTHROPIC

Set Up SaaS Custom Domains in Claude Code

Claude Code runs in your terminal, in VS Code and JetBrains, and in the Claude desktop app. One plugin gives it the SaaS Custom Domains skill, so it writes correct integration code, and connects our MCP server, so it can add domains and check DNS in your account. You sign in with your SaaS Custom Domains account, so there's no token to copy.

Works in Terminal, VS Code, JetBrains and the Claude desktop app.

  • Plugin
  • Sign in

Quick start

  1. Add the marketplace and install the plugin

    In a Claude Code session, run these one at a time. /plugin install opens the plugin panel so you can review the plugin and choose a scope before it installs.

    Claude Code
    /plugin marketplace add saas-custom-domains/skills
    /plugin install saas-custom-domains@saas-custom-domains

    Prefer your shell, or setting up from a script? The same steps work outside a session:

    Terminal
    claude plugin marketplace add saas-custom-domains/skills
    claude plugin install saas-custom-domains@saas-custom-domains
  2. Sign in

    Run /mcp, pick the SaaS Custom Domains server and choose Authenticate. Your browser opens: approve the connection, sign in to SaaS Custom Domains (with two-factor authentication if you use it) and click Continue.

  3. Try a prompt

    Claude Code loads the skill when you work on integration code, and calls the MCP tools when you ask about your account.

    Prompt
    Add portal.acme.com to our app.yourapp.com upstream and draft an email to Acme with the DNS records they need.

Signing in and API tokens

Signing in creates an API token for Claude Code under Settings » API. Delete it there to disconnect; Claude Code then asks you to sign in again.

To use an API token instead of signing in, add the server yourself with the token in a header:

Terminal
claude mcp add --transport http saas-custom-domains https://mcp.saascustomdomains.com/mcp \
  --header "Authorization: Bearer YOUR_API_TOKEN" --scope user

Other ways to set it up

  • Add the MCP server

    --scope user makes it available in every project. Leave it out to add it to the current project only. Then run /mcp and choose Authenticate, or run claude mcp login saas-custom-domains in your shell.

    Terminal
    claude mcp add --transport http saas-custom-domains https://mcp.saascustomdomains.com/mcp --scope user
  • Add the skill

    This puts the skill in .claude/skills/ in your project. Add -g to install it in ~/.claude/skills/ for every project.

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

Tell Claude Code about your setup

Claude Code reads CLAUDE.md at the start of every session: ./CLAUDE.md for the project (commit it so your team gets it too) or ~/.claude/CLAUDE.md for you in every project. If your repository uses AGENTS.md, Claude Code can read that instead.

CLAUDE.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 Claude Code

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

Build

Integration code, with the skill

  • “Add custom domains to this app: an endpoint that adds a tenant's domain through the SaaS Custom Domains API, and a settings page that shows the DNS records they need.”
  • “Write middleware that checks X-SaaS-Domains-Auth-Token and finds the tenant from X-Served-For, with tests that run against scd-mock.”

Operate

Your account, through the MCP server

  • “List the custom domains that still need DNS records, grouped by upstream.”
  • “Why isn't shop.northpeak.com live yet? Check its DNS now.”

Troubleshooting

/plugin says it isn't available in this environment

/plugin only works in interactive sessions, not in claude -p. Install from your shell with claude plugin marketplace add and claude plugin install. Plugins you already installed still load.

The plugin installed, but its tools don't show up

Run /reload-plugins to load it in the current session, or start a new one.

The server shows that it needs authentication

Open /mcp, pick the server and choose Authenticate or Re-authenticate. This also happens after you delete its token under Settings » API.

claude -p can't use the tools

Non-interactive runs can't open the sign-in page. Sign in once from /mcp in an interactive session, or run claude mcp login <name> in your shell.

A server with an Authorization header fails to connect

When the server rejects a header, Claude Code reports the connection as failed instead of falling back to signing in. Check the token under Settings » API, or remove the header and sign in.

How do I get plugin updates?

Run /plugin marketplace update saas-custom-domains. Claude Code doesn't update third-party marketplaces on its own.

Give your agent your custom domains

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