MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / expand

Function expand

src/mcp/manager.ts:21–26  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

19export function expandEnvRefs(config: MCPServerConfig, serverName: string): MCPServerConfig {
20 const missing = new Set<string>();
21 const expand = (s: string): string =>
22 s.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_m, varName: string) => {
23 const v = process.env[varName];
24 if (v === undefined || v === '') { missing.add(varName); return ''; }
25 return v;
26 });
27
28 const out: MCPServerConfig = { ...config };
29

Callers 1

expandEnvRefsFunction · 0.70

Calls 1

addMethod · 0.80

Tested by

no test coverage detected