fix(mcp): restrict env var expansion in MCP configs

Block sensitive env var interpolation in MCP config expansion so repo and plugin MCP definitions cannot exfiltrate secrets by default.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-02 14:55:01 +09:00
parent a637cca702
commit e8c5727a22
9 changed files with 260 additions and 0 deletions
+7
View File
@@ -20,6 +20,7 @@ const PARTIAL_STRING_ARRAY_KEYS = new Set([
"disabled_hooks",
"disabled_commands",
"disabled_tools",
"mcp_env_allowlist",
]);
export function parseConfigPartially(
@@ -154,6 +155,12 @@ export function mergeConfigs(
...(override.disabled_tools ?? []),
]),
],
mcp_env_allowlist: [
...new Set([
...(base.mcp_env_allowlist ?? []),
...(override.mcp_env_allowlist ?? []),
]),
],
claude_code: deepMerge(base.claude_code, override.claude_code),
};
}