MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / applyServerConfig

Function applyServerConfig

src/index.ts:1651–1671  ·  view source on GitHub ↗
(
  serverConfig: Awaited<ReturnType<typeof loadServerConfig>>
)

Source from the content-addressed store, hash-verified

1649}
1650
1651async function applyServerConfig(
1652 serverConfig: Awaited<ReturnType<typeof loadServerConfig>>
1653): Promise<void> {
1654 for (const proj of serverConfig?.projects ?? []) {
1655 try {
1656 const stats = await fs.stat(proj.root);
1657 if (!stats.isDirectory()) {
1658 console.error(`[config] Skipping non-directory project root: ${proj.root}`);
1659 continue;
1660 }
1661 const rootKey = normalizeRootKey(proj.root);
1662 configRoots.set(rootKey, { rootPath: proj.root });
1663 registerKnownRoot(proj.root);
1664 const runtimeOverrides = buildProjectRuntimeOverrides(proj);
1665 const project = getOrCreateProject(proj.root);
1666 project.runtimeOverrides = runtimeOverrides;
1667 } catch {
1668 console.error(`[config] Skipping inaccessible project root: ${proj.root}`);
1669 }
1670 }
1671}
1672
1673async function main() {
1674 await ensureMcpRuntimeLoaded();

Callers 2

mainFunction · 0.85
startHttpFunction · 0.85

Calls 5

normalizeRootKeyFunction · 0.85
registerKnownRootFunction · 0.85
getOrCreateProjectFunction · 0.85
setMethod · 0.80

Tested by

no test coverage detected