Table of Contents

Environment Customization

Configure PoshMcp's runtime environment for your specific use case.

For detailed environment customization guide, see ENVIRONMENT-CUSTOMIZATION.md in the repository.

Quick Reference

Environment Variables

# Transport mode
export POSHMCP_TRANSPORT=http

# Log level
export POSHMCP_LOG_LEVEL=debug

# Configuration file path
export POSHMCP_CONFIGURATION=/config/appsettings.json

# Build-time Docker module pre-install (used only during docker build, not at runtime)
export INSTALL_PS_MODULES="Az.Accounts Az.Resources"

Startup Scripts

Runs custom PowerShell per pooled runspace worker at warm-up and replenishment (not once at server startup). See the Startup Scripts Guide for idempotency requirements:

{
  "PowerShellConfiguration": {
    "Environment": {
      "StartupScript": "$Global:CompanyName = 'Acme'"
    }
  }
}

Or load from a file:

{
  "PowerShellConfiguration": {
    "Environment": {
      "StartupScriptPath": "/config/startup.ps1"
    }
  }
}

Module Installation

poshmcp update-config --add-module Az.Accounts

See also: ENVIRONMENT-CUSTOMIZATION.md in the repository for comprehensive guide