Configuration reference

August 1, 2026 · View on GitHub

English | 简体中文

The authoritative exhaustive example is .env.example. This guide groups the operationally important settings and explains their boundaries. Defaults and validation in doris_mcp_server/utils/config.py remain the runtime source of truth.

Precedence and invariants

  • Supported CLI flags override corresponding environment defaults.
  • Environment values are normalized and validated before startup.
  • The installed package controls server_version; SERVER_VERSION cannot override product identity.
  • Exposure mode, authentication shape, providers, and worker model are startup choices—not per-request switches.
  • Invalid security combinations fail before serving traffic.
  • Never place real secret values in checked-in .env, Compose, or docs files.

Doris route

VariablePurpose
DORIS_HOSTprimary FE MySQL hostname
DORIS_HOSTSordered host:port FE MySQL candidates
DORIS_PORTFE MySQL port, normally 9030
DORIS_USERglobal/service Doris account
DORIS_PASSWORDglobal/service Doris password
DORIS_DATABASEdefault database, commonly information_schema
DORIS_FE_HTTP_HOSTFE HTTP host; empty may reuse DORIS_HOST
DORIS_FE_HTTP_HOSTSordered FE HTTP candidates
DORIS_FE_HTTP_PORTFE HTTP port, normally 8030
DORIS_BE_HOSTSexplicit BE HTTP allowlist
DORIS_BE_WEBSERVER_PORTBE HTTP port, normally 8040

HTTP safety:

VariablePurpose
DORIS_HTTP_CONNECT_TIMEOUT_SECONDSFE/BE HTTP connect timeout
DORIS_HTTP_READ_TIMEOUT_SECONDSread timeout
DORIS_HTTP_TOTAL_TIMEOUT_SECONDStotal request timeout
DORIS_HTTP_MAX_RESPONSE_BYTESmaximum accepted HTTP response bytes

Connection pools:

VariablePurpose
DORIS_MAX_CONNECTIONSdeployment pool ceiling
DORIS_CONNECTION_TIMEOUTMySQL connection timeout
DORIS_HEALTH_CHECK_INTERVALconnection health interval
DORIS_MAX_CONNECTION_AGEmaximum reusable connection age

All FE/BE destinations are operator configuration, never caller arguments.

Server and protocol

VariablePurpose
TRANSPORThttp or stdio
SERVER_HOSTHTTP bind host
SERVER_PORTHTTP port
WORKERSHTTP worker count; Doris OAuth requires 1
SERVER_NAMEproduct instance name, not product version
MCP_ALLOWED_HOSTSvalidated HTTP Host policy inputs
MCP_ALLOWED_ORIGINSvalidated Origin policy inputs
ENABLE_LEGACY_HTTP_ADAPTERdefault-off /mcp/legacy adapter for validated 2025-06-18 and 2025-11-25 clients
MCP_LIST_PAGE_SIZEentries per protocol list page (11000)
MCP_STATE_HANDLE_SECRETshared HMAC secret for independent replicas
MCP_STATE_HANDLE_TTL_SECONDSexplicit handle lifetime (13600)
MCP_TOOL_EXPOSURE_MODEhierarchical (default) or flat
ALLOW_UNAUTHENTICATED_NON_LOOPBACKdangerous test-only bind override

MCP_ADMIN_DOMAIN_ENABLED must remain false and MCP_ADMIN_REQUIRE_CONFIRMATION must remain true. 1.0 rejects an attempt to enable the reserved administration domain.

Query, response, and concurrency limits

VariablePurpose
ENABLE_SECURITY_CHECKapplication read-only SQL guard
BLOCKED_KEYWORDScompatibility keyword policy in addition to parsing
MAX_QUERY_COMPLEXITYconfigured complexity ceiling
MAX_RESULT_ROWSdeployment row ceiling; absolute hard cap also applies
DEFAULT_RESULT_ROWSdefault query rows when omitted
MAX_RESULT_BYTESUTF-8 JSON row-data budget
QUERY_TIMEOUTdeployment query timeout; absolute hard cap applies
MAX_CONCURRENT_QUERIESprocess query concurrency
MAX_RESPONSE_CONTENT_SIZEbounded text/content response size
ENABLE_MASKINGconfigured result masking
ENABLE_QUERY_CACHEquery cache switch
CACHE_TTLcache lifetime
MAX_CACHE_SIZEcache entry ceiling

Operation-specific runtime bounds can be stricter than deployment values. Increasing one variable does not remove the absolute safety cap.

Capability detection and domains

VariablePurpose
CAPABILITY_SNAPSHOT_TTL_SECONDSroute-private snapshot lifetime
CAPABILITY_PROBE_TIMEOUT_SECONDSbounded probe timeout
CAPABILITY_STALE_GRACE_SECONDSmaximum stale fallback window
MCP_TOOL_PROVIDERScomma-separated exact custom provider allowlist

Governance:

  • GOVERNANCE_MAX_SAMPLE_RATIO
  • GOVERNANCE_MAX_AUDIT_WINDOW_DAYS
  • GOVERNANCE_MAX_LINEAGE_EDGES
  • GOVERNANCE_LINEAGE_STORE_TABLE
  • GOVERNANCE_LINEAGE_RECENT_EVENT_MINUTES

Lakehouse:

  • LAKEHOUSE_MAX_CATALOG_OBJECTS
  • LAKEHOUSE_MAX_CATALOG_DATABASES
  • LAKEHOUSE_MAX_SNAPSHOTS
  • LAKEHOUSE_MAX_PARTITIONS
  • LAKEHOUSE_MAX_VARIANT_SAMPLE_ROWS
  • LAKEHOUSE_MAX_VARIANT_PATHS

These are evidence/result bounds, not Doris permission grants.

ADBC

VariablePurpose
ADBC_ENABLEDenable the optional advanced ADBC provider; default false
FE_ARROW_FLIGHT_SQL_PORTFE Flight SQL port
BE_ARROW_FLIGHT_SQL_PORToptional BE Flight port
ADBC_DEFAULT_MAX_ROWSdefault ADBC row limit
ADBC_DEFAULT_TIMEOUTdefault ADBC timeout
ADBC_DEFAULT_RETURN_FORMATarrow, pandas, or dict
ADBC_CONNECTION_TIMEOUTFlight connection timeout

ADBC remains subject to global result limits and fails closed on token-bound routes in 1.0. Enabling the provider does not authorize automatic selection: both ADBC child schemas and the runtime require explicit_adbc=true, which a Host should set only when the end user explicitly requests ADBC or Arrow Flight SQL. Ordinary queries use doris_query.execute_query.

Apache Ossie semantic grounding

VariablePurpose
OSSIE_ENABLEDenable the default-off semantic provider
OSSIE_MODEL_DIRECTORYdirectory of reviewed UTF-8 YAML/JSON models
OSSIE_BINDING_MANIFESTserver-private Doris binding file
OSSIE_MAX_FILE_BYTESper-file loader bound
OSSIE_MAX_TOTAL_BYTESaggregate model bound
OSSIE_MAX_MODELSmodel count bound
OSSIE_MAX_DEPTHmodel structure depth
OSSIE_MAX_ALIASESalias count bound
OSSIE_MAX_STRING_BYTESstring bound
OSSIE_MAX_EXPRESSION_BYTESexpression text bound
OSSIE_CONTEXT_MAX_BYTESdefault context budget
OSSIE_CONTEXT_HARD_MAX_BYTESabsolute context budget

OAuth modes also require explicit semantic-channel enablement and semantic:read. Every model-specific call still needs exact model_ref.

MetricFlow semantic consumption

VariablePurpose
METRICFLOW_ENABLEDenable the default-off MetricFlow consumer
METRICFLOW_PROVIDER_COMMAND_JSONabsolute executable plus fixed arguments as a JSON string array
METRICFLOW_PROJECT_DIRECTORYoptional absolute working directory for the provider
METRICFLOW_TIMEOUT_SECONDSprovider process timeout, 1-120 seconds
METRICFLOW_MAX_OUTPUT_BYTESprovider stdout limit, 1024-8388608 bytes

An enabled MetricFlow provider requires a non-empty command whose executable is absolute. The Server invokes it without a shell using protocol doris-mcp-metricflow/v1. The provider may inspect models and compile Doris SQL; all execution returns to the bounded MCP Query runtime. See MetricFlow integration.

Static token authentication

VariablePurpose
ENABLE_TOKEN_AUTHenable static bearer authentication
TOKEN_FILE_PATHmanaged digest-only token file
ENABLE_TOKEN_EXPIRYenforce managed-token expiry
DEFAULT_TOKEN_EXPIRY_HOURSdefault managed-token lifetime
TOKEN_HASH_ALGORITHMsupported persisted digest algorithm
TOKEN_DB_VALIDATION_TTL_SECONDStoken-bound Doris route validation cache
TOKEN_<ID>operator-injected high-entropy static token

No static bearer credential ships with the project.

Token management:

VariablePurpose
ENABLE_HTTP_TOKEN_MANAGEMENTenable powerful local management endpoints
TOKEN_MANAGEMENT_ADMIN_TOKENseparate high-entropy admin credential
TOKEN_MANAGEMENT_ALLOWED_IPSmanagement IP/CIDR allowlist
REQUIRE_ADMIN_AUTHmust remain true in production

Keep management disabled unless required.

JWT

Key settings include:

  • ENABLE_JWT_AUTH
  • JWT_SECRET_KEY, JWT_ALGORITHM
  • JWT_ISSUER, JWT_AUDIENCE
  • JWT_EXPIRATION_HOURS
  • verification switches for signature, expiry, issuer, and audience
  • refresh-token keys/lifetime when refresh is enabled
  • claim names for user ID, roles, permissions, and security level

Use a supported asymmetric key strategy or a deployment-specific high-entropy shared key. Replace every example placeholder.

External OAuth/OIDC

Key settings include:

  • ENABLE_OAUTH_AUTH
  • OAUTH_PROVIDER_TYPE, client ID/secret, redirect URI
  • mandatory trusted OAUTH_ISSUER and OAUTH_RESOURCE
  • OAUTH_AUDIENCE (defaults to resource)
  • discovery, authorization, token, introspection, userinfo, and JWKS endpoints
  • exact allowed/required scopes and claim names
  • default roles/security level/permissions
  • trusted domains and JSON role mappings
  • session/state secrets and lifetimes

RFC 7662 introspection is part of the trust boundary. Provider examples in .env.example are templates, not proof that a provider is safe without issuer, resource, audience, and introspection configuration.

Doris-backed OAuth

Key settings include:

  • ENABLE_DORIS_OAUTH_AUTH, DORIS_OAUTH_BASE_URL
  • exact child/channel switches and domain.child allowlists
  • token, refresh, authorization-code, client, and GC lifetimes
  • preconfigured client file and redirect URI policy
  • DCR mode and explicit production-DCR switch
  • per-IP/user/client/transaction rate limits
  • insecure-HTTP, trusted-proxy, and trusted-proxy-CIDR policy

Required invariants:

  • HTTP transport;
  • one effective worker;
  • external OAuth disabled;
  • configured service/global Doris account;
  • HTTPS for non-loopback production URL;
  • exact resource binding and scopes.

Logging and monitoring

VariablePurpose
LOG_LEVELprocess log level
LOG_FILE_PATHoptional main log path
ENABLE_AUDITaudit logging
AUDIT_FILE_PATHaudit log path
LOG_MAX_FILE_SIZE, LOG_BACKUP_COUNTrotation
ENABLE_LOG_CLEANUPautomatic cleanup
LOG_MAX_AGE_DAYSretention
LOG_CLEANUP_INTERVAL_HOURScleanup interval
ENABLE_METRICS, METRICS_PORTmetrics export
HEALTH_CHECK_PORTcompatibility monitoring port
ENABLE_ALERTS, ALERT_WEBHOOK_URLoptional alerting

Never include credential values in log configuration diagnostics.

Minimal profiles

Local stdio:

TRANSPORT=stdio
DORIS_HOST=127.0.0.1
DORIS_PORT=9030
DORIS_USER=mcp_reader
DORIS_PASSWORD=<secret>
MCP_TOOL_EXPOSURE_MODE=hierarchical

Authenticated loopback HTTP:

TRANSPORT=http
SERVER_HOST=127.0.0.1
SERVER_PORT=3000
ENABLE_TOKEN_AUTH=true
TOKEN_OPERATOR=<generated-secret>
DORIS_HOST=127.0.0.1
DORIS_USER=mcp_reader
DORIS_PASSWORD=<secret>

Generate secrets outside source control:

python -c "import secrets; print(secrets.token_urlsafe(32))"

See Deployment and Security model before using non-loopback configuration.