Skip to content
Platform & Configuration
MCP Gateway

MCP gateway

The Astralis MCP gateway lets AI agents work with Astralis through the Model Context Protocol (opens in a new tab) — with every call authorized as the signed-in user. An agent connected through the gateway can do exactly what its user can do in Astralis, and nothing more: calls run under the user's own role-based access control, and the gateway tells the agent which scopes an operation requires so denied requests come back actionable instead of opaque.

Astralis hosts the complete OAuth 2.1 authorization flow itself — discovery, dynamic client registration, PKCE, refresh tokens, and revocation — so connecting an MCP client requires no API keys, no service tokens, and no configuration files containing credentials. Users sign in through a browser, with single sign-on or with a password, under the same login policy as the Astralis Admin UI.

Enable the gateway

The gateway is disabled by default. Enable it on the Astralis server:

Environment variableDescription
FIDESPLUS__MCP_GATEWAY__ENABLEDSet to True to mount the gateway at /mcp.
FIDESPLUS__MCP_GATEWAY__ISSUER_URLThe externally reachable origin MCP clients redirect to during sign-in. Defaults to the Astralis server URL; set it only when the public origin differs from the internal one — for example, behind Docker or a reverse proxy.
FIDESPLUS__MCP_GATEWAY__ALLOWED_REDIRECT_URISA JSON list of exact OAuth redirect URIs that MCP clients may register in addition to the ones accepted by default. Empty by default. See Choose which MCP clients can register.

The gateway serves MCP over streamable HTTP at https://<your-fides-host>/mcp/.

Connect an MCP client

Add Astralis to any MCP client that supports streamable HTTP and OAuth. For Claude Code (opens in a new tab):

claude mcp add --transport http fides https://<your-fides-host>/mcp/

No tokens or auth flags are needed. On first connection the client discovers the Astralis authorization server, registers itself, and opens a browser window to the Astralis sign-in page. Sign in with one of your identity providers or with your Astralis username and password, and the client completes the flow automatically. Tokens refresh silently for the life of the session.

The sign-in page names the client that is asking for access, the host it will send the result to, its client ID, and when it registered. Check that the host is the client you are connecting before you sign in.

Use HTTPS for all deployed instances. OAuth 2.1 requires it; plain HTTP is permitted only for localhost development.

Choose which MCP clients can register

Any MCP client can register itself with the gateway, so the redirect URI it registers decides where a user's sign-in result is sent. By default, the gateway accepts only redirect URIs on the user's own device (RFC 8252 (opens in a new tab)):

Accepted by defaultExample
A loopback address, on any porthttp://127.0.0.1:33418/callback, http://localhost:8765/callback, http://[::1]:8765/callback
A private-use scheme named after a domain in reverse ordercom.example.app:/oauth/callback

Locally installed clients such as Claude Code use a loopback address and work without configuration.

The gateway refuses every other redirect URI, including:

  • The HTTPS callback of a remotely hosted client, such as https://client.example/oauth/callback.
  • A custom scheme without a dot, such as cursor:// or vscode://.
  • A URI that contains a backslash, whitespace, or a control character, or a loopback URI with credentials before the host.

To allow a client the defaults refuse, list its exact redirect URI:

FIDESPLUS__MCP_GATEWAY__ALLOWED_REDIRECT_URIS='["https://client.example/oauth/callback"]'

The match is exact: the scheme, host, port, and path must all equal a listed entry. There is no prefix or wildcard matching.

⚠️

A client registered before Astralis 3.2.2 whose redirect URI is not accepted is treated as unregistered. It must be added to the list, or register again with an accepted redirect URI.

Sign in with SSO

When your Astralis server has an SSO provider configured, the gateway sign-in page shows a button for each identity provider. Users are matched to their Astralis account the same way as when they sign in to the Admin UI with SSO.

Register the gateway callback with your identity provider

The gateway sends identity providers a redirect URI of <issuer URL>/oauth/sso/callback, where <issuer URL> is FIDESPLUS__MCP_GATEWAY__ISSUER_URL or, when that is unset, the Astralis server URL. Register this URI with each identity provider, in addition to the Admin UI redirect URI:

https://<your-fides-host>/oauth/sso/callback

Password sign-in under SSO

Once an SSO provider is configured, the gateway's password form follows the same policy as the Admin UI. A password sign-in is refused unless username and password login is allowed and the account has password login enabled. The root user needs only the first condition. A refused sign-in shows the same message as the Admin UI and keeps the SSO buttons on the page.

Work with the Astralis API

The gateway exposes the entire Astralis REST API through three meta-tools, so agents discover operations on demand instead of loading hundreds of tool definitions:

ToolPurpose
api_searchFind operations by keyword. Returns each match's operation_id, method, path, parameters, and the OAuth scopes it requires.
api_describeGet one operation's full schema — path and query parameters, request body, response shape — plus its required_scopes and a plain-language access note.
api_callInvoke an operation. The call runs as the signed-in user under Astralis RBAC.

An agent works through them progressively: search for the operation, describe it to learn the inputs and required scopes, then call it.

Permission guidance on denied calls

When a call fails authorization, the gateway attaches the exact scopes the user is missing:

{
  "status_code": 403,
  "body": { "detail": "Not Authorized for this action. Required scope(s): [data_category:create]" },
  "access_denied": {
    "required_scopes": ["data_category:create"],
    "guidance": "This call runs as you, under Fides RBAC. Your token must carry the scope(s) ['data_category:create'] — directly or via an assigned role. Missing them yields a 403; ask an admin to grant a role that includes these scopes."
  }
}

The agent relays this to the user, who knows immediately which role or scope grant to request — no log diving required.

Operations the gateway never exposes

The gateway removes sensitive operations from the meta-tools entirely, so an agent can neither discover them through api_search nor invoke them through api_call — regardless of the signed-in user's permissions. This is defense in depth: RBAC already governs every call, but some data and actions should never pass through an AI agent's context or be triggered by one. An attempt to call an excluded operation returns an "Unknown operation_id" error.

The excluded operations fall into three groups.

Data-subject personal data. The gateway never exposes routes that return or accept the personal data of data subjects:

ExcludedExamples
Privacy (DSR) requestsRequest results, search, attachments, comments, correspondence, access packages
Consent and preferencesConsent requests, current and historical privacy preferences, consent reporting exports
Data Rights Protocol (DRP)Subject request exercise, status, and revocation
Manual data entryManual fields and manual-webhook data entered by DSR operators
External subjectsExternal-user creation and subject one-time-password login

Personal account records and authentication. The gateway never exposes routes that return staff account details or drive authentication:

ExcludedExamples
User recordsListing, reading, creating, updating, and deleting users; invites; system-manager assignments
AuthenticationLogin, logout, password reset, and email verification

Role-based access control administration remains available — roles, permissions, constraints, and role assignments are managed through separate endpoints that the gateway does expose.

Credentials. The gateway never exposes routes that read or write secret values:

ExcludedExamples
Messaging credentialsEmail and SMS provider secrets, and endpoints that send a real test message
Integration credentialsConnection secret values, including system-scoped connection secrets

Read-only configuration remains available: messaging configuration and templates, and the connector-type secret schema (the field names a connector requires, never their values), stay discoverable.

Sessions and tokens

Every token the gateway issues belongs to a session that starts when the user signs in:

  • Access tokens expire after 60 minutes, at the gateway and on the Astralis API. Clients rotate to a fresh token automatically using their refresh token, so live sessions are uninterrupted.
  • A session lasts at most 14 days from sign-in. Refreshing never extends it. After 14 days the user signs in again.
  • Every refresh re-checks the user. The session ends when the user is deleted or disabled, loses all roles, or has their password reset after signing in. It also ends when the login policy no longer allows that sign-in method, or when an SSO user is no longer linked to the identity provider they signed in with. A root user's session ends when the root credentials change.
  • Revocation ends the session everywhere. A client that revokes its access token or its refresh token (RFC 7009 (opens in a new tab)) ends the session, and its access token stops working on the Astralis API immediately.

After upgrading to Astralis 3.2.2, every MCP client signs in once, because sessions started on an earlier version cannot be refreshed.

To switch Astralis accounts in an MCP client, clear the client's stored authentication and reconnect — the browser sign-in runs again for the new user.