Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.complyhat.ai/llms.txt

Use this file to discover all available pages before exploring further.

ComplyHat authenticates every request with OAuth 2.1. You never create an OAuth app or manage client credentials by hand — your MCP host registers itself automatically using Dynamic Client Registration (RFC 7591), and you only see the consent screen where you sign in and approve access.

How the flow works

When you make your first ComplyHat tool call, your host runs through this sequence before returning results:
1

Your host discovers the authorization server

The host fetches https://complyhat.ai/.well-known/oauth-protected-resource (RFC 9728) to learn which authorization server protects ComplyHat and which scopes it accepts.
2

Your host fetches authorization server metadata

The discovery document points to Supabase Auth. Your host fetches /.well-known/oauth-authorization-server on the Supabase domain to find the registration, authorization, and token endpoints.
3

Your host registers itself

The host POSTs to the registration endpoint and receives a client_id. This is Dynamic Client Registration — there is no portal where you create an OAuth app by hand. Each MCP host registers itself the first time.
4

You complete the consent screen

Your host opens a browser to https://complyhat.ai/oauth/consent. You sign in if you haven’t already, select your organization, and approve the requested scopes. This is the only step that requires your attention.
5

Your host exchanges the code and calls ComplyHat

The host exchanges the authorization code for a bearer access token, then calls https://complyhat.ai/api/mcp with Authorization: Bearer <token>. ComplyHat verifies the token’s signature, issuer, audience, and client_id on every request. Subsequent calls reuse the same token until it expires, at which point the host refreshes it silently.

Supported scopes

ComplyHat advertises the following scopes in its Protected Resource Metadata document. Your host requests the subset it needs; ComplyHat enforces the scope on every tool call.
ScopeWhat it grants
mcpCatch-all scope required by some hosts that don’t parse fine-grained scopes.
models:readList and inspect registered models.
models:writeRegister and update models.
bias-test:readList bias tests, schedules, and results.
bias-test:writeRun bias tests and create schedules.
drift:readRead drift monitors, snapshots, and alerts.
drift:writeCreate monitors and submit snapshots.
adversarial:readList and inspect adversarial findings.
adversarial:writeSubmit adversarial findings.
explainability:readList explainability runs and read results.
explainability:writeTrigger explainability runs.
audit:readRead the audit event log.
audit:writeEmit audit events.
kg:readRead the per-tenant compliance wiki.
kg:writeWrite to the per-tenant compliance wiki.
frameworks:readRead framework status, gaps, and obligations.

What a 401 error looks like

If a request to /api/mcp is missing a bearer token or carries an invalid one, ComplyHat returns 401 Unauthorized with a WWW-Authenticate header per RFC 6750:
WWW-Authenticate: Bearer realm="ComplyHat", error="invalid_token", resource_metadata="https://complyhat.ai/.well-known/oauth-protected-resource"
MCP hosts that follow the spec read the resource_metadata URL, re-discover the authorization server, and re-run the flow above without any action from you.

Manual flow for development

This section is for tooling authors and integration tests. If you’re using a standard MCP host, let the client library handle OAuth — don’t implement this by hand.
curl https://complyhat.ai/.well-known/oauth-protected-resource