import{_ as a,c as o,o as t,a6 as i}from"./chunks/framework.CHl2ywxc.js";const u=JSON.parse('{"title":"Configuration Management","description":"","frontmatter":{},"headers":[],"relativePath":"guides/configuration-management.md","filePath":"guides/configuration-management.md","lastUpdated":1755281500000}'),n={name:"guides/configuration-management.md"};function d(r,e,c,s,l,h){return t(),o("div",null,e[0]||(e[0]=[i('<h1 id="configuration-management" tabindex="-1">Configuration Management <a class="header-anchor" href="#configuration-management" aria-label="Permalink to "Configuration Management""></a></h1><p>Master MCP Server supports JSON or YAML configuration files, environment variable overrides, CLI overrides, schema validation, and secret resolution.</p><h2 id="files" tabindex="-1">Files <a class="header-anchor" href="#files" aria-label="Permalink to "Files""></a></h2><ul><li>Default paths: <code>config/default.json</code>, <code>config/<env>.json</code></li><li>Explicit path: set <code>MASTER_CONFIG_PATH=/path/to/config.yaml</code></li><li>Schema: <code>config/schema.json</code> (also embedded in code as a fallback)</li></ul><h2 id="environment-overrides" tabindex="-1">Environment Overrides <a class="header-anchor" href="#environment-overrides" aria-label="Permalink to "Environment Overrides""></a></h2><p>Environment variables map to config fields. Key ones:</p><ul><li><code>MASTER_HOSTING_PLATFORM</code>, <code>MASTER_HOSTING_PORT</code>, <code>MASTER_BASE_URL</code></li><li><code>MASTER_LOG_LEVEL</code></li><li><code>MASTER_OAUTH_*</code> (ISSUER, AUTHORIZATION_ENDPOINT, TOKEN_ENDPOINT, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, SCOPES, AUDIENCE)</li><li><code>MASTER_SERVERS</code> (JSON) or <code>MASTER_SERVERS_YAML</code> (YAML)</li></ul><p>See <code>docs/configuration/environment-variables.md</code> and <code>.env.example</code>.</p><h2 id="cli-overrides" tabindex="-1">CLI Overrides <a class="header-anchor" href="#cli-overrides" aria-label="Permalink to "CLI Overrides""></a></h2><p>You can override nested fields with dotted keys:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>node dist/node/index.js --hosting.port=4000 --routing.retry.maxRetries=3</span></span></code></pre></div><h2 id="secrets" tabindex="-1">Secrets <a class="header-anchor" href="#secrets" aria-label="Permalink to "Secrets""></a></h2><ul><li><code>env:VARNAME</code> → replaced by <code>process.env.VARNAME</code> at load time</li><li><code>enc:gcm:<base64></code> → decrypted using <code>MASTER_CONFIG_KEY</code> (or <code>MASTER_SECRET_KEY</code>)</li></ul><p>Use <code>SecretManager</code> to encrypt/decrypt/rotate secrets safely.</p><h2 id="hot-reload-node" tabindex="-1">Hot Reload (Node) <a class="header-anchor" href="#hot-reload-node" aria-label="Permalink to "Hot Reload (Node)""></a></h2><p>When <code>ConfigManager</code> is created with <code>{ watch: true }</code>, changes to <code>config/default.json</code>, <code>config/<env>.json</code>, or an explicit path will be validated and emitted. Some changes (e.g., hosting.port) still require a restart.</p><h2 id="validation" tabindex="-1">Validation <a class="header-anchor" href="#validation" aria-label="Permalink to "Validation""></a></h2><p>Configs are validated using a lightweight schema validator (<code>SchemaValidator</code>) with support for types, enums, required fields, arrays, and formats (<code>url</code>, <code>integer</code>). On failure, the error lists the exact path and reason.</p>',18)]))}const g=a(n,[["render",d]]);export{u as __pageData,g as default};