MCP authentication

Two ways to authenticate — Clerk OAuth or an API key.

The MCP server accepts two token types on the same Authorization: Bearer ... header. The server picks the right verifier from the token shape — you don’t.

For interactive use. Most MCP clients trigger this flow automatically the first time they call the server: a browser tab opens, you sign into your DomainGenius account, pick the org, and approve the requested scopes. The client stores the resulting access token.

When the token expires, the client silently refreshes it. Revoke a session at /dashboard/sessions.

Option 2: API key

For headless use, CI, or when your client doesn’t support OAuth. Mint a key at /dashboard/api-keys, add it to the client config:

json
{
  "headers": {
    "Authorization": "Bearer dg_live_..."
  }
}

The exact JSON shape varies by client — see the install pages.

API keys carry per-key scopes. OAuth sessions get the default agent scope set:

ScopeGranted to OAuthGranted to keys
availability:readyesonly if minted with it
orgs:read, orgs:writeyesonly if minted
domains:read, domains:writeyesonly if minted
dns:read, dns:writeyesonly if minted
contacts:read, contacts:writeyesonly if minted
billing:read, billing:writeno — must use a keyonly if minted

Billing actions are deliberately out-of-scope for OAuth — top-ups go through the dashboard or a key, not the assistant.

Failures

json
{ "error": { "code": -32001, "message": "Missing scope: dns:write" } }

Code -32001 is auth-related (missing or revoked token, missing scope, missing org membership). Mint a wider key or sign in to a different org.

Last updated Edit this page
↑↓ navigate open esc close