MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / readJson

Function readJson

src/mcp/config.ts:29–35  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

27 */
28
29function 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. */
38function expandEnv(value: string): string {

Callers 3

readSettingsServersFunction · 0.70
readMcpJsonFunction · 0.70
readFullSettingsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected