Validation and environment-variable expansion for MCP server config.
Resolves ${VAR} and ${VAR:-default} references in the supported
configuration fields (command, url, args, env, headers, oauth) and
validates their types. A ${VAR:-default} reference falls back to
default when VAR is unset or empty (POSIX :- semantics).
Expand ${VAR} references in value for display in an approval prompt.
Follows _interpolate_env semantics against the active environment but never
raises: an unset variable renders as <unset VAR>, and a variable whose name
looks secret renders as <VAR> rather than its value. Malformed references
pass through verbatim.
Resolve ${VAR} references in one MCP server's supported fields.
Interpolates the command, url, args, env, headers, and oauth
fields (see _interpolate_env for the reference syntax); every other
field is copied through verbatim. The input is not mutated.