MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / detect

Method detect

src/installer/targets/claude.ts:83–94  ·  view source on GitHub ↗
(loc: Location)

Source from the content-addressed store, hash-verified

81 }
82
83 detect(loc: Location): DetectionResult {
84 const mcpPath = mcpJsonPath(loc);
85 const config = readJsonFile(mcpPath);
86 const alreadyConfigured = !!config.mcpServers?.codegraph;
87 // For "installed" we infer from the existence of either the dir
88 // (global) or the project marker file (local). Cheap and avoids
89 // shelling out to `claude --version`.
90 const installed = loc === 'global'
91 ? fs.existsSync(configDir(loc)) || fs.existsSync(mcpPath)
92 : fs.existsSync(mcpPath) || fs.existsSync(configDir(loc));
93 return { installed, alreadyConfigured, configPath: mcpPath };
94 }
95
96 install(loc: Location, opts: InstallOptions): WriteResult {
97 const files: WriteResult['files'] = [];

Callers

nothing calls this directly

Calls 3

readJsonFileFunction · 0.90
mcpJsonPathFunction · 0.70
configDirFunction · 0.70

Tested by

no test coverage detected