/** * `${ENV_VAR}` substitution for MCP header values. * * SDK1 ergonomic — header values like `"Bearer ${HANDBOOK_API_TOKEN}"` are * resolved against `process.env` at connect time so consumers can author * static `mcpServers` configs (typically loaded from disk or embedded in * source) without committing secrets. Preserved verbatim to keep SDK1 → * SDK2 migration ergonomically equivalent for typical MCP-header * substitution use cases. * * Semantics: * - `${VAR}` references `process.env.VAR`. Unset variables resolve to the * empty string; this matches shell expansion (`echo "$UNSET"` → `""`) * and SDK1's behavior. * - `$VAR` (no braces) is NOT substituted — we keep substitution explicit * so a literal `$200` in a header isn't accidentally interpreted as a * reference to `process.env[200]`. * - `\${VAR}` is an escape — emits the literal `${VAR}` without * substitution. Useful for the rare case where the header value * genuinely contains `${...}` literals. * * The implementation is platform-neutral: `process.env` is the only OS * touchpoint. Browsers don't run the MCP bridge (subprocess + arbitrary * fetch authority are server-side concerns), so a Node-only assumption is * fine; the browser shim falls through to identity behavior. */ /** * Substitute `${VAR}` references in a single string against `process.env`. * Returns the resolved string; unset references collapse to empty. * * `\${VAR}` is the escape form — it emits the literal `${VAR}` so callers * can carry through a value that contains the syntax verbatim. */ export declare function substituteEnvInString(value: string, env?: NodeJS.ProcessEnv): string; /** * Substitute `${VAR}` references across every value in a string-keyed map. * Returns a fresh object; the input is not mutated. Keys are passed through * unchanged (header names aren't subject to env substitution). */ export declare function substituteEnvInHeaders(headers: { readonly [key: string]: string; } | undefined, env?: NodeJS.ProcessEnv): { [key: string]: string; } | undefined; //# sourceMappingURL=substituteEnv.d.ts.map