* feat: multi-instance NPM configuration Adds NPM_INSTANCES env var (JSON map) to manage multiple NPM servers from a single MCP instance. Every tool gains an optional 'instance' parameter. Legacy single-instance config (NPM_API_URL/IDENTITY/SECRET) still works unchanged. Includes list_instances tool, per-instance proxy_defaults and log_dir, and full backward compatibility. * fix(config): add explicit type validation for NPM_INSTANCES fields * fix(multi-instance): fix cross-instance log leakage and order-dependent default selection * chore(multi-instance): document NPM_DEFAULT_INSTANCE and harden logs fallback logic against cross-instance leakage --------- Co-authored-by: b3nw <189466+b3nw@users.noreply.github.com>
31 lines
1.3 KiB
Plaintext
31 lines
1.3 KiB
Plaintext
# NPM MCP Configuration
|
|
# --- Single instance mode (default) ---
|
|
NPM_API_URL=http://localhost:81/api
|
|
NPM_IDENTITY=admin@example.com
|
|
NPM_SECRET=changeme
|
|
|
|
# --- Multi-instance mode (overrides single instance settings above) ---
|
|
# NPM_INSTANCES='{"prod":{"api_url":"http://npm-prod:81/api","identity":"admin@example.com","secret":"x"},"staging":{"api_url":"http://npm-staging:81/api","identity":"admin@example.com","secret":"y"}}'
|
|
# NPM_DEFAULT_INSTANCE=prod
|
|
|
|
# Server Configuration
|
|
NPM_MCP_HOST=0.0.0.0
|
|
NPM_MCP_PORT=8000
|
|
NPM_MCP_TRANSPORT=stdio # stdio or http
|
|
|
|
# Enable destructive/write operations (create, update, delete, enable, disable)
|
|
# NPM_MCP_ENABLE_DESTRUCTIVE_TOOLS=true
|
|
|
|
# Optional: Require bearer token for MCP HTTP clients
|
|
# NPM_MCP_AUTH_TOKEN=your-secret-token-here
|
|
|
|
# Log Access (optional)
|
|
# Mount NPM's /data/logs directory and set this to the mount path.
|
|
# Enables the get_proxy_host_logs tool for reading nginx access/error logs.
|
|
# NPM_LOG_DIR=/data/npm-logs
|
|
|
|
# Proxy Host Creation Defaults (JSON)
|
|
# Set default values for create_proxy_host tool parameters
|
|
# Example with wildcard cert: NPM_PROXY_DEFAULTS='{"certificate_id": 24, "ssl_forced": true}'
|
|
# NPM_PROXY_DEFAULTS='{"certificate_id": 0, "ssl_forced": true, "block_exploits": true, "allow_websocket_upgrade": true}'
|