Skip to main content

Configuration Reference

Configure the MCP Server through environment variables that control how it authenticates, connects to the API, and manages runtime behavior.

The Hyperstack API MCP Server is configured entirely through environment variables that control how it authenticates, connects to the Hyperstack API, and manages runtime behavior.

This guide provides a reference for all supported configuration variables and demonstrates how to apply them in local and production environments.

Configuration Overview

All MCP Server configuration is managed through environment variables.

You can configure the server by:

  • Setting variables in a .env file
  • Exporting variables in your shell
  • Passing variables directly to Docker using -e
  • Supplying environment configuration via orchestration tools (e.g., Kubernetes, Docker Compose)
Environment Variable Precedence

Environment variables always take precedence over .env file defaults.

Core Configuration

These variables control authentication and basic runtime behavior.

VariableTypeDefaultRequiredDescription
HYPERSTACK_API_KEYstringYesYour Hyperstack API key used for authenticating API requests.
HYPERSTACK_API_URLstringhttps://infrahub-api.nexgencloud.com/v1NoBase URL for the Hyperstack Infrahub API. Override only if using a staging or private endpoint.
ENVIRONMENTstringlocalNoRuntime environment (local, dev, prod).

HYPERSTACK_API_KEY (Required)

This key is used to authenticate all outbound API requests.

You can generate an API key from the:

Hyperstack Console → API Keys
https://console.hyperstack.cloud/api-keys

API Key Security

Never commit your API key to version control. Inject it securely using environment variables or secret managers.

Logging Configuration

These variables control logging level and output format.

VariableTypeDefaultRequiredDescription
LOG_LEVELstringINFONoLogging verbosity (DEBUG, INFO, WARNING, ERROR, CRITICAL).
LOG_FORMATstringjsonNoLog output format (json or text).

These settings configure the server to use standard informational logging with structured JSON output suitable for production environments.

LOG_LEVEL=INFO
LOG_FORMAT=json

These settings configure the server to use verbose debug logging with human-readable text output for local troubleshooting.

LOG_LEVEL=DEBUG
LOG_FORMAT=text

Connection Pool Configuration

These variables control HTTP connection pooling behavior.

VariableTypeDefaultRequiredDescription
MAX_CONNECTIONSinteger100NoMaximum total concurrent connections in the HTTP pool.
MAX_KEEPALIVE_CONNECTIONSinteger50NoMaximum number of keep-alive connections.
KEEPALIVE_EXPIRYinteger (seconds)5NoIdle connection keep-alive duration in seconds.

Request and Retry Configuration

These variables control request timeouts and retry behavior.

VariableTypeDefaultRequiredDescription
REQUEST_TIMEOUTinteger (seconds)30NoTimeout duration for API requests.
MAX_RETRIESinteger3NoMaximum number of retry attempts for failed API calls.
RETRY_BACKOFF_FACTORfloat0.5NoExponential backoff multiplier between retries.

Retry Behavior

Retries use exponential backoff:

delay = RETRY_BACKOFF_FACTOR * (2 ^ retry_attempt)

Example Configuration (.env)

This example shows a complete .env configuration.

.env
# Core
HYPERSTACK_API_KEY=your_api_key_here
HYPERSTACK_API_URL=https://infrahub-api.nexgencloud.com/v1
ENVIRONMENT=local

# Logging
LOG_LEVEL=INFO
LOG_FORMAT=json

# Connection Pool
MAX_CONNECTIONS=100
MAX_KEEPALIVE_CONNECTIONS=50
KEEPALIVE_EXPIRY=5

# Request Handling
REQUEST_TIMEOUT=30
MAX_RETRIES=3
RETRY_BACKOFF_FACTOR=0.5

Start the MCP Server:

docker run --env-file .env -p 8080:8080 ghcr.io/nexgencloud/hyperstack-mcp-server:latest

Docker Configuration Example

This example injects configuration using Docker flags.

Run MCP Server with Custom Configuration
docker run --rm \
--name hyperstack-mcp \
-p 8080:8080 \
-e HYPERSTACK_API_KEY=your_api_key_here \
-e LOG_LEVEL=DEBUG \
-e LOG_FORMAT=text \
-e MAX_RETRIES=5 \
ghcr.io/nexgencloud/hyperstack-mcp-server:latest

Production Deployment Considerations

These are common hardening practices for production deployments.

  • Use secure secret storage (e.g., Kubernetes Secrets, Vault).
  • Avoid exposing debug logs.
  • Monitor retry counts and timeout errors.
  • Use a reverse proxy (e.g., NGINX) if exposing beyond localhost.
  • Restrict network access to trusted clients only.

Back to top