Skip to main content

Environment variables reference

Last updated on

Every server setting is supplied through an environment variable. Variables are grouped below by purpose. Only HARNESS_API_KEY is required, and only in single-user mode.


Deployment and identity

VariableRequiredDefaultDescription
HARNESS_MCP_MODENosingle-userDeployment mode: single-user (API key set once in server config, used for all sessions) or multi-user (HTTP transport only, per-session credentials supplied via the x-harness-api-key header and optional x-harness-account-id header)
HARNESS_API_KEYYes in single-user mode--Harness personal access token or service account token. Required in single-user mode. Must not be set in multi-user mode, because the server holds no Harness credentials of its own
HARNESS_ACCOUNT_IDNo(from PAT/SAT)Harness account identifier. Auto-extracted from PAT or SAT tokens in single-user mode. In multi-user mode, sessions can supply their own account ID via the x-harness-account-id header when the API key does not embed one
HARNESS_BASE_URLNohttps://app.harness.ioHarness API and UI base URL for local stdio or self-hosted HTTP deployments. Set this to your own instance (for example, https://harness0.harness.io) when self-hosting. It has no effect on the managed https://mcp.harness.io/mcp hosted endpoint
HARNESS_ORGNo--Organization ID used when org_id is not specified per tool call. If omitted, pass org_id explicitly, or let agents discover orgs dynamically via harness_list(resource_type="organization")
HARNESS_PROJECTNo--Project ID used when project_id is not specified per tool call. If omitted, pass project_id explicitly, or let agents discover projects dynamically via harness_list(resource_type="project")
HARNESS_DEFAULT_ORG_ID (Deprecated)No--Deprecated alias for HARNESS_ORG
HARNESS_DEFAULT_PROJECT_ID (Deprecated)No--Deprecated alias for HARNESS_PROJECT

Feature Management & Experimentation

VariableRequiredDefaultDescription
HARNESS_FME_API_KEYNo--Optional Split or FME Admin API credential used for fme_ resources in self-hosted deployments. Accepts a legacy Split admin key or an FME-entitled Harness PAT or SAT. FME calls go directly to api.split.io, so hosted OAuth or service-routing credentials for Harness platform APIs do not authenticate these requests. Must not be set in multi-user mode; FME uses each session's x-harness-api-key credential instead. If unset, FME falls back to a non-placeholder HARNESS_API_KEY for self-hosted sessions
HARNESS_FME_BASE_URLNohttps://api.split.ioSplit or FME Admin API base URL used by fme_ resources. HTTP URLs require HARNESS_ALLOW_HTTP=true for local development

Requests and reliability

VariableRequiredDefaultDescription
HARNESS_API_TIMEOUT_MSNo30000HTTP request timeout in milliseconds
HARNESS_MAX_RETRIESNo3Retry count for transient failures (429, 5xx)
HARNESS_MAX_BODY_SIZE_MBNo10Max HTTP request body size in MB for http transport
HARNESS_RATE_LIMIT_RPSNo10Client-side request throttle (requests per second) to Harness APIs
HARNESS_ALLOW_HTTPNofalseAllow non-HTTPS URLs for HARNESS_BASE_URL, HARNESS_FME_BASE_URL, and HARNESS_AUDIT_WEBHOOK_URL. The server enforces HTTPS by default; set to true only for local development against non-TLS endpoints

Tool and access control

VariableRequiredDefaultDescription
HARNESS_TOOLSETSNo(defaults)Comma-separated toolset list. Empty loads the default toolsets. Supports +name to include an opt-in toolset and -name to remove a default toolset. Go to Toolset filtering to review the toolset catalog
HARNESS_READ_ONLYNofalseBlock all mutating operations (create, update, delete, execute). Only list and get operations are allowed. Useful for shared or demo environments
HARNESS_AUTO_APPROVE_RISKNononeRisk-based auto-approve threshold for autonomous workflows. Operations at or below this risk level proceed without user confirmation. Values: none, low_write, medium_write, high_write, all
HARNESS_SKIP_ELICITATION (Deprecated)NofalseSuperseded by HARNESS_AUTO_APPROVE_RISK. Setting true is equivalent to HARNESS_AUTO_APPROVE_RISK=all and logs a deprecation warning to stderr. If both are set, HARNESS_AUTO_APPROVE_RISK takes precedence
HARNESS_PIPELINE_VERSIONNo0(Alpha) Pipeline YAML version. 0 loads the pipeline resource type and excludes pipeline_v1; 1 loads pipeline_v1 and excludes pipeline. HTTP sessions can override this at initialize time with the x-harness-pipeline-version header set to 0 or 1

HTTP transport and multi-user access

VariableRequiredDefaultDescription
HARNESS_MCP_ALLOWED_HOSTSNo--Comma-separated hostnames allowed by HTTP transport Host-header validation. mcp.harness.io is allowed by default for localhost binds; add proxy or custom domains here
HARNESS_MCP_AUTH_TOKENYes for non-loopback HTTP binds--Bearer token required on /mcp HTTP routes when set. Required by default when HTTP transport binds to a non-loopback host, unless HARNESS_MCP_ALLOW_UNAUTHENTICATED_HTTP=true
HARNESS_MCP_ALLOW_UNAUTHENTICATED_HTTPNofalseExplicitly allow unauthenticated HTTP transport on non-loopback binds. Use only behind another authenticated control

Logging and audit

VariableRequiredDefaultDescription
LOG_LEVELNoinfoLog verbosity: debug, info, warn, error
HARNESS_MCP_LOG_FILENo~/.claude/harness-mcp.logFile used for stdio disconnect and crash diagnostics when stderr is no longer available
HARNESS_AUDIT_FILENo--Append audit events to a newline-delimited JSON file for durable local collection
HARNESS_AUDIT_WEBHOOK_URLNo--HTTPS endpoint that receives batched audit events. HTTP URLs require HARNESS_ALLOW_HTTP=true for local development
HARNESS_AUDIT_WEBHOOK_TOKENNo--Optional bearer token sent to the audit webhook
HARNESS_AUDIT_WEBHOOK_BATCH_SIZENo10Number of audit events to batch before webhook flush
HARNESS_AUDIT_WEBHOOK_FLUSH_MSNo5000Max time to hold audit events before webhook flush
OTEL_EXPORTER_OTLP_ENDPOINTNo--Enables OpenTelemetry audit spans when the optional OpenTelemetry packages are installed

VariableRequiredDefaultDescription
HARNESS_SEARCH_PROVIDERNolocalSemantic search backend for harness_search: local (in-process ONNX embeddings), remote (external search service over HTTP, required for multi-user mode), or none (disable semantic search and fall back to keyword scatter-gather only). Use none in air-gapped environments or when startup model loading is undesirable
HARNESS_SEARCH_SERVICE_URLYes when HARNESS_SEARCH_PROVIDER=remote--Base URL of the remote search service when HARNESS_SEARCH_PROVIDER=remote (for example, http://search-svc:8080)
HARNESS_SEARCH_SERVICE_HEADERSNo--JSON object of headers sent with every request to the remote search service. Supports any auth scheme, for example {"Authorization":"Bearer tok"} or {"x-api-key":"key"}
HARNESS_HF_CACHE_DIRNo/tmp/hf-cacheDirectory for the @huggingface/transformers model cache used by the local search provider. The Docker image pre-bakes the model into /app/.cache/hf to avoid runtime downloads. Set to a persistent volume path in production deployments

Toolset filtering

By default, all 30 toolsets (and their 139 resource types) are enabled. Use HARNESS_TOOLSETS to expose only the toolsets you need, which reduces the resource types the LLM sees and improves tool-selection accuracy.

# Only expose pipelines, services, and connectors
HARNESS_TOOLSETS=pipelines,services,connectors
ToolsetResource Types
agent-pipelinesagent, agent_run
platformorganization, project
pipelinespipeline, execution, trigger, pipeline_summary, input_set, runtime_input_template, approval_instance
servicesservice
environmentsenvironment
connectorsconnector, connector_catalogue
infrastructureinfrastructure
secretssecret
logsexecution_log
auditaudit_event
delegatesdelegate, delegate_token
repositoriesrepository, branch, commit, file_content, tag, repo_rule, space_rule
registriesregistry, artifact, artifact_version, artifact_file
templatestemplate
dashboardsdashboard, dashboard_data
idpidp_entity, scorecard, scorecard_check, scorecard_stats, scorecard_check_stats, idp_score, idp_workflow, idp_tech_doc
pull-requestspull_request, pr_reviewer, pr_comment, pr_check, pr_activity
feature-flagsfme_workspace, fme_environment, fme_feature_flag, fme_feature_flag_definition, fme_rollout_status, fme_rule_based_segment, fme_rule_based_segment_definition, feature_flag
gitopsgitops_agent, gitops_application, gitops_cluster, gitops_repository, gitops_applicationset, gitops_repo_credential, gitops_app_event, gitops_pod_log, gitops_managed_resource, gitops_resource_action, gitops_dashboard, gitops_app_resource_tree
chaoschaos_experiment, chaos_probe, chaos_experiment_template, chaos_infrastructure, chaos_experiment_variable, chaos_experiment_run, chaos_loadtest, chaos_k8s_infrastructure, chaos_hub, chaos_fault, chaos_network_map, chaos_guard_condition, chaos_guard_rule, chaos_recommendation, chaos_risk
ccmcost_perspective, cost_breakdown, cost_timeseries, cost_summary, cost_recommendation, cost_anomaly, cost_anomaly_summary, cost_category, cost_account_overview, cost_filter_value, cost_recommendation_stats, cost_recommendation_detail, cost_commitment
seisei_metric, sei_productivity_metric, sei_dora_metric, sei_team, sei_team_detail, sei_org_tree, sei_org_tree_detail, sei_business_alignment, sei_ai_usage, sei_ai_adoption, sei_ai_impact, sei_ai_raw_metric
scsscs_artifact_source, artifact_security, scs_artifact_component, scs_artifact_remediation, scs_chain_of_custody, scs_compliance_result, code_repo_security, scs_sbom
stosecurity_issue, security_issue_filter, security_exemption
access_controluser, user_group, service_account, role, role_assignment, resource_group, permission
governancepolicy, policy_set, policy_evaluation
freezefreeze_window, global_freeze
overridesservice_override
settingssetting
visualizationsvisual_timeline, visual_stage_flow, visual_health_dashboard, visual_pie_chart, visual_bar_chart, visual_timeseries, visual_architecture

Next steps