Configuration#
All settings are read from environment variables or a .env file in the working directory.
Order of precedence#
When the same variable is defined in more than one place, the server resolves it in this order (highest wins):
Shell environment — variables already exported in the process environment take priority over everything else.
.env file — a
.envfile in the working directory is loaded on startup; values here override compiled-in defaults but are overridden by the shell environment.Defaults — built-in defaults apply when a variable is absent from both the shell environment and the
.envfile.
For the minimal set of variables needed to get up and running, see the Configure step in the quickstart guide. The sections below document every user configurable variables, grouped by area.
Core variables#
These variables are required by the server at runtime and at index-build time.
Variable |
Required |
Description |
|---|---|---|
|
yes |
Postgres + pgvector connection string |
|
yes * |
OpenAI key for embeddings (not required when using local embeddings — see Local embeddings below) |
|
yes |
Directory of |
|
no |
JSON array of vector collections to index and expose as search tools. Defaults to the OneTick documentation collections. See Active collections. |
|
no |
JSON object declaring config-only (no-code) Markdown collections: |
Server variables#
Variable |
Required |
Description |
|---|---|---|
|
no |
Comma-separated tool groups to enable (default: all). See Tools. |
|
no |
Server port (default |
|
no |
Uvicorn worker process count (default |
|
no |
JSON list of hostnames allowed in the |
|
no |
Enable |
Local embeddings#
By default the server uses OpenAI to generate embeddings. To run without an OpenAI key, switch to a local sentence-transformer model:
Variable |
Required |
Description |
|---|---|---|
|
no |
Set to |
|
no |
HuggingFace model name (e.g. |
When EMBEDDING_TYPE=sentence_transformer is set, OPENAI_API_KEY is not required and the model is downloaded from HuggingFace on first use.
Local embeddings require the local-embeddings extra. If you installed without it, reinstall with:
pip install "onetick-mcp" "onetick-llmbase[local-embeddings]"
Index-build variables#
These variables are used only when running the index build step (python -m onetick_llmbase.build_index).
To re-index a subset of collections without changing COLLECTIONS, pass --only_collections to build_index:
python -m onetick_llmbase.build_index -c onetick_mcp.config --only_collections python-docs,cloud
Query Based / OneTick auth variables#
These variables are required only when the Query Based tool group is enabled. See OneTick WebAPI authentication for a full explanation of each auth mode.
Variable |
Required |
Description |
|---|---|---|
|
for symbology |
|
|
for symbology |
Set |
|
for symbology |
WebAPI gateway URL |
|
openid mode |
OAuth2 client ID |
|
openid mode |
OAuth2 client secret |
|
openid mode |
OAuth2 token endpoint |
|
basic mode |
HTTP Basic auth username |
|
basic mode |
HTTP Basic auth password |
|
no |
Path to a custom query file. See Programmable Queries. |
|
no |
Symbology query timeout in seconds (default |
|
no |
Maximum |
Logging variables#
Variable |
Required |
Description |
|---|---|---|
|
no |
Directory for dated log files (default |
|
no |
Log filename prefix (default |
|
no |
Log level (default |
|
no |
Write dated log files (default |
|
no |
Also log to stdout (default |
|
no |
Use UTC for timestamps and daily file rollover (default |
SSO variables#
SSO is disabled by default. Set SSO_ENABLED=true and supply the variables below to require OIDC JWT validation on all incoming MCP client connections. See MCP server authentication.
Variable |
Required |
Description |
|---|---|---|
|
no |
Enable SSO / OIDC token validation (default |
|
for SSO |
OIDC provider issuer URL |
|
recommended |
Expected token audience. Optional — if unset, the |
|
no |
Required token scopes (connect-time gate) |
|
for SSO |
SSO base URL |
|
for SSO |
SSO client ID |
|
for SSO |
SSO client secret |
|
no |
Override the discovered OAuth authorization endpoint (for a non-discoverable provider) |
|
no |
Override the discovered OAuth token endpoint |
|
no |
Override the discovered JWKS URI |
|
no |
Override the discovered OIDC userinfo endpoint |
|
for SSO |
Stable secret used to sign MCP-issued tokens. Required when SSO is enabled — the server fails to start if unset. Generate with |
|
for SSO |
Fernet key encrypting the local OAuth state store. Required when SSO is enabled — the server fails to start if unset or invalid. Generate with |
|
no |
Directory for the local OAuth state store (default |