MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / readJsonConfig

Function readJsonConfig

apps/desktop/src/main/mcp-integrations.ts:141–153  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

139}
140
141async function readJsonConfig(filePath: string): Promise<JsonMcpConfig> {
142 try {
143 const raw = await fsp.readFile(filePath, 'utf8')
144 const parsed = JSON.parse(raw) as unknown
145 if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
146 return parsed as JsonMcpConfig
147 }
148 return {}
149 } catch (err) {
150 if ((err as NodeJS.ErrnoException).code === 'ENOENT') return {}
151 throw err
152 }
153}
154
155async function writeJsonConfig(filePath: string, data: JsonMcpConfig): Promise<void> {
156 await fsp.mkdir(path.dirname(filePath), { recursive: true })

Callers 3

getMcpClientStatusesFunction · 0.85
installMcpForClientFunction · 0.85
uninstallMcpForClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected