* MCP server configuration loader. * * Resolution order (lowest precedence first), mirroring Claude Code: * 1. User scope: `~/.orbcode/settings.json` -> `mcpServers` * 2. Project scope: `.mcp.json` in the cwd and every parent directory * (closer-to-cwd wins on name collisions) * 3.
(filePath: string)
| 27 | */ |
| 28 | |
| 29 | function readJson(filePath: string): Record<string, unknown> | undefined { |
| 30 | try { |
| 31 | return JSON.parse(fs.readFileSync(filePath, "utf8")) |
| 32 | } catch { |
| 33 | return undefined |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /** Expand ${VAR} and $VAR references in a string using process.env. */ |
| 38 | function expandEnv(value: string): string { |
no outgoing calls
no test coverage detected