Skip to main content

Build environment policy

Use this directive to inject environment variables into every MCP server container managed by ToolHive. For example, configure an HTTP proxy, an internal endpoint, or another organization-wide value.

You'll need the Enterprise Manager already deployed and reachable by clients.

Configure the build environment directive

Add the build_env directive to your enterprise configuration. The value is a flat map of environment variable names to string values. Pick an enforcement level to match your use case.

values.yaml
enterpriseConfig:
build_env:
value:
HTTP_PROXY: 'http://proxy.example.com:3128'
HTTPS_PROXY: 'http://proxy.example.com:3128'
NO_PROXY: 'localhost,127.0.0.1,.internal.example.com'
enforcement: 'enforced'

Use enforced for required variables. Use default to let client operators override the variables locally.

After updating your configuration, apply the change.

Variations

Advisory defaults

Provide org-wide environment defaults while allowing local overrides:

values.yaml
enterpriseConfig:
build_env:
value:
MY_INTERNAL_API: 'https://api.internal.example.com'
enforcement: 'default'

Next steps