Configuration

AI

Configuration for AI Assistant and Model Context Protocol (MCP) features.
Environment Variables
Environment variables are configurable for Directus Enterprise Cloud projects via our Customer Success team. You can also set environment variables in self-hosted projects.

AI Assistant

VariableDescriptionDefault Value
AI_ENABLEDWhether AI Assistant features are available. Set to false to completely disable AI Assistant across the entire instance, hiding the sidebar for all users and disabling the settings for administrators.true
When AI_ENABLED is set to false:
  • The API routes for the assistant are not mounted
  • AI Assistant sidebar is hidden from all users
  • AI settings form displays a disabled notice
This is useful for compliance requirements where AI features must be completely hidden.

Model Context Protocol

VariableDescriptionDefault Value
MCP_ENABLEDWhether the Model Context Protocol server is available for system administrators to enable in project settings. Set to false to completely disable MCP functionality across the entire instance.true
When MCP_ENABLED is set to false, the MCP server cannot be enabled through Settings → AI → Model Context Protocol in the admin interface, providing system administrators with complete control over AI integration features. See the MCP Server guide for more information.

Model Context Protocol OAuth

MCP OAuth adds browser-based authorization for compatible MCP clients. Set MCP_OAUTH_ENABLED to true to mount the OAuth discovery, authorization, token, registration, and revocation routes.

Client registration modes are separately opt-in. Enable at least one registration mode with MCP_OAUTH_DCR_ENABLED=true for Dynamic Client Registration or MCP_OAUTH_CIMD_ENABLED=true for Client ID Metadata Document registration. Both the environment variable and project setting must allow a registration mode before Directus advertises or accepts it.

After enabling the environment variables, enable OAuth Enabled and at least one client registration mode in Settings > AI > Model Context Protocol for each project that should allow MCP OAuth.

The MCP OAuth authorization endpoint and Dynamic Client Registration endpoint use dedicated rate limiter pools. See Security & Limits for the RATE_LIMITER_MCP_OAUTH_AUTHORIZE_* and RATE_LIMITER_MCP_OAUTH_REGISTRATION_* variables.

VariableDescriptionDefault Value
MCP_OAUTH_ENABLEDWhether MCP OAuth routes are mounted. Set to true before enabling MCP OAuth in project settings.false
MCP_OAUTH_AUTH_CODE_TTLHow long an OAuth authorization code remains valid before the client exchanges it for tokens.60s
MCP_OAUTH_MAX_CLIENTSMaximum number of registered OAuth clients. Set to 0 to disable the limit.10000
MCP_OAUTH_CLIENT_UNUSED_TTLHow long an unused registered client can remain before cleanup removes it.24h
MCP_OAUTH_CLIENT_IDLE_TTLHow long an inactive registered client can remain after its last OAuth activity. Set to 0 to disable idle cleanup.0
MCP_OAUTH_REQUIRE_RESOURCEWhether authorization and refresh requests must explicitly include the MCP resource parameter.false
MCP_OAUTH_CLEANUP_SCHEDULECron schedule for removing expired authorization codes, expired OAuth grants, and stale clients.*/15 * * * *
MCP_OAUTH_ALLOWED_REDIRECT_DOMAINSComma-separated list of allowed redirect URI domains. Leave empty to allow any valid HTTPS redirect URI and loopback development URI.''
MCP_OAUTH_DCR_ENABLEDWhether Dynamic Client Registration can be enabled in project settings.false
MCP_OAUTH_CIMD_ENABLEDWhether Client ID Metadata Document registration can be enabled in project settings.false
MCP_OAUTH_CIMD_ALLOW_HTTPAllow http:// Client ID Metadata Document URLs. Keep disabled outside local development.false
MCP_OAUTH_CIMD_ALLOWED_DOMAINSComma-separated list of domains allowed to use Client ID Metadata Document registration. Leave empty to allow any valid metadata document domain.''
MCP_OAUTH_CIMD_BLOCKED_TLDSComma-separated list of top-level domains blocked for Client ID Metadata Document registration.test,localhost,invalid,example,local,onion
Read the MCP OAuth guide for setup steps, client registration behavior, and revocation.

Telemetry

Send AI Assistant traces to an external observability platform for monitoring usage, performance, and cost.

VariableDescriptionDefault Value
AI_TELEMETRY_ENABLEDEnable OpenTelemetry-based tracing for AI Assistant requests. User IDs and Role ID will be included in traces.false
AI_TELEMETRY_PROVIDERTelemetry provider to use. Supported values: langfuse, braintrust.langfuse
AI_TELEMETRY_RECORD_IOInclude full prompt inputs and response outputs in traces.false
Enabling AI_TELEMETRY_RECORD_IO will send the full content of user messages and AI responses to your telemetry provider. Only enable this if your telemetry provider meets your data privacy requirements.

Langfuse

Set AI_TELEMETRY_PROVIDER to langfuse (default).

VariableDescriptionDefault Value
LANGFUSE_SECRET_KEYLangfuse secret key.
LANGFUSE_PUBLIC_KEYLangfuse public key.
LANGFUSE_BASE_URLLangfuse API base URL.https://cloud.langfuse.com

Braintrust

Set AI_TELEMETRY_PROVIDER to braintrust.

VariableDescriptionDefault Value
BRAINTRUST_API_KEYBraintrust API key.
BRAINTRUST_PROJECT_NAMEBraintrust project name for grouping traces.
BRAINTRUST_API_URLBraintrust API URL. Only needed for self-hosted instances.

Get once-a-month release notes & real‑world code tips...no fluff. 🐰